Visual Servoing Platform
version 3.6.1 under development (2024-11-14)
|
#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, bool verbose=true) |
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="", bool verbose=true) |
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 172 of file vpXmlParserCamera.h.
Enumerator | |
---|---|
SEQUENCE_OK | |
SEQUENCE_ERROR |
Definition at line 175 of file vpXmlParserCamera.h.
BEGIN_VISP_NAMESPACE vpXmlParserCamera::vpXmlParserCamera | ( | ) |
Definition at line 1181 of file vpXmlParserCamera.cpp.
vpXmlParserCamera::~vpXmlParserCamera | ( | ) |
Definition at line 1183 of file vpXmlParserCamera.cpp.
std::string vpXmlParserCamera::getCameraName | ( | ) | const |
Definition at line 1261 of file vpXmlParserCamera.cpp.
vpCameraParameters vpXmlParserCamera::getCameraParameters | ( | ) | const |
Definition at line 1263 of file vpXmlParserCamera.cpp.
unsigned int vpXmlParserCamera::getHeight | ( | ) | const |
Definition at line 1265 of file vpXmlParserCamera.cpp.
unsigned int vpXmlParserCamera::getSubsampling_height | ( | ) | const |
Definition at line 1269 of file vpXmlParserCamera.cpp.
unsigned int vpXmlParserCamera::getSubsampling_width | ( | ) | const |
Definition at line 1267 of file vpXmlParserCamera.cpp.
unsigned int vpXmlParserCamera::getWidth | ( | ) | const |
Definition at line 1271 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 , |
||
bool | verbose = true |
||
) |
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 to an empty string "" if the camera name is not ambiguous. |
projModel | : Camera projection model needed. |
im_width | : Image width on which camera calibration was performed. Set to 0 if not ambiguous. |
im_height | : Image height on which camera calibration was performed. Set to 0 if not ambiguous. |
verbose | true to enable verbose mode, false otherwise. |
Definition at line 1200 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 = "" , |
||
bool | verbose = true |
||
) |
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 to "" if the camera name is not ambiguous. |
im_width | : Width of image on which camera calibration was performed. Set to 0 if not ambiguous. |
im_height | : Height of the image on which camera calibration was performed. Set to 0 if not ambiguous. |
additionalInfo | : Additional information added in the saved xml file. The content of this string should be in xml format. |
verbose | true to enable verbose mode, false otherwise. |
A typical usage would be the following:
In camera.xml
file, you will see:
Definition at line 1255 of file vpXmlParserCamera.cpp.
void vpXmlParserCamera::setCameraName | ( | const std::string & | name | ) |
Definition at line 1273 of file vpXmlParserCamera.cpp.
void vpXmlParserCamera::setHeight | ( | unsigned int | height | ) |
Definition at line 1275 of file vpXmlParserCamera.cpp.
void vpXmlParserCamera::setSubsampling_height | ( | unsigned int | subsampling | ) |
Definition at line 1279 of file vpXmlParserCamera.cpp.
void vpXmlParserCamera::setSubsampling_width | ( | unsigned int | subsampling | ) |
Definition at line 1277 of file vpXmlParserCamera.cpp.
void vpXmlParserCamera::setWidth | ( | unsigned int | width | ) |
Definition at line 1281 of file vpXmlParserCamera.cpp.