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>
65 void usage(
const char *name,
const char *badparam);
66 bool getOptions(
int argc,
const char **argv);
73 void usage(
const char *name,
const char *badparam)
76 Performs various tests on the point class.\n\
87 fprintf(stdout,
"\nERROR: Bad parameter [%s]\n", badparam);
96 bool getOptions(
int argc,
const char **argv)
103 case 'h': usage(argv[0], NULL);
return false;
break;
106 usage(argv[0], optarg_);
111 if ((c == 1) || (c == -1)) {
113 usage(argv[0], NULL);
114 std::cerr <<
"ERROR: " << std::endl;
115 std::cerr <<
" Bad argument " << optarg_ << std::endl << std::endl;
124 main(
int argc,
const char ** argv)
128 if (getOptions(argc, argv) ==
false) {
138 vpTRACE(
"set point coordinates in the world frame ") ;
141 std::cout <<
"------------------------------------------------------"<<std::endl ;
142 vpTRACE(
"test the projection ") ;
145 vpTRACE(
"coordinates in the world frame ") ;
146 std::cout << point.
oP.
t() << std::endl ;
147 vpTRACE(
"coordinates in the camera frame ") ;
148 std::cout << point.
cP.
t() << std::endl ;
151 std::cout<< point.
get_x() <<
" " << point.
get_y() << std::endl ;
153 std::cout <<
"------------------------------------------------------"<<std::endl ;
154 vpTRACE(
"test the interaction matrix ") ;
161 std::cout << L << std::endl ;
163 vpTRACE(
"test the interaction matrix select") ;
166 std::cout << L << std::endl ;
170 std::cout << L << std::endl ;
175 std::cout << L << std::endl ;
179 std::cout << L << std::endl ;
181 std::cout <<
"------------------------------------------------------"<<std::endl ;
189 pd.
print() ; std::cout << std::endl ;
192 std::cout << e << std::endl ;
194 vpTRACE(
"test the interaction matrix select") ;
197 std::cout << e << std::endl ;
201 std::cout << e << std::endl ;
205 std::cout << e << std::endl ;
209 std::cout << e << std::endl ;
212 catch(
vpException me){ std::cout << me << std::endl ; }
213 std::cout <<
"------------------------------------------------------"<<std::endl ;
214 vpTRACE(
"test the dimension") ;
217 std::cout <<
"Dimension = " << dim << std::endl ;
219 vpTRACE(
"test the dimension with select") ;
222 std::cout <<
"Dimension = " << dim << std::endl ;
226 std::cout <<
"Dimension = " << dim << std::endl ;
230 std::cout <<
"Dimension = " << dim << std::endl ;
234 std::cout <<
"Dimension = " << dim << std::endl ;
238 std::cout <<
"Catch an exception: " << e << 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