38 #include <visp3/core/vpConfig.h>
39 #include <visp3/core/vpHomogeneousMatrix.h>
40 #include <visp3/core/vpPoint.h>
41 #include <visp3/core/vpImage.h>
42 #include <visp3/core/vpCameraParameters.h>
43 #include <visp3/vision/vpPoseFeatures.h>
44 #include <visp3/vision/vpPose.h>
47 #include <visp3/vision/vpPose.h>
57 #ifndef DOXYGEN_SHOULD_SKIP_THIS
58 #ifdef VISP_HAVE_CPP11_COMPATIBILITY
59 class vp_createPointClass{
63 vp_createPointClass() : value(0){}
90 std::cout <<
"Reference pose used to create the visual features : " << std::endl;
91 std::cout << pose_ref.
t() << std::endl;
95 std::vector<vpPoint> pts;
101 pts.push_back(
vpPoint(0.0,-val,val2) );
102 pts.push_back(
vpPoint(0.0,val,val2) );
103 pts.push_back(
vpPoint(-val,val,val2) );
106 pts.push_back(
vpPoint(-val,-val/2.0,val2) );
107 pts.push_back(
vpPoint(val,val/2.0,val2) );
110 pts.push_back(
vpPoint(0.0,0.0,-1.5) );
130 pts[0].project(cMo_ref);
131 pts[1].project(cMo_ref);
132 pts[2].project(cMo_ref);
134 pts[3].project(cMo_ref);
135 pts[4].project(cMo_ref);
137 pts[5].project(cMo_ref);
160 #ifdef VISP_HAVE_CPP11_COMPATIBILITY
165 vp_createPointClass cpClass;
166 int (vp_createPointClass::*ptrClass)(
vpFeaturePoint&,
const vpPoint&) = &vp_createPointClass::vp_createPoint;
179 std::cout <<
"\nPose used as initialisation of the pose computation : " << std::endl;
180 std::cout << pose_est.
t() << std::endl;
186 std::cout <<
"\nEstimated pose from visual features : " << std::endl;
188 std::cout << pose_est.
t() << std::endl;
190 std::cout <<
"\nResulting covariance (Diag): " << std::endl;
192 std::cout << covariance[0][0] <<
" " << covariance[1][1] <<
" "
193 << covariance[2][2] <<
" " << covariance[3][3] <<
" "
194 << covariance[4][4] <<
" " << covariance[5][5] <<
" " << std::endl;
197 for(
unsigned int i=0; i<6; i++) {
198 if (std::fabs(pose_ref[i]-pose_est[i]) > 0.001)
202 std::cout <<
"\nPose is " << (test_fail ?
"badly" :
"well") <<
" estimated" << std::endl;
207 std::cout <<
"Catch an exception: " << e << std::endl;
Implementation of a matrix and operations on matrices.
void setVerbose(const bool &mode)
void setVVSIterMax(const unsigned int &val)
Implementation of an homogeneous matrix and operations on such kind of matrices.
void setWorldCoordinates(const double &A1, const double &B1, const double &C1, const double &D1, const double &A2, const double &B2, const double &C2, const double &D2)
error that can be emited by ViSP classes.
Class that defines a 2D point visual feature which is composed by two parameters that are the cartes...
void addFeatureVanishingPoint(const vpPoint &)
void setLambda(const double &val)
void addFeaturePoint3D(const vpPoint &)
void addFeaturePoint(const vpPoint &)
Class that defines what is a point.
void addFeatureEllipse(const vpCircle &)
void computePose(vpHomogeneousMatrix &cMo, const vpPoseFeaturesMethodType &type=VIRTUAL_VS)
Class that defines a line in the object frame, the camera frame and the image plane. All the parameters must be set in meter.
Class that defines a 2D segment visual features. This class allow to consider two sets of visual feat...
Class that defines a 2D line visual feature which is composed by two parameters that are and ...
static double rad(double deg)
void setCovarianceComputation(const bool &flag)
vpMatrix getCovarianceMatrix() const
Implementation of a pose vector and operations on poses.
void addSpecificFeature(RetType(*fct_ptr)(ArgsFunc...), Args &&...args)
vpPoseVector buildFrom(const double tx, const double ty, const double tz, const double tux, const double tuy, const double tuz)
static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot &d)
Tools for pose computation from any feature.This class allows to estimate a pose by virtual visual se...
Class that defines what is a circle.
void setWorldCoordinates(const vpColVector &oP)