Kiretu
|
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 |
C++-class for read in a Kinect yml calibration file and extract the intrinsic and extrisic parameters of the Kinect.
YMLParser::YMLParser | ( | const std::string | filename | ) |
Constructor of the YMLParser-class.
filename | /Path/to/calibrationfile.yml |
YMLParser::~YMLParser | ( | ) |
Deconstructor of the YMLParser-class.
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.
str | String of comma separated values: value1,value2,...,valueN. Notice that there should be no whitespace and no comma after the last value. |
mat | The 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.
str | String of comma separated values: value1,value2,...,valueN. Notice that there should be no whitespace and no comma after the last value. |
vec | The 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.
param | Parameter to extract. |
std::vector< std::vector< float > > YMLParser::getDepthCam | ( | ) |
Get the intrinsics of the depth-camera.
std::vector< float > YMLParser::getDepthDist | ( | ) |
Get the distortion coefficients of the depth-camera.
std::vector< std::vector< float > > YMLParser::getRgbCam | ( | ) |
Get the intrinsics of the rgb-camera.
std::vector< float > YMLParser::getRgbDist | ( | ) |
Get the distortion coefficients of the RGB-camera.
std::vector< std::vector< float > > YMLParser::getRot | ( | ) |
Get the rotation-matrix of the Kinect.
std::vector< float > YMLParser::getTrans | ( | ) |
Get the translation-vector of the Kinect.
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.
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