Kiretu
Public Member Functions | Private Member Functions | Private Attributes

YMLParser Class Reference

C++-class for read in a Kinect yml calibration file and extract the intrinsic and extrisic parameters of the Kinect. More...

#include <YMLParser.h>

Public Member Functions

 YMLParser (const std::string filename)
 Constructor of the YMLParser-class.
 ~YMLParser ()
 Deconstructor of the YMLParser-class.
void parseFile ()
 Reads and parses the yml-file specified at the constructor and saves the calibration parameters in the equivalent member variables of the class.
std::vector< std::vector< float > > getRgbCam ()
 Get the intrinsics of the rgb-camera.
std::vector< float > getRgbDist ()
 Get the distortion coefficients of the RGB-camera.
std::vector< std::vector< float > > getDepthCam ()
 Get the intrinsics of the depth-camera.
std::vector< float > getDepthDist ()
 Get the distortion coefficients of the depth-camera.
std::vector< std::vector< float > > getRot ()
 Get the rotation-matrix of the Kinect.
std::vector< float > getTrans ()
 Get the translation-vector of the Kinect.

Private Member Functions

void readFile ()
 Reads in the calibration-file.
void findParam (KinectParam param)
 Extracts the given KinectParam from the read in yml-file and stores them in the equivalent member variables.
void csvToVector (std::string str, std::vector< float > &vec)
 Splits up a string of comma separated values as used in the yml file and stores it in the given vector.
void csvToMatrix (std::string str, std::vector< std::vector< float > > &mat)
 Splits up a string of comma separated values as used in the yml file and stores it in the given matrix.

Private Attributes

std::string filename
std::string text
std::vector< std::vector< float > > rgbCam
std::vector< float > rgbDist
std::vector< std::vector< float > > depthCam
std::vector< float > depthDist
std::vector< std::vector< float > > rot
std::vector< float > trans

Detailed Description

C++-class for read in a Kinect yml calibration file and extract the intrinsic and extrisic parameters of the Kinect.

Author:
Daniel Wunderlich (d.wunderlich@stud.uni-heidelberg.de)
Version:
0.8
Date:
2011-01-26
See also:
Reconstruction and Calibration parameter

Constructor & Destructor Documentation

YMLParser::YMLParser ( const std::string  filename)

Constructor of the YMLParser-class.

Parameters:
filename/Path/to/calibrationfile.yml
YMLParser::~YMLParser ( )

Deconstructor of the YMLParser-class.


Member Function Documentation

void YMLParser::csvToMatrix ( std::string  str,
std::vector< std::vector< float > > &  mat 
) [private]

Splits up a string of comma separated values as used in the yml file and stores it in the given matrix.

Parameters:
strString of comma separated values: value1,value2,...,valueN. Notice that there should be no whitespace and no comma after the last value.
matThe matrix the parameters should be stored to. It is important that the matrix is initialized with the corresponding size/length.
void YMLParser::csvToVector ( std::string  str,
std::vector< float > &  vec 
) [private]

Splits up a string of comma separated values as used in the yml file and stores it in the given vector.

Parameters:
strString of comma separated values: value1,value2,...,valueN. Notice that there should be no whitespace and no comma after the last value.
vecThe vector the parameters should be stored to. It is important that the vecor is initialized with the corresponding size/length.
void YMLParser::findParam ( KinectParam  param) [private]

Extracts the given KinectParam from the read in yml-file and stores them in the equivalent member variables.

Parameters:
paramParameter to extract.
std::vector< std::vector< float > > YMLParser::getDepthCam ( )

Get the intrinsics of the depth-camera.

Returns:
A camera-matrix containing the intrinsic parameters of the depth-camera:

\[ \mathbf{C} = \begin{pmatrix} f_x & 0 & c_x \\ 0 & f_y & c_y \\ 0 & 0 & 1 \end{pmatrix} \]

std::vector< float > YMLParser::getDepthDist ( )

Get the distortion coefficients of the depth-camera.

Returns:
A vector containing the distortion coefficients of the depth-camera.
std::vector< std::vector< float > > YMLParser::getRgbCam ( )

Get the intrinsics of the rgb-camera.

Returns:
A camera-matrix containing the intrinsic parameters of the RGB-camera:

\[ \mathbf{C} = \begin{pmatrix} f_x & 0 & c_x \\ 0 & f_y & c_y \\ 0 & 0 & 1 \end{pmatrix} \]

std::vector< float > YMLParser::getRgbDist ( )

Get the distortion coefficients of the RGB-camera.

Returns:
A vector containing the distortion coefficients of the RGB-camera.
std::vector< std::vector< float > > YMLParser::getRot ( )

Get the rotation-matrix of the Kinect.

Returns:
Rotation-matrix of the Kinect:

\[ \mathbf{T} = \begin{pmatrix} r_{11} & r_{12} & r_{13}\\ r_{21} & r_{22} & r_{23}\\ r_{31} & r_{32} & r_{33} \end{pmatrix} \]

std::vector< float > YMLParser::getTrans ( )

Get the translation-vector of the Kinect.

Returns:
Translation-vector of the Kinect:

\[ \mathbf{T} = \begin{pmatrix} t_1 \\ t_2 \\ t_3 \end{pmatrix} \]

void YMLParser::parseFile ( )

Reads and parses the yml-file specified at the constructor and saves the calibration parameters in the equivalent member variables of the class.

void YMLParser::readFile ( ) [private]

Reads in the calibration-file.


Field Documentation

std::vector<std::vector<float> > YMLParser::depthCam [private]

Intrinsics of the depth-camera. Saved as 3x3-matrix.

std::vector<float> YMLParser::depthDist [private]

Distortion parameters of the depth-camera. Saved as 5-dimensional vector.

std::string YMLParser::filename [private]

Path and filename of the yml file

std::vector<std::vector<float> > YMLParser::rgbCam [private]

Intrinsics of the RGB-camera. Saved as 3x3-matrix.

std::vector<float> YMLParser::rgbDist [private]

Distortion parameters of the RGB-camera. Saved as 5-dimensional vector.

std::vector<std::vector<float> > YMLParser::rot [private]

Rotation-matrix (3x3) of the extrinsic camera-parameters

std::string YMLParser::text [private]

Content of the yml file

std::vector<float> YMLParser::trans [private]

Translation-vector (3-dimensional) of the extrinsic camera-parameters


The documentation for this class was generated from the following files:
 All Data Structures Files Functions Variables Enumerations Enumerator
[Page Up]