1 #ifndef MF_PROJECTION_CAMERA_H_
2 #define MF_PROJECTION_CAMERA_H_
5 #include "../geometry/projection_view_frustum.h"
6 #include "../ndarray/ndcoord.h"
21 using intrinsic_matrix_result = std::pair<projection_view_frustum, Eigen_projective3>;
28 static intrinsic_matrix_result read_intrinsic_matrix_
47 return (world_to_image_ * p.homogeneous()).eval().hnormalized().head(2);
51 return (world_to_image_ * p.homogeneous()).eval().hnormalized()[2];
57 return (image_to_world_ * p.homogeneous()).eval().hnormalized().normalized();
62 return (image_to_world_ * p.homogeneous()).eval().hnormalized();
Eigen_vec2 offset
After scaling, maps coordinates to [-scale+offset, +scale+offset].
Definition: projection_camera.h:17
Eigen_vec2 image_coordinates_type
2D image coordinates, range and scale defined by subclass.
Definition: camera.h:25
float real
Real number type.
Definition: common.h:48
const projection_view_frustum & relative_frustum() const
Definition: projection_camera.h:43
Parameters of Z to depth projection.
Definition: depth_projection_parameters.h:12
real depth(const Eigen_vec3 &p) const override
Definition: projection_camera.h:50
Eigen_mat< 3, 3 > Eigen_mat3
Definition: eigen.h:29
Eigen_mat< 2, 1 > Eigen_vec2
Definition: eigen.h:24
projection_camera & operator=(const projection_camera &)=default
Camera which maps 3D coordinates of point to depth value in addition to the 2D image coordinates...
Definition: depth_camera.h:9
Position and orientation in space.
Definition: pose.h:15
Eigen_vec3 point(const image_coordinates_type &c, real depth) const override
Definition: projection_camera.h:60
Vector of n-dimensional coordinates.
Definition: ndcoord.h:18
const depth_projection_parameters & depth_parameters() const
Definition: projection_camera.h:44
Eigen_vec3 ray_direction(const image_coordinates_type &c) const override
Direction vector of ray pointing to point corresponding to image coordinates c.
Definition: projection_camera.h:54
Eigen::Transform< Eigen_scalar, 3, Eigen::Projective > Eigen_projective3
Definition: eigen.h:40
const depth_projection_parameters & depth_parameters() const
Definition: view_frustum.h:44
void do_update_pose() override
Definition: projection_camera.cc:47
friend Eigen_projective3 homography_transformation(const projection_camera &from, const projection_camera &to)
Definition: projection_camera.cc:86
View frustum of a perspective camera, without pose.
Definition: projection_view_frustum.h:16
Pin-hole camera with projection to a planar image space.
Definition: projection_camera.h:13
Eigen_vec2 scale
Projected image coordinates in frustum are scaled from [-1, +1] to [-scale, +scale].
Definition: projection_camera.h:16
Eigen_mat< 3, 1 > Eigen_vec3
Definition: eigen.h:25
Definition: projection_camera.h:15
image_coordinates_type project(const Eigen_vec3 &p) const override
Project point p to image coordinates.
Definition: projection_camera.h:46