Performs various tests on the the point class.
#include <visp3/core/vpDebug.h>
#include <visp3/core/vpHomogeneousMatrix.h>
#include <visp3/core/vpMath.h>
#include <visp3/core/vpPoint.h>
#include <visp3/visual_features/vpFeatureBuilder.h>
#include <visp3/visual_features/vpFeatureException.h>
#include <visp3/visual_features/vpFeaturePoint.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
#ifdef ENABLE_VISP_NAMESPACE
#endif
try {
cMo[0][3] = 0.1;
cMo[1][3] = 0.2;
cMo[2][3] = 2;
vpTRACE("set point coordinates in the world frame ");
std::cout << "------------------------------------------------------" << std::endl;
vpTRACE("test the projection ");
vpTRACE("coordinates in the world frame ");
std::cout << point.
oP.
t() << std::endl;
vpTRACE("coordinates in the camera frame ");
std::cout << point.
cP.
t() << std::endl;
vpTRACE("2D coordinates ");
std::cout << point.
get_x() <<
" " << point.
get_y() << std::endl;
std::cout << "------------------------------------------------------" << std::endl;
vpTRACE("test the interaction matrix ");
std::cout << L << std::endl;
vpTRACE("test the interaction matrix select");
vpTRACE("\t only X");
std::cout << L << std::endl;
vpTRACE("\t only Y");
std::cout << L << std::endl;
vpTRACE("\t X & Y");
std::cout << L << std::endl;
vpTRACE("\t selectAll");
std::cout << L << std::endl;
std::cout << "------------------------------------------------------" << std::endl;
vpTRACE("test the error ");
try {
std::cout << std::endl;
std::cout << e << std::endl;
vpTRACE("test the interaction matrix select");
vpTRACE("\t only X");
std::cout << e << std::endl;
vpTRACE("\t only Y");
std::cout << e << std::endl;
vpTRACE("\t X & Y");
std::cout << e << std::endl;
vpTRACE("\t selectAll");
std::cout << e << std::endl;
}
std::cout << me << std::endl;
}
std::cout << me << std::endl;
}
std::cout << "------------------------------------------------------" << std::endl;
vpTRACE("test the dimension");
unsigned int dim;
std::cout << "Dimension = " << dim << std::endl;
vpTRACE("test the dimension with select");
vpTRACE("\t only X");
std::cout << "Dimension = " << dim << std::endl;
vpTRACE("\t only Y");
std::cout << "Dimension = " << dim << std::endl;
vpTRACE("\t X & Y");
std::cout << "Dimension = " << dim << std::endl;
vpTRACE("\t selectAll");
std::cout << "Dimension = " << dim << std::endl;
return EXIT_SUCCESS;
}
std::cout << "Catch an exception: " << e << std::endl;
return EXIT_FAILURE;
}
}
static unsigned int selectAll()
Select all the features.
unsigned int getDimension(unsigned int select=FEATURE_ALL) const
Get the feature vector dimension.
Implementation of column vector and the associated operations.
error that can be emitted by ViSP classes.
static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpImagePoint &t)
Error that can be emitted by the vpBasicFeature class and its derivates.
Class that defines a 2D point visual feature which is composed by two parameters that are the cartes...
static unsigned int selectX()
vpColVector error(const vpBasicFeature &s_star, unsigned int select=FEATURE_ALL) VP_OVERRIDE
void print(unsigned int select=FEATURE_ALL) const VP_OVERRIDE
static unsigned int selectY()
vpMatrix interaction(unsigned int select=FEATURE_ALL) VP_OVERRIDE
void track(const vpHomogeneousMatrix &cMo)
Implementation of an homogeneous matrix and operations on such kind of matrices.
Implementation of a matrix and operations on matrices.
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
double get_y() const
Get the point y coordinate in the image plane.
double get_x() const
Get the point x coordinate in the image plane.
void setWorldCoordinates(double oX, double oY, double oZ)