Public Member Functions

calibration Class Reference

#include <calibration.h>

List of all members.

Public Member Functions

 calibration (const options &opts)
const matrix3get_intrinsic_matrix () const
CvPoint camera_to_pixel (const vector3 &v, double scale=1.0) const
CvPoint world_to_pixel (const vector3 &v, double scale=1.0) const
vector3 pixel_to_camera (const CvPoint p, double scale=1.0) const
vector3 pixel_to_world (const CvPoint p, double scale=1.0) const
vector3 world_to_camera (const vector3 &v) const
vector3 camera_to_world (const vector3 &v) const
vector3 camera_centre () const
void set_world_translation (const vector3 &t)
vector3 get_world_translation () const
void set_world_rotation (const vector3 &R)
vector3 get_world_rotation () const
bool save_world (const std::string filename) const
bool load_world (const std::string filename)

Constructor & Destructor Documentation

calibration::calibration ( const options opts  )  [inline]

Constructor for the calibration class. This class allows you to change from the different coordinate systems. In general we work with three coordinate systems:

  • The world coordinate system. This 3D coordinate system is the one in which the actual tracking is performed. Most data is also represented internally in this system. The actual definition of this coordinate system may vary, but often the origin is placed in the root of the kinematic skeleton.
  • The camera coordinate system. This 3D coordinate system has the optical centre as the origin. The Z-axis is perpendicular to the image plane.
  • The image coordinate system. This 2D coordinate system corresponds to the pixel coordinates of the image.
Parameters:
[in] opts An object of class options that contains the information in a configuration file. The constructor reads the "intrinsic_matrix" and "external_view" options from opts.

Member Function Documentation

vector3 calibration::camera_centre (  )  const [inline]

Return the origin of the camera coordinate system represented in the world coordinate system. This simply corresponds to the following code.

   camera_to_world (vector3 (0, 0, 0));
Returns:
A 3D point corresponding to the origin of the camera represented in the world coordinate system.
CvPoint calibration::camera_to_pixel ( const vector3 v,
double  scale = 1.0 
) const [inline]

Project a 3D point in the camera coordinate system onto the image. The image point is optionally scaled.

Parameters:
[in] v The 3D point expressed in the camera coordinate system.
[in] scale An optional scaling factor (defaults to 1). The resulting pixel coordinate is multiplied with this factor. This is useful when projecting points into an image of different size than the original image.
Returns:
The pixel coordinate of the projected point.
vector3 calibration::camera_to_world ( const vector3 v  )  const [inline]

Change a point from the camera coordinate system to the world coordinate system.

Parameters:
[in] v A 3D point expressed in the camera coordinate system.
Returns:
A 3D point expressed in the world coordinate system.
const matrix3& calibration::get_intrinsic_matrix (  )  const [inline]
vector3 calibration::get_world_rotation (  )  const [inline]

Return the current rotation parameters for the transformation from the camera coordinate system to the world coordinate system.

Returns:
A 3-vector where each element correspond to a rotation angle around one coordinate axis.
vector3 calibration::get_world_translation (  )  const [inline]

Return the current translation parameters for the transformation between the camera coordinate system and the world coordinate system.

Returns:
The translation vector from the camera coordinate system to the world coordinate system.
bool calibration::load_world ( const std::string  filename  )  [inline]

Read translation and rotation parameters for the transformation from the camera coordinate system to the world coordinate system.

Parameters:
[in] filename The name of the file containing the translation and rotation parameters. The file should contain one single line of ASCII text containing 6 numbers. These numbers should be

  • The translation along the X-axis.
  • The translation along the Y-axis.
  • The translation along the Z-axis.
  • The rotation around the X-axis.
  • The rotation around the Y-axis.
  • The rotation around the Z-axis.
Returns:
The function return true if the file was read succesfully and false otherwise.
vector3 calibration::pixel_to_camera ( const CvPoint  p,
double  scale = 1.0 
) const [inline]

Convert a 2D pixel coordinate to a 3D direction expressed in the camera coordinate system.

Returns:
A 3D vector pointing from the origin through the pixel. The Z-coordinate of this vector is 1.
vector3 calibration::pixel_to_world ( const CvPoint  p,
double  scale = 1.0 
) const [inline]

Convert a 2D pixel coordinate to a 3D direction expressed in the world coordinate system.

Returns:
A 3D vector pointing from the origin through the pixel.
bool calibration::save_world ( const std::string  filename  )  const [inline]

Save the current translation and rotation paramters for the transformation from the camera coordinate system to the world coordinate system.

Parameters:
[in] filename The name of the file in which the parameters will be stored.
Returns:
The function returns true of the data was written succesfully and false otherwise.
void calibration::set_world_rotation ( const vector3 R  )  [inline]

Set the rotation parameters for the transformation from the camera coordinate system to the world coordinate system.

Parameters:
[in] R A 3-vector where each element correspond to a rotation angle around one coordinate axis.
void calibration::set_world_translation ( const vector3 t  )  [inline]

Set the translation parameters for the transformation from the camera coordinate system to the world coordinate system.

Parameters:
[in] t The translation vector from the camera coordinate system to the world coordinate system.
vector3 calibration::world_to_camera ( const vector3 v  )  const [inline]

Change a point from the world coordinate system to the camera coordinate system.

Parameters:
[in] v A 3D point expressed in the world coordinate system.
Returns:
A 3D point expressed in the camera coordinate system.
CvPoint calibration::world_to_pixel ( const vector3 v,
double  scale = 1.0 
) const [inline]

Project a 3D point in the world coordinate system onto the image. The image point is optionally scaled.

Parameters:
[in] v The 3D point expressed in the world coordinate system.
[in] scale An optional scaling factor (defaults to 1). The resulting pixel coordinate is multiplied with this factor. This is useful when projecting points into an image of different size than the original image.
Returns:
The pixel coordinate of the projected point.

The documentation for this class was generated from the following file: