Projection

projection.h

This file implements methods that are related to the usage of camera projection matrix. Since these are widely used methods, it wouldn’t make sense to make them member methods of the Camera class.

void P_from_KRt(const Mat3f& K, const Mat3f& R, const Vec3f& t, Mat34f& P);

method that construct projection matrix from camera intrinsic matrix and extrinsic matrix .

void KRt_from_P(const Mat34f& P, Mat3f& K, Mat3f& R, Vec3f& t);

method that decomposes a projection matrix to obtain the camera intrinsic matrix and extrinsic matrix .

void project(const Mat34f& P, const Vec4f& X, Vec3f& x);
void project(const Mat34f& P, const Vec4f& X, Vec2f& x);
void project(const Mat34f& P, const Vec3f& X, Vec3f& x);
void project(const Mat34f& P, const Vec3f& X, Vec2f& x);

methods that compute the 2D image projection from a 3D point using projection matrix .

bool is_in_front_of_camera(const Mat34f& P, const Vec4f& X);
bool is_in_front_of_camera(const Mat34f& P, const Vec3f& X);

methods that determine if a point is in front of camera based on projection matrix .

Transform

transform.h

This file implements methods that creation and operation of various transformation matrices.

Mat34f concat_Rt(const Mat34f& outer_Rt, const Mat34f& inner_Rt);

method to concatenate two matrices. The underlying formula is: .

Mat34f inv_Rt(const Mat34f& r_Rt);

method to compute the inverse of a matrix , i.e., . The formula is as follows:

Mat3f rotation_around_x(float angle);
Mat3f rotation_around_y(float angle);
Mat3f rotation_around_z(float angle);

methods to compute the rotation matrix around , , or axis by angle degrees.

template<typename T>
T degree2radian(T degree);

template<typename T>
T radian2degree(T radian);

methods to convert angle from degree to radian or the other way around.

Rodrigues

rodrigues.h

This file implements the rodrigues formular that converts an axis-angle representation to a rotation matrix, as well as the inverse process.

template<typename T>
void rodrigues(T* R, T* dR, const T* om);

void rodrigues(Mat3f& r_R, Matf* r_dR, const Vec3f& r_om);

methods that convert from an axis-angle representation to a rotation matrix.

template<typename T>
void irodrigues(T* om, T* dR, const T* R);

void irodrigues(Vec3f& r_om, Matf* r_dom, const Mat3f& r_R);

methods that convert from a rotation matrix to an axis-angle representation.

Quaternion

quaternion.h

This file implements the quaternion form of the rotation matrix.

to be done