Visual Servoing Platform
version 3.3.0 under development (2020-02-17)
|
#include <visp3/core/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 171 of file vpXmlParserCamera.h.
Enumerator | |
---|---|
SEQUENCE_OK | |
SEQUENCE_ERROR |
Definition at line 174 of file vpXmlParserCamera.h.
vpXmlParserCamera::vpXmlParserCamera | ( | ) |
Definition at line 944 of file vpXmlParserCamera.cpp.
vpXmlParserCamera::~vpXmlParserCamera | ( | ) |
Definition at line 948 of file vpXmlParserCamera.cpp.
std::string vpXmlParserCamera::getCameraName | ( | ) | const |
Definition at line 1024 of file vpXmlParserCamera.cpp.
vpCameraParameters vpXmlParserCamera::getCameraParameters | ( | ) | const |
Definition at line 1029 of file vpXmlParserCamera.cpp.
unsigned int vpXmlParserCamera::getHeight | ( | ) | const |
Definition at line 1034 of file vpXmlParserCamera.cpp.
unsigned int vpXmlParserCamera::getSubsampling_height | ( | ) | const |
Definition at line 1044 of file vpXmlParserCamera.cpp.
unsigned int vpXmlParserCamera::getSubsampling_width | ( | ) | const |
Definition at line 1039 of file vpXmlParserCamera.cpp.
unsigned int vpXmlParserCamera::getWidth | ( | ) | const |
Definition at line 1049 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 967 of file vpXmlParserCamera.cpp.
Referenced by vpViper650::getCameraParameters(), vpViper850::getCameraParameters(), vpAfma6::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 1017 of file vpXmlParserCamera.cpp.
void vpXmlParserCamera::setCameraName | ( | const std::string & | name | ) |
Definition at line 1054 of file vpXmlParserCamera.cpp.
void vpXmlParserCamera::setHeight | ( | unsigned int | height | ) |
Definition at line 1059 of file vpXmlParserCamera.cpp.
void vpXmlParserCamera::setSubsampling_height | ( | unsigned int | subsampling | ) |
Definition at line 1069 of file vpXmlParserCamera.cpp.
void vpXmlParserCamera::setSubsampling_width | ( | unsigned int | subsampling | ) |
Definition at line 1064 of file vpXmlParserCamera.cpp.
void vpXmlParserCamera::setWidth | ( | unsigned int | width | ) |
Definition at line 1074 of file vpXmlParserCamera.cpp.