42 #include <visp3/core/vpXmlParserCamera.h> 43 #include <visp3/core/vpIoTools.h> 47 #ifdef VISP_HAVE_PUGIXML 49 std::string tmp_dir =
"C:/temp/";
51 std::string tmp_dir =
"/tmp/";
58 tmp_dir += username +
"/test_xml_parser_camera/";
60 std::cout <<
"Create: " << tmp_dir << std::endl;
66 std::string filename = tmp_dir +
"test_write_cam_without_distortion.xml";
69 std::cout <<
"Write to: " << filename << std::endl;
71 std::cerr <<
"Cannot save XML file: " << filename << std::endl;
80 std::cout <<
"Cam write:\n" << cam << std::endl;
81 std::cout <<
"Cam read:\n" << cam_read << std::endl;
82 if (cam != cam_read) {
83 std::cerr <<
"Issue when parsing XML file: " << filename << std::endl;
90 std::cout << std::endl;
93 std::string filename = tmp_dir +
"test_write_cam_with_distortion.xml";
96 std::cout <<
"Write to: " << filename << std::endl;
98 std::cerr <<
"Cannot save XML file: " << filename << std::endl;
107 std::cout <<
"Cam write:\n" << cam << std::endl;
108 std::cout <<
"Cam read:\n" << cam_read << std::endl;
109 if (cam != cam_read) {
110 std::cerr <<
"Issue when parsing XML file: " << filename << std::endl;
XML parser to load and save intrinsic camera parameters.
void initPersProjWithDistortion(double px, double py, double u0, double v0, double kud, double kdu)
Generic class defining intrinsic camera parameters.
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)
void initPersProjWithoutDistortion(double px, double py, double u0, double v0)
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="")