Camera is the one of the means for machines to perceive the world. The most widely used camera model is the pinhole camera model.

Camera

class Camera

This is the base class of all camera classes.

Pinhole camera

class PinholeCamera

The Camera class contains intrinsic and extrinsic parameters of the camera. The information are stored in both matrix and vector form, and are automatically updated once the other is changed.

  • R_ is the rotation matrix;
  • t_ is the translation matrix;
  • std::vector<float> intrinsics_ is a 4-element vector storing intrinsic parameters, which includes , , , ;
  • std::vector<float> extrinsics_ is a 6-element vector storing extrinsic parameters, which include , , , , , . The first three is the axis-angle representation of rotation matrix, the latter three are coefficients of the translation vector.

The position and orientation of the camera are also stored in the Camera class.

  • center_ represents the center of projection;
  • xaxis_, yaxis_, zaxis_ store the axes of camera coordinate system;
  • oaxis_ stores principle axis.
void update_projection()

update the projection matrix from intrinsic and extrinsic matrices K_, R_, t_.

void update_projection()

update the camera parameter vectors from matrices.

void update_matrices(const is is_proj_mat)

update camera parameter matrices from either projection matrix or camera parameter vectors.

const Mat3f& projection() const;
Mat34f& projection();

return references to the projection matrix.

const Vec3f& direction() const;
Vec3f& direction();

return references to the principal axis.

const Vec3f& center() const;
Vec3f& center();

return references to the center of projection.