10#ifndef SFM_POSE_HEADER
11#define SFM_POSE_HEADER
45 void init_canonical_form (
void);
49 void set_k_matrix (
double flen,
double px,
double py);
51 double get_focal_length (
void)
const;
55 bool is_valid (
void)
const;
66CameraPose::CameraPose (
void)
92 this->
K[0] = flen; this->
K[2] = px;
93 this->
K[4] = flen; this->
K[5] = py;
100 return (this->
K[0] + this->
K[4]) / 2.0;
112 return this->
K[0] != 0.0;
Matrix class for arbitrary dimensions and types.
Matrix< T, N, M+O > hstack(Matrix< T, N, O > const &other) const
Stacks this (left) and another matrix (right) horizontally.
Matrix< T, M, N > transposed(void) const
Returns a transposed copy of self by treating rows as columns.
Matrix< T, N, M > & fill(T const &value)
Fills all vector elements with the given value.
Vector class for arbitrary dimensions and types.
Vector< T, N > & fill(T const &value)
Fills all vector elements with the given value.
Matrix< T, N, N > & matrix_set_identity(Matrix< T, N, N > *mat)
Sets the given square matrix to the identity matrix.
#define SFM_NAMESPACE_END
#define SFM_NAMESPACE_BEGIN
The camera pose is the 3x4 matrix P = K [R | t].
math::Matrix< double, 3, 3 > R
bool is_valid(void) const
Returns true if K matrix is valid (non-zero focal length).
void fill_p_matrix(math::Matrix< double, 3, 4 > *result) const
Returns the P matrix as the product K [R | t].
void set_k_matrix(double flen, double px, double py)
Initializes the K matrix from focal length and principal point.
double get_focal_length(void) const
Returns the focal length as average of x and y focal length.
void fill_camera_pos(math::Vector< double, 3 > *camera_pos) const
Returns the camera position (requires valid camera).
void init_canonical_form(void)
Initializes R with identity and t with zeros.
math::Matrix< double, 3, 3 > K
math::Vector< double, 3 > t