![]() |
Visual Servoing Platform version 3.5.0
|
#include <vpXmlParserCamera.h>
Public Types | |
| enum | vpXmlCodeSequenceType { SEQUENCE_OK , SEQUENCE_ERROR } |
Public Member Functions | |
| vpXmlParserCamera () | |
| ~vpXmlParserCamera () | |
| std::string | getCameraName () const |
| vpCameraParameters | getCameraParameters () const |
| unsigned int | getHeight () const |
| unsigned int | getSubsampling_width () const |
| unsigned int | getSubsampling_height () const |
| unsigned int | getWidth () const |
| int | parse (vpCameraParameters &cam, const std::string &filename, const std::string &camera_name, const vpCameraParameters::vpCameraParametersProjType &projModel, unsigned int image_width=0, unsigned int image_height=0) |
| int | save (const vpCameraParameters &cam, const std::string &filename, const std::string &camera_name, unsigned int image_width=0, unsigned int image_height=0, const std::string &additionalInfo="") |
| void | setCameraName (const std::string &name) |
| void | setHeight (unsigned int height) |
| void | setSubsampling_width (unsigned int subsampling) |
| void | setSubsampling_height (unsigned int subsampling) |
| void | setWidth (unsigned int width) |
XML parser to load and save intrinsic camera parameters.
To have a complete description of the camera parameters and the corresponding projection model implemented in ViSP, see vpCameraParameters.
Example of an XML file "myXmlFile.xml" containing intrinsic camera parameters:
Example of loading existing camera parameters from an XML file:
Example of writing an XML file containing intrinsic camera parameters:
Definition at line 164 of file vpXmlParserCamera.h.
| Enumerator | |
|---|---|
| SEQUENCE_OK | |
| SEQUENCE_ERROR | |
Definition at line 167 of file vpXmlParserCamera.h.
| vpXmlParserCamera::vpXmlParserCamera | ( | ) |
Definition at line 1073 of file vpXmlParserCamera.cpp.
| vpXmlParserCamera::~vpXmlParserCamera | ( | ) |
Definition at line 1077 of file vpXmlParserCamera.cpp.
| std::string vpXmlParserCamera::getCameraName | ( | ) | const |
Definition at line 1153 of file vpXmlParserCamera.cpp.
| vpCameraParameters vpXmlParserCamera::getCameraParameters | ( | ) | const |
Definition at line 1158 of file vpXmlParserCamera.cpp.
| unsigned int vpXmlParserCamera::getHeight | ( | ) | const |
Definition at line 1163 of file vpXmlParserCamera.cpp.
| unsigned int vpXmlParserCamera::getSubsampling_height | ( | ) | const |
Definition at line 1173 of file vpXmlParserCamera.cpp.
| unsigned int vpXmlParserCamera::getSubsampling_width | ( | ) | const |
Definition at line 1168 of file vpXmlParserCamera.cpp.
| unsigned int vpXmlParserCamera::getWidth | ( | ) | const |
Definition at line 1178 of file vpXmlParserCamera.cpp.
| int vpXmlParserCamera::parse | ( | vpCameraParameters & | cam, |
| const std::string & | filename, | ||
| const std::string & | cam_name, | ||
| const vpCameraParameters::vpCameraParametersProjType & | projModel, | ||
| unsigned int | im_width = 0, |
||
| unsigned int | im_height = 0 |
||
| ) |
Parse an xml file to load camera parameters.
| cam | : camera parameters to fill. |
| filename | : name of the xml file to parse |
| cam_name | : name of the camera : useful if the xml file has multiple camera parameters. Set as "" if the camera name is not ambiguous. |
| projModel | : camera projection model needed. |
| im_width | : image width on which camera calibration was performed. Set as 0 if not ambiguous. |
| im_height | : image height on which camera calibration was performed. Set as 0 if not ambiguous. |
Definition at line 1096 of file vpXmlParserCamera.cpp.
Referenced by vpAfma6::getCameraParameters(), vpViper650::getCameraParameters(), vpViper850::getCameraParameters(), and vpKinect::start().
| int vpXmlParserCamera::save | ( | const vpCameraParameters & | cam, |
| const std::string & | filename, | ||
| const std::string & | cam_name, | ||
| unsigned int | im_width = 0, |
||
| unsigned int | im_height = 0, |
||
| const std::string & | additionalInfo = "" |
||
| ) |
Save camera parameters in an xml file.
| cam | : camera parameters to save. |
| filename | : name of the xml file to fill. |
| cam_name | : name of the camera : useful if the xml file has multiple camera parameters. Set as "" if the camera name is not ambiguous. |
| im_width | : width of image on which camera calibration was performed. Set as 0 if not ambiguous. |
| im_height | : height of the image on which camera calibration was performed. Set as 0 if not ambiguous. |
| additionalInfo | : Additional information added in the saved xml file. The content of this string should be in xml format. |
A typical usage would be the following:
In camera.xml file, you will see:
Definition at line 1146 of file vpXmlParserCamera.cpp.
| void vpXmlParserCamera::setCameraName | ( | const std::string & | name | ) |
Definition at line 1183 of file vpXmlParserCamera.cpp.
| void vpXmlParserCamera::setHeight | ( | unsigned int | height | ) |
Definition at line 1188 of file vpXmlParserCamera.cpp.
| void vpXmlParserCamera::setSubsampling_height | ( | unsigned int | subsampling | ) |
Definition at line 1198 of file vpXmlParserCamera.cpp.
| void vpXmlParserCamera::setSubsampling_width | ( | unsigned int | subsampling | ) |
Definition at line 1193 of file vpXmlParserCamera.cpp.
| void vpXmlParserCamera::setWidth | ( | unsigned int | width | ) |
Definition at line 1203 of file vpXmlParserCamera.cpp.