|
| CameraInfo (void) |
| Creates a new camera and invalidates it (sets 'flen' to 0.0f).
|
|
void | debug_print (void) const |
| Prints debug information to stdout.
|
|
void | fill_calibration (float *mat, float width, float height) const |
| Stores the 3x3 calibration (or projection) matrix (K-matrix in Hartley, Zisserman).
|
|
void | fill_cam_to_world (float *mat) const |
| Stores camera to world 4x4 matrix in array pointed to by mat.
|
|
void | fill_cam_to_world_rot (float *mat) const |
| Stores the camera to world 3x3 rotation matrix in mat.
|
|
void | fill_camera_pos (float *pos) const |
| Stores camera position 3-vector into array pointed to by pos.
|
|
void | fill_camera_translation (float *trans) const |
| Stores the camera translation 3-vector into array pointed to by pos.
|
|
void | fill_gl_projection (float *mat, float width, float height, float znear, float zfar) const |
| Stores OpenGl projection 4x4 matrix in array pointed to by mat.
|
|
void | fill_gl_viewtrans (float *mat) const |
| Stores OpenGl view transformation 4x4 matrix in array pointed to by mat.
|
|
void | fill_inverse_calibration (float *mat, float width, float height) const |
| Stores 3x3 inverse calibration (or inverse projection) matrix.
|
|
void | fill_reprojection (CameraInfo const &destination, float src_width, float src_height, float dst_width, float dst_height, float *mat, float *vec) const |
| Stores the reprojection operator (mat, vec) from pixel coordinates in this source view to the given destination view.
|
|
void | fill_viewing_direction (float *viewdir) const |
| Stores the (normalized) viewing direction in world coordinates into the array pointed to by 'viewdir'.
|
|
void | fill_world_to_cam (float *mat) const |
| Stores world to camera 4x4 matrix in array pointed to by mat.
|
|
void | fill_world_to_cam_rot (float *mat) const |
| Stores the world to camera 3x3 rotation matrix in mat.
|
|
std::string | get_rotation_string (void) const |
| Retuns the rotation in string format.
|
|
std::string | get_translation_string (void) const |
| Retuns the translation in string format.
|
|
void | set_rotation_from_string (std::string const &rot_string) |
| Sets the rotation from string.
|
|
void | set_transformation (float const *mat) |
| Initializes 'rot' and 'trans' members using the 4x4 matrix 'mat'.
|
|
void | set_translation_from_string (std::string const &trans_string) |
| Sets the translation from string.
|
|
Per-view camera information with various helper functions.
An invalid camera is indicated with focal length set to 0.0f.
Definition at line 23 of file camera.h.
void mve::CameraInfo::fill_calibration |
( |
float * |
mat, |
|
|
float |
width, |
|
|
float |
height |
|
) |
| const |
Stores the 3x3 calibration (or projection) matrix (K-matrix in Hartley, Zisserman).
The matrix projects a point in camera coordinates to the image plane with dimensions 'width' and 'height'. The convention is that the camera looks along the positive z-axis. To obtain the pixel coordinates after projection, 0.5 must be subtracted from the coordinates.
If the dimensions of the image are unknown, the generic projection matrix with w=1 and h=1 can be used. Image coordinates x' and y' for image size w and h are then computed as follows:
For w > h: x' = x * w and y' = y * w - (w - h) / 2. For h > w: x' = x * h - (h - w) / 2 and y' = y * h.
Definition at line 125 of file camera.cc.
void mve::CameraInfo::fill_inverse_calibration |
( |
float * |
mat, |
|
|
float |
width, |
|
|
float |
height |
|
) |
| const |
Stores 3x3 inverse calibration (or inverse projection) matrix.
The matrix projects a point (x, y, 1) from the image plane into the camera coordinate system. Note that 0.5 must be added to the pixel coordinates x and y before projection.
Definition at line 180 of file camera.cc.
void mve::CameraInfo::fill_reprojection |
( |
CameraInfo const & |
destination, |
|
|
float |
src_width, |
|
|
float |
src_height, |
|
|
float |
dst_width, |
|
|
float |
dst_height, |
|
|
float * |
mat, |
|
|
float * |
vec |
|
) |
| const |
Stores the reprojection operator (mat, vec) from pixel coordinates in this source view to the given destination view.
The reprojection of a pixel coordinate 'xs' in a source view with respect to depth 'd' to coordinate 'xd' in a destination view is given by:
xd = Kd ( Rd Rs^-1 ( Ks^-1 * xs * d - ts ) + td )
which gives rise to the reprojection operator (T,t) with
xd = T * xs * d + t
Here, (T,t) is returned (mat, vec). Note that the depth in these formulas represents the distance along the z-axis in the camera frame, NOT the distance from the camera center.
Definition at line 205 of file camera.cc.