53 #define GETOPTARGS "h"
55 #include <visp/vpMath.h>
56 #include <visp/vpDebug.h>
57 #include <visp/vpParseArgv.h>
58 #include <visp/vpCameraParameters.h>
59 #include <visp/vpMeterPixelConversion.h>
60 #include <visp/vpPixelMeterConversion.h>
61 #include <visp/vpMath.h>
70 void usage(
const char *name,
const char *badparam)
73 Performs various tests on the vpPixelMeterConversion and\n\
74 vpPixelMeterConversion class.\n\
85 fprintf(stdout,
"\nERROR: Bad parameter [%s]\n", badparam);
94 bool getOptions(
int argc,
const char **argv)
101 case 'h': usage(argv[0], NULL);
return false;
break;
104 usage(argv[0], optarg);
109 if ((c == 1) || (c == -1)) {
111 usage(argv[0], NULL);
112 std::cerr <<
"ERROR: " << std::endl;
113 std::cerr <<
" Bad argument " << optarg << std::endl << std::endl;
122 main(
int argc,
const char ** argv)
125 if (getOptions(argc, argv) ==
false) {
136 double px_dist,py_dist,u0_dist,v0_dist,kud_dist,kdu_dist;
137 px_dist = 1624.824731;
138 py_dist = 1625.263641;
139 u0_dist = 324.0923411;
140 v0_dist = 245.2421388;
141 kud_dist = -0.1741532338;
142 kdu_dist = 0.1771165148;
150 double x1 = 0, y1 = 0;
151 double u2 = 0, v2 = 0;
155 vpTRACE(
"Error in convertPoint without distortion:\n"
157 "v1 = %f, v2 = %f\n",u1,u2,v1,v2);
160 vpTRACE(
"convertPoint without distortion :\n"
162 "v1 - v2 = %.20f\n",u1 - u2,v1 - v2);
167 vpTRACE(
"Error in convertPoint with distortion :\n"
169 "v1 = %f, v2 = %f\n",u1,u2,v1,v2);
172 vpTRACE(
"convertPoint with distortion :\n"
174 "v1 - v2 = %.20f\n",u1 - u2,v1 - v2);
static void convertPoint(const vpCameraParameters &cam, const double &x, const double &y, double &u, double &v)
Point coordinates conversion from normalized coordinates in meter to pixel coordinates ...
static bool equal(double x, double y, double s=0.001)
static void convertPoint(const vpCameraParameters &cam, const double &u, const double &v, double &x, double &y)
Point coordinates conversion from pixel coordinates to normalized coordinates in meter...
static bool parse(int *argcPtr, const char **argv, vpArgvInfo *argTable, int flags)
void initPersProjWithoutDistortion(const double px, const double py, const double u0, const double v0)
Generic class defining intrinsic camera parameters.
void initPersProjWithDistortion(const double px, const double py, const double u0, const double v0, const double kud, const double kdu)