54 #include <visp/vpMath.h>
55 #include <visp/vpRotationMatrix.h>
56 #include <visp/vpHomography.h>
57 #include <visp/vpDebug.h>
58 #include <visp/vpThetaUVector.h>
59 #include <visp/vpParseArgv.h>
64 #define GETOPTARGS "h"
66 void usage(
const char *name,
const char *badparam);
67 bool getOptions(
int argc,
const char **argv);
74 void usage(
const char *name,
const char *badparam)
77 Tests transformation within various representations of rotation.\n\
88 fprintf(stdout,
"\nERROR: Bad parameter [%s]\n", badparam);
97 bool getOptions(
int argc,
const char **argv)
104 case 'h': usage(argv[0], NULL);
return false;
break;
107 usage(argv[0], optarg_);
112 if ((c == 1) || (c == -1)) {
114 usage(argv[0], NULL);
115 std::cerr <<
"ERROR: " << std::endl;
116 std::cerr <<
" Bad argument " << optarg_ << std::endl << std::endl;
125 main(
int argc,
const char ** argv)
129 if (getOptions(argc, argv) ==
false) {
136 std::cout <<
"Initialization " <<std::endl ;
139 std::cout <<
"From vpThetaUVector to vpRotationMatrix " << std::endl ;
146 std::cout <<
"M" <<std::endl <<M << std::endl ;
151 std::cout <<
"H" <<std::endl <<H << std::endl ;
156 H.computeDisplacement(R,T,n) ;
158 std::cout <<
"R" <<std::endl << R ;
159 std::cout <<
"T" <<std::endl << T.
t() << std::endl;
160 std::cout <<
"n" <<std::endl << n.
t() << std::endl;
162 std::cout <<
"------------------------------------------------------" << std::endl ;
167 std::cout <<
"Initialization " << std::endl ;
170 std::cout <<
"From vpThetaUVector to vpRotationMatrix " << std::endl ;
181 std::cout <<
"M" << std::endl << M << std::endl ;
186 std::cout <<
"H" << std::endl << H << std::endl ;
191 H.computeDisplacement(R,T,n) ;
193 std::cout <<
"R" <<std::endl << R ;
194 std::cout <<
"T" <<std::endl << T.
t() << std::endl;
195 std::cout <<
"n" <<std::endl << n.
t() << std::endl;
198 std::cout <<
"------------------------------------------------------" << std::endl ;
212 std::cout <<
"M" << std::endl << M << std::endl ;
217 std::cout <<
"H" << std::endl << H << std::endl ;
221 H.computeDisplacement(R,T,n) ;
223 std::cout <<
"R" <<std::endl << R ;
224 std::cout <<
"T" <<std::endl << T.
t() << std::endl;
225 std::cout <<
"n" <<std::endl << n.
t() << std::endl;
227 vpPlane p1(n[0],n[1],n[2],1.0) ;
228 H.buildFrom(R,T,p1) ;
229 std::cout <<
"H" << std::endl << H << std::endl ;
234 std::cout <<
"Catch an exception: " << e << std::endl;
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
error that can be emited by ViSP classes.
static bool parse(int *argcPtr, const char **argv, vpArgvInfo *argTable, int flags)
The vpRotationMatrix considers the particular case of a rotation matrix.
void insert(const vpRotationMatrix &R)
This class aims to compute the homography wrt.two images.
vpRowVector t() const
transpose of Vector
static double rad(double deg)
Class that provides a data structure for the column vectors as well as a set of operations on these v...
This class defines the container for a plane geometrical structure.
Class that consider the case of a translation vector.
Class that consider the case of the parameterization for the rotation.