mf
Media Framework
|
Camera which defines mapping from 3D spatial coordinates to 2D image coordinates. More...
#include <camera.h>
Public Types | |
using | image_coordinates_type = Eigen_vec2 |
2D image coordinates, range and scale defined by subclass. More... | |
Public Member Functions | |
camera (const camera &)=default | |
camera & | operator= (const camera &)=default |
virtual | ~camera ()=default |
Eigen_affine3 | view_transformation () const |
Extrinsic parameters of camera. More... | |
Eigen_vec3 | center_ray_direction () const |
Direction vector of ray -Z pointing straight out camera. More... | |
Eigen_vec3 | ray_direction (const spherical_coordinates &sp) const |
Direction vector of ray pointing to point with spherical coordinates sp. More... | |
Eigen_vec3 | ray_direction (const Eigen_vec3 &p) const |
Direction vector of ray pointing to point p. More... | |
float | distance_sq (const Eigen_vec3 &p) const |
Squared distance of 3D point p to camera center. More... | |
float | distance (const Eigen_vec3 &p) const |
Distance of 3D point p to camera center. More... | |
spherical_coordinates | to_spherical (const Eigen_vec3 &p) const |
Convert 3D point cartesian coordinates p to spherical. More... | |
Eigen_vec3 | point (const spherical_coordinates &sp) const |
Convert 3D point spherical coordinates sp to cartesian. More... | |
virtual image_coordinates_type | project (const Eigen_vec3 &p) const =0 |
Project point p to image coordinates. More... | |
virtual image_coordinates_type | project (const spherical_coordinates &sp) const |
Project point with spherical coordinates sp to image coordinates. More... | |
virtual Eigen_vec3 | ray_direction (const image_coordinates_type &c) const =0 |
Direction vector of ray pointing to point corresponding to image coordinates c. More... | |
Public Member Functions inherited from mf::space_object | |
space_object (const pose &=pose()) | |
space_object (const pose &, space_object &par) | |
space_object (const space_object &) | |
space_object & | operator= (const space_object &) |
virtual | ~space_object () |
bool | has_parent_space_object () const |
const space_object & | parent_space_object () const |
space_object & | parent_space_object () |
const pose & | relative_pose () const |
pose | absolute_pose () const |
void | set_relative_pose (const pose &) |
void | set_no_relative_pose () |
Eigen_affine3 | transformation_from (const space_object &) const |
Eigen_affine3 | transformation_to (const space_object &) const |
void | set_parent (space_object &, const pose &new_relative_pose=pose()) |
void | set_no_parent (const pose &new_pose=pose()) |
void | make_sibling (const space_object &, const pose &new_pose=pose()) |
template<typename Transformation > | |
void | transform (const Transformation &t) |
template<typename Transformation > | |
void | transform (const Transformation &rt, const space_object &relative_to) |
void | move (const Eigen_vec3 &t) |
void | move (float x, float y, float z) |
void | move_x (float x) |
void | move_y (float y) |
void | move_z (float z) |
void | rotate_x_axis (angle a, const Eigen_vec3 &c=Eigen_vec3::Zero()) |
void | rotate_y_axis (angle a, const Eigen_vec3 &c=Eigen_vec3::Zero()) |
void | rotate_z_axis (angle a, const Eigen_vec3 &c=Eigen_vec3::Zero()) |
void | look_at (const space_object &) |
virtual bounding_box | box () const |
Protected Member Functions | |
camera ()=default | |
camera (const pose &) | |
Protected Member Functions inherited from mf::space_object | |
virtual void | do_update_pose () |
Camera which defines mapping from 3D spatial coordinates to 2D image coordinates.
Inherited space object pose defines extrinsic camera parameters. Camera points in -Z or +Z direction in its coordinate system. 3D points taken as function arguments are always in coordinate system of parent space object.
2D image coordinates, range and scale defined by subclass.
|
protecteddefault |
|
explicitprotected |
|
default |
|
virtualdefault |
|
inline |
Direction vector of ray -Z pointing straight out camera.
Relative to parent space object coordinate system.
float mf::camera::distance | ( | const Eigen_vec3 & | p | ) | const |
Distance of 3D point p to camera center.
float mf::camera::distance_sq | ( | const Eigen_vec3 & | p | ) | const |
Squared distance of 3D point p to camera center.
Eigen_vec3 mf::camera::point | ( | const spherical_coordinates & | sp | ) | const |
Convert 3D point spherical coordinates sp to cartesian.
|
pure virtual |
Project point p to image coordinates.
Implemented by subclass.
Implemented in mf::projection_camera.
|
inlinevirtual |
Project point with spherical coordinates sp to image coordinates.
Subclass may implemented more efficient version.
|
inline |
Direction vector of ray pointing to point with spherical coordinates sp.
Eigen_vec3 mf::camera::ray_direction | ( | const Eigen_vec3 & | p | ) | const |
Direction vector of ray pointing to point p.
|
pure virtual |
Direction vector of ray pointing to point corresponding to image coordinates c.
Implemented by subclass.
Implemented in mf::projection_camera.
spherical_coordinates mf::camera::to_spherical | ( | const Eigen_vec3 & | p | ) | const |
Convert 3D point cartesian coordinates p to spherical.
Eigen_affine3 mf::camera::view_transformation | ( | ) | const |
Extrinsic parameters of camera.
Transformation from parent space object coordinate system to coordinate system of the camera.