#include <visp3/core/vpImageTools.h>
#include <visp3/core/vpIoTools.h>
#include <visp3/core/vpXmlParserCamera.h>
#include <visp3/io/vpImageIo.h>
int
main( int argc, char **argv )
{
std::string opt_input_image = "chessboard.jpg";
std::string opt_camera_file = "camera.xml";
std::string opt_camera_name = "Camera";
try
{
for ( int i = 1; i < argc; i++ )
{
if ( std::string( argv[i] ) == "--image" && i + 1 < argc )
{
opt_input_image = std::string( argv[i + 1] );
}
else if ( std::string( argv[i] ) == "--camera-file" && i + 1 < argc )
{
opt_camera_file = std::string( argv[i + 1] );
}
else if ( std::string( argv[i] ) == "--camera-name" && i + 1 < argc )
{
opt_camera_name = std::string( argv[i + 1] );
}
else if ( std::string( argv[i] ) == "--help" || std::string( argv[i] ) == "-h" )
{
std::cout << argv[0] << " [--image <input image (pgm,ppm,jpeg,png,tiff,bmp,ras,jp2)>]"
<< " [--camera-file <xml file>] [--camera-name <name>] [--help] [-h]\n"
<< std::endl;
std::cout << "Examples: " << std::endl
<< argv[0] << std::endl
<< argv[0] << " --image chessboard.jpg --camera-file camera.xml --camera-name Camera" << std::endl;
return EXIT_SUCCESS;
}
}
std::cout << "Read input image: " << opt_input_image << std::endl;
{
std::cout << "Cannot found parameters for camera named \"Camera\"" << std::endl;
}
#if 0
#endif
std::cout << cam << std::endl;
std::string output_image = name_we + "-undistort" + ext;
std::cout << "Save undistorted image in: " << output_image << std::endl;
}
{
std::cout << "Catch an exception: " << e << std::endl;
}
return 0;
}