Performs various tests on the the point class.
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(
"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;
std::cout << point.
get_x() <<
" " << point.
get_y() << std::endl;
std::cout << "------------------------------------------------------" << std::endl;
vpTRACE(
"test the interaction matrix ");
L = p.interaction();
std::cout << L << std::endl;
vpTRACE(
"test the interaction matrix select");
std::cout << L << std::endl;
std::cout << L << std::endl;
std::cout << L << std::endl;
std::cout << L << std::endl;
std::cout << "------------------------------------------------------" << std::endl;
try {
std::cout << std::endl;
e = p.error(pd);
std::cout << e << std::endl;
vpTRACE(
"test the interaction matrix select");
std::cout << e << std::endl;
std::cout << e << std::endl;
std::cout << e << std::endl;
std::cout << e << std::endl;
}
std::cout << me << std::endl;
}
std::cout << me << std::endl;
}
std::cout << "------------------------------------------------------" << std::endl;
unsigned int dim;
dim = p.getDimension();
std::cout << "Dimension = " << dim << std::endl;
vpTRACE(
"test the dimension with select");
std::cout << "Dimension = " << dim << std::endl;
std::cout << "Dimension = " << dim << std::endl;
std::cout << "Dimension = " << dim << std::endl;
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.
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 vpDot &d)
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()
void print(unsigned int select=FEATURE_ALL) const VP_OVERRIDE
static unsigned int selectY()
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)