Unify camera model into immutable factory-built type
This commit is contained in:
+19
-2
@@ -25,10 +25,27 @@ struct Camera
|
||||
std::array<float, 5> DC = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f};
|
||||
std::array<std::array<float, 3>, 3> R;
|
||||
std::array<std::array<float, 1>, 3> T;
|
||||
int width;
|
||||
int height;
|
||||
int width = 0;
|
||||
int height = 0;
|
||||
CameraModel model = CameraModel::Pinhole;
|
||||
std::array<std::array<float, 3>, 3> invR {};
|
||||
std::array<float, 3> center {};
|
||||
std::array<std::array<float, 3>, 3> newK {};
|
||||
std::array<std::array<float, 3>, 3> invK {};
|
||||
|
||||
friend std::ostream &operator<<(std::ostream &out, Camera const &camera);
|
||||
std::string to_string() const;
|
||||
};
|
||||
|
||||
Camera make_camera(
|
||||
std::string name,
|
||||
std::array<std::array<float, 3>, 3> K,
|
||||
std::array<float, 5> DC,
|
||||
std::array<std::array<float, 3>, 3> R,
|
||||
std::array<std::array<float, 1>, 3> T,
|
||||
int width,
|
||||
int height,
|
||||
CameraModel model);
|
||||
|
||||
void undistort_point_pinhole(std::array<float, 3> &point, const std::array<float, 5> &distortion);
|
||||
void undistort_point_fisheye(std::array<float, 3> &point, const std::array<float, 5> &distortion);
|
||||
|
||||
Reference in New Issue
Block a user