50 #define GETOPTARGS "h"
52 #include <visp/vpMath.h>
53 #include <visp/vpHomogeneousMatrix.h>
54 #include <visp/vpPoint.h>
55 #include <visp/vpFeaturePoint.h>
56 #include <visp/vpFeatureException.h>
57 #include <visp/vpDebug.h>
58 #include <visp/vpFeatureBuilder.h>
59 #include <visp/vpParseArgv.h>
69 void usage(
const char *name,
const char *badparam)
72 Performs various tests on the point class.\n\
83 fprintf(stdout,
"\nERROR: Bad parameter [%s]\n", badparam);
92 bool getOptions(
int argc,
const char **argv)
99 case 'h': usage(argv[0], NULL);
return false;
break;
102 usage(argv[0], optarg);
107 if ((c == 1) || (c == -1)) {
109 usage(argv[0], NULL);
110 std::cerr <<
"ERROR: " << std::endl;
111 std::cerr <<
" Bad argument " << optarg << std::endl << std::endl;
120 main(
int argc,
const char ** argv)
123 if (getOptions(argc, argv) ==
false) {
133 vpTRACE(
"set point coordinates in the world frame ") ;
137 std::cout <<
"------------------------------------------------------"<<std::endl ;
138 vpTRACE(
"test the projection ") ;
141 vpTRACE(
"coordinates in the world frame ") ;
142 std::cout << point.
oP.
t() << std::endl ;
143 vpTRACE(
"coordinates in the camera frame ") ;
144 std::cout << point.
cP.
t() << std::endl ;
147 std::cout<< point.
get_x() <<
" " << point.
get_y() << std::endl ;
149 std::cout <<
"------------------------------------------------------"<<std::endl ;
150 vpTRACE(
"test the interaction matrix ") ;
157 std::cout << L << std::endl ;
159 vpTRACE(
"test the interaction matrix select") ;
162 std::cout << L << std::endl ;
166 std::cout << L << std::endl ;
171 std::cout << L << std::endl ;
175 std::cout << L << std::endl ;
177 std::cout <<
"------------------------------------------------------"<<std::endl ;
185 pd.
print() ; std::cout << std::endl ;
188 std::cout << e << std::endl ;
190 vpTRACE(
"test the interaction matrix select") ;
193 std::cout << e << std::endl ;
197 std::cout << e << std::endl ;
201 std::cout << e << std::endl ;
205 std::cout << e << std::endl ;
208 catch(
vpException me){ std::cout << me << std::endl ; }
209 std::cout <<
"------------------------------------------------------"<<std::endl ;
210 vpTRACE(
"test the dimension") ;
213 std::cout <<
"Dimension = " << dim << std::endl ;
215 vpTRACE(
"test the dimension with select") ;
218 std::cout <<
"Dimension = " << dim << std::endl ;
222 std::cout <<
"Dimension = " << dim << std::endl ;
226 std::cout <<
"Dimension = " << dim << std::endl ;
230 std::cout <<
"Dimension = " << dim << std::endl ;
Definition of the vpMatrix class.
vpMatrix interaction(const unsigned int select=FEATURE_ALL)
unsigned int getDimension(const unsigned int select=FEATURE_ALL) const
Get the feature vector dimension.
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
vpColVector error(const vpBasicFeature &s_star, const unsigned int select=FEATURE_ALL)
error that can be emited by ViSP classes.
static unsigned int selectAll()
Select all the features.
void track(const vpHomogeneousMatrix &cMo)
Class that defines a 2D point visual feature which is composed by two parameters that are the cartes...
double get_y() const
Get the point y coordinate in the image plane.
void set_y(const double y)
static bool parse(int *argcPtr, const char **argv, vpArgvInfo *argTable, int flags)
Class that defines what is a point.
void set_x(const double x)
Error that can be emited by the vpBasicFeature class and its derivates.
vpRowVector t() const
transpose of Vector
double get_x() const
Get the point x coordinate in the image plane.
Class that provides a data structure for the column vectors as well as a set of operations on these v...
static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot &d)
static unsigned int selectX()
static unsigned int selectY()
void setWorldCoordinates(const double ox, const double oy, const double oz)
Set the point world coordinates. We mean here the coordinates of the point in the object frame...
void print(const unsigned int select=FEATURE_ALL) const