10 #include <ceres/ceres.h>
13 #include <Eigen/Dense>
57 #ifndef CAMERA_MODEL_DEFINITIONS
58 #define CAMERA_MODEL_DEFINITIONS(model_id_value, model_name_value, \
60 static const int kModelId = model_id_value; \
61 static const size_t kNumParams = num_params_value; \
62 static const int model_id; \
63 static const std::string model_name; \
64 static const size_t num_params; \
65 static const std::string params_info; \
66 static const std::vector<size_t> focal_length_idxs; \
67 static const std::vector<size_t> principal_point_idxs; \
68 static const std::vector<size_t> extra_params_idxs; \
70 static inline int InitializeModelId() { return model_id_value; }; \
71 static inline std::string InitializeModelName() { \
72 return model_name_value; \
74 static inline size_t InitializeNumParams() { return num_params_value; }; \
75 static inline std::string InitializeParamsInfo(); \
76 static inline std::vector<size_t> InitializeFocalLengthIdxs(); \
77 static inline std::vector<size_t> InitializePrincipalPointIdxs(); \
78 static inline std::vector<size_t> InitializeExtraParamsIdxs(); \
79 static inline std::vector<double> InitializeParams( \
80 const double focal_length, const size_t width, \
81 const size_t height); \
83 template <typename T> \
84 static void WorldToImage(const T* params, const T u, const T v, T* x, \
86 template <typename T> \
87 static void ImageToWorld(const T* params, const T x, const T y, T* u, \
89 template <typename T> \
90 static void Distortion(const T* extra_params, const T u, const T v, T* du, \
94 #ifndef CAMERA_MODEL_CASES
95 #define CAMERA_MODEL_CASES \
96 CAMERA_MODEL_CASE(SimplePinholeCameraModel) \
97 CAMERA_MODEL_CASE(PinholeCameraModel) \
98 CAMERA_MODEL_CASE(SimpleRadialCameraModel) \
99 CAMERA_MODEL_CASE(SimpleRadialFisheyeCameraModel) \
100 CAMERA_MODEL_CASE(RadialCameraModel) \
101 CAMERA_MODEL_CASE(RadialFisheyeCameraModel) \
102 CAMERA_MODEL_CASE(OpenCVCameraModel) \
103 CAMERA_MODEL_CASE(OpenCVFisheyeCameraModel) \
104 CAMERA_MODEL_CASE(FullOpenCVCameraModel) \
105 CAMERA_MODEL_CASE(FOVCameraModel) \
106 CAMERA_MODEL_CASE(ThinPrismFisheyeCameraModel)
109 #ifndef CAMERA_MODEL_SWITCH_CASES
110 #define CAMERA_MODEL_SWITCH_CASES \
113 CAMERA_MODEL_DOES_NOT_EXIST_EXCEPTION \
117 #define CAMERA_MODEL_DOES_NOT_EXIST_EXCEPTION \
118 throw std::domain_error("Camera model does not exist");
123 template <
typename CameraModel>
125 template <
typename T>
129 const T min_focal_length_ratio,
130 const T max_focal_length_ratio,
131 const T max_extra_param);
133 template <
typename T>
137 const T min_focal_length_ratio,
138 const T max_focal_length_ratio);
140 template <
typename T>
145 template <
typename T>
147 const T max_extra_param);
149 template <
typename T>
152 template <
typename T>
278 template <typename T>
280 const T* extra_params, const T u, const T v, T* du, T* dv);
358 const double focal_length,
383 const std::vector<double>& params);
397 const std::vector<double>& params,
400 const double min_focal_length_ratio,
401 const double max_focal_length_ratio,
402 const double max_extra_param);
414 const std::vector<double>& params,
429 const std::vector<double>& params,
445 const std::vector<double>& params,
446 const double threshold);
455 template <
typename CameraModel>
456 template <
typename T>
458 const std::vector<T>& params,
461 const T min_focal_length_ratio,
462 const T max_focal_length_ratio,
463 const T max_extra_param) {
469 max_focal_length_ratio)) {
480 template <
typename CameraModel>
481 template <
typename T>
483 const std::vector<T>& params,
486 const T min_focal_length_ratio,
487 const T max_focal_length_ratio) {
490 for (
const auto& idx : CameraModel::focal_length_idxs) {
491 const T focal_length_ratio = params[idx] / max_size;
492 if (focal_length_ratio < min_focal_length_ratio ||
493 focal_length_ratio > max_focal_length_ratio) {
501 template <
typename CameraModel>
502 template <
typename T>
504 const std::vector<T>& params,
const size_t width,
const size_t height) {
505 const T cx = params[CameraModel::principal_point_idxs[0]];
506 const T cy = params[CameraModel::principal_point_idxs[1]];
507 return cx < 0 || cx >
width || cy < 0 || cy >
height;
510 template <
typename CameraModel>
511 template <
typename T>
513 const std::vector<T>& params,
const T max_extra_param) {
514 for (
const auto& idx : CameraModel::extra_params_idxs) {
515 if (std::abs(params[idx]) > max_extra_param) {
523 template <
typename CameraModel>
524 template <
typename T>
527 T mean_focal_length = 0;
528 for (
const auto& idx : CameraModel::focal_length_idxs) {
529 mean_focal_length += params[idx];
531 mean_focal_length /= CameraModel::focal_length_idxs.size();
532 return threshold / mean_focal_length;
535 template <
typename CameraModel>
536 template <
typename T>
543 const size_t kNumIterations = 100;
544 const double kMaxStepNorm = 1
e-10;
545 const double kRelStepSize = 1
e-6;
548 const Eigen::Vector2d x0(*u, *v);
549 Eigen::Vector2d
x(*u, *v);
551 Eigen::Vector2d dx_0b;
552 Eigen::Vector2d dx_0f;
553 Eigen::Vector2d dx_1b;
554 Eigen::Vector2d dx_1f;
556 for (
size_t i = 0; i < kNumIterations; ++i) {
557 const double step0 = std::max(std::numeric_limits<double>::epsilon(),
558 std::abs(kRelStepSize *
x(0)));
559 const double step1 = std::max(std::numeric_limits<double>::epsilon(),
560 std::abs(kRelStepSize *
x(1)));
561 CameraModel::Distortion(params,
x(0),
x(1), &dx(0), &dx(1));
562 CameraModel::Distortion(params,
x(0) - step0,
x(1), &dx_0b(0),
564 CameraModel::Distortion(params,
x(0) + step0,
x(1), &dx_0f(0),
566 CameraModel::Distortion(params,
x(0),
x(1) - step1, &dx_1b(0),
568 CameraModel::Distortion(params,
x(0),
x(1) + step1, &dx_1f(0),
570 J(0, 0) = 1 + (dx_0f(0) - dx_0b(0)) / (2 * step0);
571 J(0, 1) = (dx_1f(0) - dx_1b(0)) / (2 * step1);
572 J(1, 0) = (dx_0f(1) - dx_0b(1)) / (2 * step0);
573 J(1, 1) = 1 + (dx_1f(1) - dx_1b(1)) / (2 * step1);
574 const Eigen::Vector2d step_x = J.inverse() * (
x + dx - x0);
576 if (step_x.squaredNorm() < kMaxStepNorm) {
605 const double focal_length,
const size_t width,
const size_t height) {
609 template <
typename T>
611 const T* params,
const T u,
const T v, T*
x, T*
y) {
612 const T f = params[0];
613 const T c1 = params[1];
614 const T c2 = params[2];
623 template <
typename T>
625 const T* params,
const T
x,
const T
y, T* u, T* v) {
626 const T f = params[0];
627 const T c1 = params[1];
628 const T c2 = params[2];
638 return "fx, fy, cx, cy";
654 const double focal_length,
const size_t width,
const size_t height) {
655 return {focal_length, focal_length,
width / 2.0,
height / 2.0};
658 template <
typename T>
660 const T* params,
const T u,
const T v, T*
x, T*
y) {
661 const T f1 = params[0];
662 const T f2 = params[1];
663 const T c1 = params[2];
664 const T c2 = params[3];
673 template <
typename T>
675 const T* params,
const T
x,
const T
y, T* u, T* v) {
676 const T f1 = params[0];
677 const T f2 = params[1];
678 const T c1 = params[2];
679 const T c2 = params[3];
689 return "f, cx, cy, k";
705 const double focal_length,
const size_t width,
const size_t height) {
706 return {focal_length,
width / 2.0,
height / 2.0, 0};
709 template <
typename T>
711 const T* params,
const T u,
const T v, T*
x, T*
y) {
712 const T f = params[0];
713 const T c1 = params[1];
714 const T c2 = params[2];
727 template <
typename T>
729 const T* params,
const T
x,
const T
y, T* u, T* v) {
730 const T f = params[0];
731 const T c1 = params[1];
732 const T c2 = params[2];
741 template <
typename T>
743 const T* extra_params,
const T u,
const T v, T* du, T* dv) {
744 const T k = extra_params[0];
748 const T r2 = u2 + v2;
749 const T radial = k * r2;
758 return "f, cx, cy, k1, k2";
774 const double focal_length,
const size_t width,
const size_t height) {
775 return {focal_length,
width / 2.0,
height / 2.0, 0, 0};
778 template <
typename T>
780 const T* params,
const T u,
const T v, T*
x, T*
y) {
781 const T f = params[0];
782 const T c1 = params[1];
783 const T c2 = params[2];
796 template <
typename T>
798 const T* params,
const T
x,
const T
y, T* u, T* v) {
799 const T f = params[0];
800 const T c1 = params[1];
801 const T c2 = params[2];
810 template <
typename T>
812 const T* extra_params,
const T u,
const T v, T* du, T* dv) {
813 const T k1 = extra_params[0];
814 const T k2 = extra_params[1];
818 const T r2 = u2 + v2;
819 const T radial = k1 * r2 + k2 * r2 * r2;
828 return "fx, fy, cx, cy, k1, k2, p1, p2";
844 const double focal_length,
const size_t width,
const size_t height) {
845 return {focal_length, focal_length,
width / 2.0,
height / 2.0, 0, 0, 0, 0};
848 template <
typename T>
850 const T* params,
const T u,
const T v, T*
x, T*
y) {
851 const T f1 = params[0];
852 const T f2 = params[1];
853 const T c1 = params[2];
854 const T c2 = params[3];
867 template <
typename T>
869 const T* params,
const T
x,
const T
y, T* u, T* v) {
870 const T f1 = params[0];
871 const T f2 = params[1];
872 const T c1 = params[2];
873 const T c2 = params[3];
882 template <
typename T>
884 const T* extra_params,
const T u,
const T v, T* du, T* dv) {
885 const T k1 = extra_params[0];
886 const T k2 = extra_params[1];
887 const T p1 = extra_params[2];
888 const T p2 = extra_params[3];
893 const T r2 = u2 + v2;
894 const T radial = k1 * r2 + k2 * r2 * r2;
895 *du = u * radial + T(2) * p1 *
uv + p2 * (r2 + T(2) * u2);
896 *dv = v * radial + T(2) * p2 *
uv + p1 * (r2 + T(2) * v2);
903 return "fx, fy, cx, cy, k1, k2, k3, k4";
919 const double focal_length,
const size_t width,
const size_t height) {
920 return {focal_length, focal_length,
width / 2.0,
height / 2.0, 0, 0, 0, 0};
923 template <
typename T>
925 const T* params,
const T u,
const T v, T*
x, T*
y) {
926 const T f1 = params[0];
927 const T f2 = params[1];
928 const T c1 = params[2];
929 const T c2 = params[3];
942 template <
typename T>
944 const T* params,
const T
x,
const T
y, T* u, T* v) {
945 const T f1 = params[0];
946 const T f2 = params[1];
947 const T c1 = params[2];
948 const T c2 = params[3];
957 template <
typename T>
959 const T* extra_params,
const T u,
const T v, T* du, T* dv) {
960 const T k1 = extra_params[0];
961 const T k2 = extra_params[1];
962 const T k3 = extra_params[2];
963 const T k4 = extra_params[3];
965 const T r = ceres::sqrt(u * u + v * v);
967 if (r > T(std::numeric_limits<double>::epsilon())) {
968 const T theta = ceres::atan(r);
969 const T theta2 = theta * theta;
970 const T theta4 = theta2 * theta2;
971 const T theta6 = theta4 * theta2;
972 const T theta8 = theta4 * theta4;
973 const T thetad = theta * (T(1) + k1 * theta2 + k2 * theta4 +
974 k3 * theta6 + k4 * theta8);
975 *du = u * thetad / r - u;
976 *dv = v * thetad / r - v;
987 return "fx, fy, cx, cy, k1, k2, p1, p2, k3, k4, k5, k6";
999 return {4, 5, 6, 7, 8, 9, 10, 11};
1003 const double focal_length,
const size_t width,
const size_t height) {
1004 return {focal_length,
1018 template <
typename T>
1020 const T* params,
const T u,
const T v, T*
x, T*
y) {
1021 const T f1 = params[0];
1022 const T f2 = params[1];
1023 const T c1 = params[2];
1024 const T c2 = params[3];
1037 template <
typename T>
1039 const T* params,
const T
x,
const T
y, T* u, T* v) {
1040 const T f1 = params[0];
1041 const T f2 = params[1];
1042 const T c1 = params[2];
1043 const T c2 = params[3];
1052 template <
typename T>
1054 const T* extra_params,
const T u,
const T v, T* du, T* dv) {
1055 const T k1 = extra_params[0];
1056 const T k2 = extra_params[1];
1057 const T p1 = extra_params[2];
1058 const T p2 = extra_params[3];
1059 const T k3 = extra_params[4];
1060 const T k4 = extra_params[5];
1061 const T k5 = extra_params[6];
1062 const T k6 = extra_params[7];
1067 const T r2 = u2 + v2;
1068 const T r4 = r2 * r2;
1069 const T r6 = r4 * r2;
1070 const T radial = (T(1) + k1 * r2 + k2 * r4 + k3 * r6) /
1071 (T(1) + k4 * r2 + k5 * r4 + k6 * r6);
1072 *du = u * radial + T(2) * p1 *
uv + p2 * (r2 + T(2) * u2) - u;
1073 *dv = v * radial + T(2) * p2 *
uv + p1 * (r2 + T(2) * v2) - v;
1080 return "fx, fy, cx, cy, omega";
1096 return {focal_length, focal_length,
width / 2.0,
height / 2.0, 1
e-2};
1099 template <
typename T>
1101 const T* params,
const T u,
const T v, T*
x, T*
y) {
1102 const T f1 = params[0];
1103 const T f2 = params[1];
1104 const T c1 = params[2];
1105 const T c2 = params[3];
1115 template <
typename T>
1117 const T* params,
const T
x,
const T
y, T* u, T* v) {
1118 const T f1 = params[0];
1119 const T f2 = params[1];
1120 const T c1 = params[2];
1121 const T c2 = params[3];
1124 const T uu = (
x - c1) / f1;
1125 const T vv = (
y - c2) / f2;
1131 template <
typename T>
1133 const T* extra_params,
const T u,
const T v, T* du, T* dv) {
1134 const T omega = extra_params[0];
1137 const T kEpsilon = T(1
e-4);
1139 const T radius2 = u * u + v * v;
1140 const T omega2 = omega * omega;
1143 if (omega2 < kEpsilon) {
1149 factor = (omega2 * radius2) / T(3) - omega2 / T(12) + T(1);
1150 }
else if (radius2 < kEpsilon) {
1156 const T tan_half_omega = ceres::tan(omega / T(2));
1157 factor = (T(-2) * tan_half_omega *
1158 (T(4) * radius2 * tan_half_omega * tan_half_omega - T(3))) /
1161 const T radius = ceres::sqrt(radius2);
1163 ceres::atan(radius * T(2) * ceres::tan(omega / T(2)));
1164 factor = numerator / (radius * omega);
1171 template <
typename T>
1173 const T* extra_params,
const T u,
const T v, T* du, T* dv) {
1174 T omega = extra_params[0];
1177 const T kEpsilon = T(1
e-4);
1179 const T radius2 = u * u + v * v;
1180 const T omega2 = omega * omega;
1183 if (omega2 < kEpsilon) {
1189 factor = (omega2 * radius2) / T(3) - omega2 / T(12) + T(1);
1190 }
else if (radius2 < kEpsilon) {
1196 factor = (omega * (omega * omega * radius2 + T(3))) /
1197 (T(6) * ceres::tan(omega / T(2)));
1199 const T radius = ceres::sqrt(radius2);
1200 const T numerator = ceres::tan(radius * omega);
1201 factor = numerator / (radius * T(2) * ceres::tan(omega / T(2)));
1212 return "f, cx, cy, k";
1231 const double focal_length,
const size_t width,
const size_t height) {
1232 return {focal_length,
width / 2.0,
height / 2.0, 0};
1235 template <
typename T>
1237 const T* params,
const T u,
const T v, T*
x, T*
y) {
1238 const T f = params[0];
1239 const T c1 = params[1];
1240 const T c2 = params[2];
1253 template <
typename T>
1255 const T* params,
const T
x,
const T
y, T* u, T* v) {
1256 const T f = params[0];
1257 const T c1 = params[1];
1258 const T c2 = params[2];
1267 template <
typename T>
1269 const T* extra_params,
const T u,
const T v, T* du, T* dv) {
1270 const T k = extra_params[0];
1272 const T r = ceres::sqrt(u * u + v * v);
1274 if (r > T(std::numeric_limits<double>::epsilon())) {
1275 const T theta = ceres::atan(r);
1276 const T theta2 = theta * theta;
1277 const T thetad = theta * (T(1) + k * theta2);
1278 *du = u * thetad / r - u;
1279 *dv = v * thetad / r - v;
1290 return "f, cx, cy, k1, k2";
1306 const double focal_length,
const size_t width,
const size_t height) {
1307 return {focal_length,
width / 2.0,
height / 2.0, 0, 0};
1310 template <
typename T>
1312 const T* params,
const T u,
const T v, T*
x, T*
y) {
1313 const T f = params[0];
1314 const T c1 = params[1];
1315 const T c2 = params[2];
1328 template <
typename T>
1330 const T* params,
const T
x,
const T
y, T* u, T* v) {
1331 const T f = params[0];
1332 const T c1 = params[1];
1333 const T c2 = params[2];
1342 template <
typename T>
1344 const T* extra_params,
const T u,
const T v, T* du, T* dv) {
1345 const T k1 = extra_params[0];
1346 const T k2 = extra_params[1];
1348 const T r = ceres::sqrt(u * u + v * v);
1350 if (r > T(std::numeric_limits<double>::epsilon())) {
1351 const T theta = ceres::atan(r);
1352 const T theta2 = theta * theta;
1353 const T theta4 = theta2 * theta2;
1354 const T thetad = theta * (T(1) + k1 * theta2 + k2 * theta4);
1355 *du = u * thetad / r - u;
1356 *dv = v * thetad / r - v;
1367 return "fx, fy, cx, cy, k1, k2, p1, p2, k3, k4, sx1, sy1";
1380 return {4, 5, 6, 7, 8, 9, 10, 11};
1384 const double focal_length,
const size_t width,
const size_t height) {
1385 return {focal_length,
1399 template <
typename T>
1401 const T* params,
const T u,
const T v, T*
x, T*
y) {
1402 const T f1 = params[0];
1403 const T f2 = params[1];
1404 const T c1 = params[2];
1405 const T c2 = params[3];
1407 const T r = ceres::sqrt(u * u + v * v);
1410 if (r > T(std::numeric_limits<double>::epsilon())) {
1411 const T theta = ceres::atan(r);
1430 template <
typename T>
1432 const T* params,
const T
x,
const T
y, T* u, T* v) {
1433 const T f1 = params[0];
1434 const T f2 = params[1];
1435 const T c1 = params[2];
1436 const T c2 = params[3];
1444 const T theta = ceres::sqrt(*u * *u + *v * *v);
1445 const T theta_cos_theta = theta * ceres::cos(theta);
1446 if (theta_cos_theta > T(std::numeric_limits<double>::epsilon())) {
1447 const T scale = ceres::sin(theta) / theta_cos_theta;
1453 template <
typename T>
1455 const T* extra_params,
const T u,
const T v, T* du, T* dv) {
1456 const T k1 = extra_params[0];
1457 const T k2 = extra_params[1];
1458 const T p1 = extra_params[2];
1459 const T p2 = extra_params[3];
1460 const T k3 = extra_params[4];
1461 const T k4 = extra_params[5];
1462 const T sx1 = extra_params[6];
1463 const T sy1 = extra_params[7];
1468 const T r2 = u2 + v2;
1469 const T r4 = r2 * r2;
1470 const T r6 = r4 * r2;
1471 const T r8 = r6 * r2;
1472 const T radial = k1 * r2 + k2 * r4 + k3 * r6 + k4 * r8;
1473 *du = u * radial + T(2) * p1 *
uv + p2 * (r2 + T(2) * u2) + sx1 * r2;
1474 *dv = v * radial + T(2) * p2 *
uv + p1 * (r2 + T(2) * v2) + sy1 * r2;
1480 const std::vector<double>& params,
1486 #define CAMERA_MODEL_CASE(CameraModel) \
1487 case CameraModel::kModelId: \
1488 CameraModel::WorldToImage(params.data(), u, v, x, y); \
1493 #undef CAMERA_MODEL_CASE
1498 const std::vector<double>& params,
1504 #define CAMERA_MODEL_CASE(CameraModel) \
1505 case CameraModel::kModelId: \
1506 CameraModel::ImageToWorld(params.data(), x, y, u, v); \
1511 #undef CAMERA_MODEL_CASE
1516 const std::vector<double>& params,
1517 const double threshold) {
1519 #define CAMERA_MODEL_CASE(CameraModel) \
1520 case CameraModel::kModelId: \
1521 return CameraModel::ImageToWorldThreshold(params.data(), threshold); \
1526 #undef CAMERA_MODEL_CASE
#define CAMERA_MODEL_DEFINITIONS(model_id_value, model_name_value, num_params_value)
#define CAMERA_MODEL_SWITCH_CASES
void CameraModelImageToWorld(const int model_id, const std::vector< double > ¶ms, const double x, const double y, double *u, double *v)
const std::vector< size_t > & CameraModelFocalLengthIdxs(const int model_id)
static const int kInvalidCameraModelId
bool ExistsCameraModelWithId(const int model_id)
bool ExistsCameraModelWithName(const std::string &model_name)
bool CameraModelHasBogusParams(const int model_id, const std::vector< double > ¶ms, const size_t width, const size_t height, const double min_focal_length_ratio, const double max_focal_length_ratio, const double max_extra_param)
size_t CameraModelNumParams(const int model_id)
bool CameraModelVerifyParams(const int model_id, const std::vector< double > ¶ms)
const std::vector< size_t > & CameraModelExtraParamsIdxs(const int model_id)
std::string CameraModelIdToName(const int model_id)
const std::vector< size_t > & CameraModelPrincipalPointIdxs(const int model_id)
double CameraModelImageToWorldThreshold(const int model_id, const std::vector< double > ¶ms, const double threshold)
std::string CameraModelParamsInfo(const int model_id)
void CameraModelWorldToImage(const int model_id, const std::vector< double > ¶ms, const double u, const double v, double *x, double *y)
std::vector< double > CameraModelInitializeParams(const int model_id, const double focal_length, const size_t width, const size_t height)
int CameraModelNameToId(const std::string &model_name)
static bool HasBogusPrincipalPoint(const std::vector< T > ¶ms, const size_t width, const size_t height)
static bool HasBogusFocalLength(const std::vector< T > ¶ms, const size_t width, const size_t height, const T min_focal_length_ratio, const T max_focal_length_ratio)
static bool HasBogusExtraParams(const std::vector< T > ¶ms, const T max_extra_param)
static bool HasBogusParams(const std::vector< T > ¶ms, const size_t width, const size_t height, const T min_focal_length_ratio, const T max_focal_length_ratio, const T max_extra_param)
static T ImageToWorldThreshold(const T *params, const T threshold)
static void IterativeUndistortion(const T *params, T *u, T *v)
static std::vector< size_t > InitializeExtraParamsIdxs()
static const std::string model_name
static const int model_id
static void Undistortion(const T *extra_params, const T u, const T v, T *du, T *dv)
static std::vector< size_t > InitializeFocalLengthIdxs()
static std::string InitializeParamsInfo()
static void WorldToImage(const T *params, const T u, const T v, T *x, T *y)
static void ImageToWorld(const T *params, const T x, const T y, T *u, T *v)
static std::vector< double > InitializeParams(const double focal_length, const size_t width, const size_t height)
static std::vector< size_t > InitializePrincipalPointIdxs()
static void Distortion(const T *extra_params, const T u, const T v, T *du, T *dv)
static std::vector< size_t > InitializePrincipalPointIdxs()
static void Distortion(const T *extra_params, const T u, const T v, T *du, T *dv)
static std::vector< size_t > InitializeExtraParamsIdxs()
static std::vector< size_t > InitializeFocalLengthIdxs()
static void ImageToWorld(const T *params, const T x, const T y, T *u, T *v)
static std::string InitializeParamsInfo()
static void WorldToImage(const T *params, const T u, const T v, T *x, T *y)
static std::vector< double > InitializeParams(const double focal_length, const size_t width, const size_t height)
static std::vector< size_t > InitializeFocalLengthIdxs()
static void ImageToWorld(const T *params, const T x, const T y, T *u, T *v)
static std::vector< size_t > InitializePrincipalPointIdxs()
static void Distortion(const T *extra_params, const T u, const T v, T *du, T *dv)
static std::vector< double > InitializeParams(const double focal_length, const size_t width, const size_t height)
static void WorldToImage(const T *params, const T u, const T v, T *x, T *y)
static std::string InitializeParamsInfo()
static std::vector< size_t > InitializeExtraParamsIdxs()
static std::vector< double > InitializeParams(const double focal_length, const size_t width, const size_t height)
static void WorldToImage(const T *params, const T u, const T v, T *x, T *y)
static void Distortion(const T *extra_params, const T u, const T v, T *du, T *dv)
static std::vector< size_t > InitializeFocalLengthIdxs()
static void ImageToWorld(const T *params, const T x, const T y, T *u, T *v)
static std::vector< size_t > InitializeExtraParamsIdxs()
static std::string InitializeParamsInfo()
static std::vector< size_t > InitializePrincipalPointIdxs()
static std::string InitializeParamsInfo()
static std::vector< size_t > InitializeFocalLengthIdxs()
static void ImageToWorld(const T *params, const T x, const T y, T *u, T *v)
static std::vector< size_t > InitializeExtraParamsIdxs()
static std::vector< double > InitializeParams(const double focal_length, const size_t width, const size_t height)
static void WorldToImage(const T *params, const T u, const T v, T *x, T *y)
static std::vector< size_t > InitializePrincipalPointIdxs()
static std::vector< double > InitializeParams(const double focal_length, const size_t width, const size_t height)
static void Distortion(const T *extra_params, const T u, const T v, T *du, T *dv)
static void WorldToImage(const T *params, const T u, const T v, T *x, T *y)
static std::vector< size_t > InitializeExtraParamsIdxs()
static std::string InitializeParamsInfo()
static void ImageToWorld(const T *params, const T x, const T y, T *u, T *v)
static std::vector< size_t > InitializePrincipalPointIdxs()
static std::vector< size_t > InitializeFocalLengthIdxs()
static std::vector< double > InitializeParams(const double focal_length, const size_t width, const size_t height)
static void Distortion(const T *extra_params, const T u, const T v, T *du, T *dv)
static void WorldToImage(const T *params, const T u, const T v, T *x, T *y)
static std::vector< size_t > InitializePrincipalPointIdxs()
static std::vector< size_t > InitializeExtraParamsIdxs()
static std::vector< size_t > InitializeFocalLengthIdxs()
static void ImageToWorld(const T *params, const T x, const T y, T *u, T *v)
static std::string InitializeParamsInfo()
static std::vector< size_t > InitializeExtraParamsIdxs()
static void WorldToImage(const T *params, const T u, const T v, T *x, T *y)
static std::vector< double > InitializeParams(const double focal_length, const size_t width, const size_t height)
static std::vector< size_t > InitializePrincipalPointIdxs()
static std::vector< size_t > InitializeFocalLengthIdxs()
static void ImageToWorld(const T *params, const T x, const T y, T *u, T *v)
static std::string InitializeParamsInfo()
static std::vector< size_t > InitializePrincipalPointIdxs()
static std::string InitializeParamsInfo()
static std::vector< size_t > InitializeExtraParamsIdxs()
static std::vector< double > InitializeParams(const double focal_length, const size_t width, const size_t height)
static std::vector< size_t > InitializeFocalLengthIdxs()
static void Distortion(const T *extra_params, const T u, const T v, T *du, T *dv)
static void WorldToImage(const T *params, const T u, const T v, T *x, T *y)
static void ImageToWorld(const T *params, const T x, const T y, T *u, T *v)
static void ImageToWorld(const T *params, const T x, const T y, T *u, T *v)
static void WorldToImage(const T *params, const T u, const T v, T *x, T *y)
static std::vector< size_t > InitializeFocalLengthIdxs()
static std::vector< size_t > InitializeExtraParamsIdxs()
static std::string InitializeParamsInfo()
static void Distortion(const T *extra_params, const T u, const T v, T *du, T *dv)
static std::vector< size_t > InitializePrincipalPointIdxs()
static std::vector< double > InitializeParams(const double focal_length, const size_t width, const size_t height)
static std::vector< size_t > InitializeFocalLengthIdxs()
static void ImageToWorld(const T *params, const T x, const T y, T *u, T *v)
static void WorldToImage(const T *params, const T u, const T v, T *x, T *y)
static void Distortion(const T *extra_params, const T u, const T v, T *du, T *dv)
static std::vector< double > InitializeParams(const double focal_length, const size_t width, const size_t height)
static std::vector< size_t > InitializeExtraParamsIdxs()
static std::vector< size_t > InitializePrincipalPointIdxs()
static std::string InitializeParamsInfo()