FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
OpenSplat/input_data.hpp at main · NotCompsky/OpenSplat · GitHub
NotCompsky
/
OpenSplat
Public
forked from
WebODM/OpenSplat
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
OpenSplat
/
input_data.hpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
74 lines (64 loc) · 2.23 KB
Breadcrumbs
OpenSplat
/
input_data.hpp
Copy path
File metadata and controls
74 lines (64 loc) · 2.23 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#
ifndef
INPUTDATA_H
#
define
INPUTDATA_H
#
include
<
iostream
>
#
include
<
string
>
#
include
<
fstream
>
#
include
<
unordered_map
>
#
include
<
opencv2/calib3d.hpp
>
#
include
<
torch/torch.h
>
enum
CameraType { Perspective };
struct
Camera
{
int
id = -
1
;
int
width =
0
;
int
height =
0
;
float
fx =
0
;
float
fy =
0
;
float
cx =
0
;
float
cy =
0
;
float
k1 =
0
;
float
k2 =
0
;
float
k3 =
0
;
float
p1 =
0
;
float
p2 =
0
;
torch::Tensor camToWorld;
std::string filePath =
"
"
;
std::string maskPath =
"
"
;
CameraType cameraType = CameraType::Perspective;
Camera
(){};
Camera
(
int
width,
int
height,
float
fx,
float
fy,
float
cx,
float
cy,
float
k1,
float
k2,
float
k3,
float
p1,
float
p2,
const
torch::Tensor &camToWorld,
const
std::string &filePath,
const
std::string &maskPath) :
width
(width), height(height), fx(fx), fy(fy), cx(cx), cy(cy),
k1
(k1), k2(k2), k3(k3), p1(p1), p2(p2),
camToWorld
(camToWorld), filePath(filePath), maskPath(maskPath) {}
torch::Tensor
getIntrinsicsMatrix
();
bool
hasDistortionParameters
();
std::vector<
float
>
undistortionParameters
();
torch::Tensor
getImage
(
int
downscaleFactor);
torch::Tensor
getMask
(
int
downscaleFactor);
void
loadImage
(
float
downscaleFactor);
void
loadMask
(
float
downscaleFactor);
torch::Tensor K;
torch::Tensor image;
torch::Tensor mask;
std::unordered_map<
int
, torch::Tensor> imagePyramids;
std::unordered_map<
int
, torch::Tensor> maskPyramids;
private:
torch::Tensor
undistortTensor
(cv::Mat &cImg, torch::Tensor &_K,
bool
shouldUpdateK,
const
torch::Dtype dataType);
torch::Tensor
getScaledStoredTensor
(
int
downscaleFactor, torch::Tensor &tensor, std::unordered_map<
int
, torch::Tensor> &map,
const
torch::Dtype dataType,
const
float
normalizeBy);
};
struct
Points
{
torch::Tensor xyz;
torch::Tensor rgb;
};
struct
InputData
{
std::vector<Camera> cameras;
float
scale;
torch::Tensor translation;
Points points;
std::tuple<std::vector<Camera>, Camera *>
getCameras
(
bool
validate,
const
std::string &valImage =
"
random
"
);
void
saveCameras
(
const
std::string &filename,
bool
keepCrs);
};
InputData
inputDataFromX
(
const
std::string &projectRoot);
#
endif
Back
|
FazBrowse Home
|
New Git URL