18 #ifndef PIC_COMPUTER_VISION_INTRISICS_MATRIX_HPP 19 #define PIC_COMPUTER_VISION_INTRISICS_MATRIX_HPP 25 #include "../base.hpp" 27 #include "../util/math.hpp" 29 #ifndef PIC_DISABLE_EIGEN 31 #ifndef PIC_EIGEN_NOT_BUNDLED 32 #include "../externals/Eigen/Dense" 33 #include "../externals/Eigen/Geometry" 35 #include <Eigen/Dense> 36 #include <Eigen/Geometry> 50 return 1.0 / tan(fovy / 2.0);
62 double d = sqrt(x * x + y * y);
63 return 2.0 * atan(d / (2.0 * f));
75 return (focal_length_mm * sensor_size_px) / sensor_size_mm;
78 #ifndef PIC_DISABLE_EIGEN 93 K(0, 0) = focal_length * m_x;
94 K(1, 1) = focal_length * m_y;
97 K(0, 2) = opitical_center_x;
98 K(1, 2) = opitical_center_y;
114 K(0, 0) = focal_length_x;
115 K(1, 1) = focal_length_y;
118 K(0, 2) = opitical_center_x;
119 K(1, 2) = opitical_center_y;
134 double r_2 = p[0] * p[0] + p[1] * p[1];
135 double r_4 = r_2 * r_2;
137 double c = 1.0 + k[0] * r_2 + k[1] * r_4 + k[4] * r_4 *r_2;
140 dx[0] = 2 * k[2] * p[0] * p[1] + k[3] * (r_2 + 2.0 * p[0] * p[0]);
141 dx[1] = k[2] * (r_2 + 2 * p[1] * p[1]) + 2.0 * k[3] * p[0] * p[1];
148 #endif // PIC_DISABLE_EIGEN 152 #endif // PIC_COMPUTER_VISION_INTRISICS_MATRIX_HPP PIC_INLINE double getFocalLengthFromFOVAngle(double fovy)
getFocalLengthFromFOVAngle
Definition: intrisics_matrix.hpp:48
PIC_INLINE Eigen::Vector2d removeLensDistortion(Eigen::Vector2d &p, double k[5])
removeLensDistortion
Definition: intrisics_matrix.hpp:130
PIC_INLINE double getFOVAngleFromFocalSensor(double f, double x, double y)
getFOVAngleFromFocalSensor
Definition: intrisics_matrix.hpp:60
#define PIC_INLINE
Definition: base.hpp:33
PIC_INLINE double getFocalLengthPixels(double focal_length_mm, double sensor_size_mm, double sensor_size_px)
getFocalLengthPixels
Definition: intrisics_matrix.hpp:73
Definition: bilateral_separation.hpp:25
PIC_INLINE Eigen::Matrix3d getIntrinsicsMatrix(double focal_length, double m_x, double m_y, double opitical_center_x, double opitical_center_y)
getIntrinsicsMatrix
Definition: intrisics_matrix.hpp:89