11 #include <Eigen/Dense>
20 "Pinhole:fx,fy,cx,cy";
22 template <
class TScalar>
24 template <
class TScalar>
26 template <
class TScalar>
27 using Params = Eigen::Matrix<TScalar, kNumParams, 1>;
28 template <
class TScalar>
31 template <
class TParamsTypeT,
class TPo
intTypeT>
33 Eigen::MatrixBase<TParamsTypeT>
const& params,
34 Eigen::MatrixBase<TPointTypeT>
const& proj_point_in_camera_z1_plane)
37 TParamsTypeT::ColsAtCompileTime == 1,
"params must be a column-vector");
40 "params must have exactly kNumParams rows");
42 TPointTypeT::ColsAtCompileTime == 1,
43 "point_camera must be a column-vector");
45 TPointTypeT::RowsAtCompileTime == 2,
46 "point_camera must have exactly 2 columns");
49 proj_point_in_camera_z1_plane[0] * params[0] + params[2],
50 proj_point_in_camera_z1_plane[1] * params[1] + params[3]);
53 template <
class TScalar>
57 TScalar proj_x_in_camera_z1_plane =
58 (pixel_image.x() - TScalar(params[2])) / TScalar(params[0]);
59 TScalar proj_y_in_camera_z1_plane =
60 (pixel_image.y() - TScalar(params[3])) / TScalar(params[1]);
62 proj_x_in_camera_z1_plane, proj_y_in_camera_z1_plane);
65 template <
class TParamsTypeT,
class TPo
intTypeT>
67 Eigen::MatrixBase<TParamsTypeT>
const& params,
68 Eigen::MatrixBase<TPointTypeT>
const& )
69 -> Eigen::Matrix<typename TPointTypeT::Scalar, 2, 2> {
71 TParamsTypeT::ColsAtCompileTime == 1,
"params must be a column-vector");
74 "params must have exactly kNumParams rows");
76 TPointTypeT::ColsAtCompileTime == 1,
77 "point_camera must be a column-vector");
79 TPointTypeT::RowsAtCompileTime == 2,
80 "point_camera must have exactly 2 columns");
82 Eigen::Matrix<typename TPointTypeT::Scalar, 2, 2> dx;