Visual Servoing Platform  version 3.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
vpPose.cpp
1 /****************************************************************************
2  *
3  * This file is part of the ViSP software.
4  * Copyright (C) 2005 - 2017 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * ("GPL") version 2 as published by the Free Software Foundation.
9  * See the file LICENSE.txt at the root directory of this source
10  * distribution for additional information about the GNU GPL.
11  *
12  * For using ViSP with software that can not be combined with the GNU
13  * GPL, please contact Inria about acquiring a ViSP Professional
14  * Edition License.
15  *
16  * See http://visp.inria.fr for more information.
17  *
18  * This software was developed at:
19  * Inria Rennes - Bretagne Atlantique
20  * Campus Universitaire de Beaulieu
21  * 35042 Rennes Cedex
22  * France
23  *
24  * If you have questions regarding the use of this file, please contact
25  * Inria at visp@inria.fr
26  *
27  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29  *
30  * Description:
31  * Pose computation.
32  *
33  * Authors:
34  * Eric Marchand
35  * Francois Chaumette
36  *
37  *****************************************************************************/
38 
39 
46 #include <visp3/vision/vpPose.h>
47 #include <visp3/core/vpDebug.h>
48 #include <visp3/core/vpException.h>
49 #include <visp3/vision/vpPoseException.h>
50 #include <visp3/core/vpMeterPixelConversion.h>
51 #include <visp3/core/vpCameraParameters.h>
52 #include <visp3/core/vpDisplay.h>
53 #include <visp3/core/vpMath.h>
54 
55 #include <cmath> // std::fabs
56 #include <limits> // numeric_limits
57 
58 #define DEBUG_LEVEL1 0
59 
62 void
64 {
65 #if (DEBUG_LEVEL1)
66  std::cout << "begin vpPose::Init() " << std::endl ;
67 #endif
68  npt = 0 ;
69  listP.clear();
70  c3d.clear();
71 
72  lambda = 0.25 ;
73 
74  vvsIterMax = 200 ;
75 
76  distanceToPlaneForCoplanarityTest = 0.001 ;
77 
78  computeCovariance = false;
79 
80  ransacMaxTrials = 1000;
81  ransacThreshold = 0.0001;
82  ransacNbInlierConsensus = 4;
83 
84  residual = 0;
85 #if (DEBUG_LEVEL1)
86  std::cout << "end vpPose::Init() " << std::endl ;
87 #endif
88 
89 }
90 
93  : npt(0), listP(), residual(0), lambda(0.25), vvsIterMax(200), c3d(),
94  computeCovariance(false), covarianceMatrix(),
95  ransacNbInlierConsensus(4), ransacMaxTrials(1000), ransacInliers(), ransacInlierIndex(), ransacThreshold(0.0001),
96  distanceToPlaneForCoplanarityTest(0.001), ransacFlags(PREFILTER_DUPLICATE_POINTS),
97  listOfPoints(), useParallelRansac(false), nbParallelRansacThreads(0) //0 means that OpenMP is used to get the number of CPU threads
98 {
99 #if (DEBUG_LEVEL1)
100  std::cout << "begin vpPose::vpPose() " << std::endl ;
101 #endif
102 
103  init() ;
104 
105 #if (DEBUG_LEVEL1)
106  std::cout << "end vpPose::vpPose() " << std::endl ;
107 #endif
108 
109 }
110 
115 {
116 #if (DEBUG_LEVEL1)
117  std::cout << "begin vpPose::~vpPose() " << std::endl ;
118 #endif
119 
120  listP.clear();
121 
122 #if (DEBUG_LEVEL1)
123  std::cout << "end vpPose::~vpPose() " << std::endl ;
124 #endif
125 }
129 void
131 {
132  listP.clear();
133  npt = 0 ;
134 }
135 
144 void
146 {
147  listP.push_back(newP);
148  listOfPoints.push_back(newP);
149  npt++ ;
150 }
151 
160 void
161 vpPose::addPoints(const std::vector<vpPoint> &lP) {
162  listP.insert(listP.end(), lP.begin(), lP.end());
163  listOfPoints.insert(listOfPoints.end(), lP.begin(), lP.end());
164  npt = (unsigned int) listP.size();
165 }
166 
167 void
169 {
170  distanceToPlaneForCoplanarityTest = d ;
171 }
172 
184 bool
185 vpPose::coplanar(int &coplanar_plane_type)
186 {
187  coplanar_plane_type = 0;
188  if (npt <2)
189  {
190  vpERROR_TRACE("Not enough point (%d) to compute the pose ",npt) ;
192  "Not enough points ")) ;
193  }
194 
195  if (npt ==3) return true ;
196 
197  double x1=0,x2=0,x3=0,y1=0,y2=0,y3=0,z1=0,z2=0,z3=0 ;
198 
199  std::list<vpPoint>::const_iterator it = listP.begin();
200 
201  vpPoint P1, P2, P3 ;
202 
203  // Get three 3D points that are not collinear and that is not at origin
204  bool degenerate = true;
205  bool not_on_origin = true;
206  std::list<vpPoint>::const_iterator it_tmp;
207 
208  std::list<vpPoint>::const_iterator it_i, it_j, it_k;
209  for (it_i=listP.begin(); it_i != listP.end(); ++it_i) {
210  if (degenerate == false) {
211  //std::cout << "Found a non degenerate configuration" << std::endl;
212  break;
213  }
214  P1 = *it_i;
215  // Test if point is on origin
216  if ((std::fabs(P1.get_oX()) <= std::numeric_limits<double>::epsilon())
217  && (std::fabs(P1.get_oY()) <= std::numeric_limits<double>::epsilon())
218  && (std::fabs(P1.get_oZ()) <= std::numeric_limits<double>::epsilon())) {
219  not_on_origin = false;
220  }
221  else {
222  not_on_origin = true;
223  }
224  if (not_on_origin) {
225  it_tmp = it_i; ++it_tmp; // j = i+1
226  for (it_j=it_tmp; it_j != listP.end(); ++it_j) {
227  if (degenerate == false) {
228  //std::cout << "Found a non degenerate configuration" << std::endl;
229  break;
230  }
231  P2 = *it_j;
232  if ((std::fabs(P2.get_oX()) <= std::numeric_limits<double>::epsilon())
233  && (std::fabs(P2.get_oY()) <= std::numeric_limits<double>::epsilon())
234  && (std::fabs(P2.get_oZ()) <= std::numeric_limits<double>::epsilon())) {
235  not_on_origin = false;
236  }
237  else {
238  not_on_origin = true;
239  }
240  if (not_on_origin) {
241  it_tmp = it_j; ++it_tmp; // k = j+1
242  for (it_k=it_tmp; it_k != listP.end(); ++it_k) {
243  P3 = *it_k;
244  if ((std::fabs(P3.get_oX()) <= std::numeric_limits<double>::epsilon())
245  && (std::fabs(P3.get_oY()) <= std::numeric_limits<double>::epsilon())
246  && (std::fabs(P3.get_oZ()) <= std::numeric_limits<double>::epsilon())) {
247  not_on_origin = false;
248  }
249  else {
250  not_on_origin = true;
251  }
252  if (not_on_origin) {
253  x1 = P1.get_oX() ;
254  x2 = P2.get_oX() ;
255  x3 = P3.get_oX() ;
256 
257  y1 = P1.get_oY() ;
258  y2 = P2.get_oY() ;
259  y3 = P3.get_oY() ;
260 
261  z1 = P1.get_oZ() ;
262  z2 = P2.get_oZ() ;
263  z3 = P3.get_oZ() ;
264 
265  vpColVector a_b(3), b_c(3), cross_prod;
266  a_b[0] = x1-x2; a_b[1] = y1-y2; a_b[2] = z1-z2;
267  b_c[0] = x2-x3; b_c[1] = y2-y3; b_c[2] = z2-z3;
268 
269  cross_prod = vpColVector::crossProd(a_b, b_c);
270  if (cross_prod.sumSquare() <= std::numeric_limits<double>::epsilon())
271  degenerate = true; // points are collinear
272  else
273  degenerate = false;
274  }
275  if (degenerate == false)
276  break;
277  }
278  }
279  }
280  }
281  }
282 
283  if (degenerate) {
284  coplanar_plane_type = 4; // points are collinear
285  return true;
286  }
287 
288  double a = y1*z2 - y1*z3 - y2*z1 + y2*z3 + y3*z1 - y3*z2 ;
289  double b = -x1*z2 + x1*z3 + x2*z1 - x2*z3 - x3*z1 + x3*z2 ;
290  double c = x1*y2 - x1*y3 - x2*y1 + x2*y3 + x3*y1 - x3*y2 ;
291  double d = -x1*y2*z3 + x1*y3*z2 +x2*y1*z3 - x2*y3*z1 - x3*y1*z2 + x3*y2*z1 ;
292 
293  //std::cout << "a=" << a << " b=" << b << " c=" << c << " d=" << d << std::endl;
294  if (std::fabs(b) <= std::numeric_limits<double>::epsilon()
295  && std::fabs(c) <= std::numeric_limits<double>::epsilon() ) {
296  coplanar_plane_type = 1; // ax=d
297  } else if (std::fabs(a) <= std::numeric_limits<double>::epsilon()
298  && std::fabs(c) <= std::numeric_limits<double>::epsilon() ) {
299  coplanar_plane_type = 2; // by=d
300  } else if (std::fabs(a) <= std::numeric_limits<double>::epsilon()
301  && std::fabs(b) <= std::numeric_limits<double>::epsilon() ) {
302  coplanar_plane_type = 3; // cz=d
303  }
304 
305  double D = sqrt(vpMath::sqr(a)+vpMath::sqr(b)+vpMath::sqr(c)) ;
306 
307  for(it=listP.begin(); it != listP.end(); ++it)
308  {
309  P1 = *it ;
310  double dist = (a*P1.get_oX() + b*P1.get_oY()+c*P1.get_oZ()+d)/D ;
311  //std::cout << "dist= " << dist << std::endl;
312 
313  if (fabs(dist) > distanceToPlaneForCoplanarityTest)
314  {
315  vpDEBUG_TRACE(10," points are not coplanar ") ;
316  // TRACE(" points are not coplanar ") ;
317  return false ;
318  }
319  }
320 
321  vpDEBUG_TRACE(10," points are coplanar ") ;
322  // vpTRACE(" points are coplanar ") ;
323 
324  return true ;
325 }
326 
336 double
338 {
339  double residual_ = 0 ;
340  vpPoint P ;
341  for(std::list<vpPoint>::const_iterator it=listP.begin(); it != listP.end(); ++it)
342  {
343  P = *it;
344  double x = P.get_x() ;
345  double y = P.get_y() ;
346 
347  P.track(cMo) ;
348 
349  residual_ += vpMath::sqr(x-P.get_x()) + vpMath::sqr(y-P.get_y()) ;
350  }
351  return residual_ ;
352 }
353 
354 
355 
371 bool
373 {
374  if (npt <4)
375  {
376  vpERROR_TRACE("Not enough point (%d) to compute the pose ",npt) ;
378  "No enough point ")) ;
379  }
380 
381  switch (method)
382  {
383  case DEMENTHON :
384  case DEMENTHON_VIRTUAL_VS :
385  case DEMENTHON_LOWE :
386  {
387  if (npt <4)
388  {
389  vpERROR_TRACE("Dementhon method cannot be used in that case ") ;
390  vpERROR_TRACE("(at least 4 points are required)") ;
391  vpERROR_TRACE("Not enough point (%d) to compute the pose ",npt) ;
393  "Not enough points ")) ;
394  }
395 
396  // test si les point 3D sont coplanaires
397  int coplanar_plane_type = 0;
398  bool plan = coplanar(coplanar_plane_type) ;
399  if (plan == true)
400  {
401  //std::cout << "Plan" << std::endl;
402  try{
403  poseDementhonPlan(cMo);
404  }
405  catch(...)
406  {
407 // vpERROR_TRACE(" ") ;
408  throw ;
409  }
410  //std::cout << "Fin Plan" << std::endl;
411  }
412  else
413  {
414  //std::cout << "No Plan" << std::endl;
415  try{
416  poseDementhonNonPlan(cMo) ;
417  }
418  catch(...)
419  {
420 // vpERROR_TRACE(" ") ;
421  throw ;
422  }
423  //std::cout << "Fin No Plan" << std::endl;
424  }
425  }
426  break ;
427  case LAGRANGE :
428  case LAGRANGE_VIRTUAL_VS :
429  case LAGRANGE_LOWE :
430  {
431  // test si les point 3D sont coplanaires
432  int coplanar_plane_type;
433  bool plan = coplanar(coplanar_plane_type) ;
434 
435  if (plan == true && coplanar_plane_type > 0) // only plane oX=d, oY=d or oZ=d
436  {
437 
438  if (coplanar_plane_type == 4)
439  {
440  vpERROR_TRACE("Lagrange method cannot be used in that case ") ;
441  vpERROR_TRACE("(points are collinear)") ;
443  "Points are collinear ")) ;
444  }
445  if (npt <4)
446  {
447  vpERROR_TRACE("Lagrange method cannot be used in that case ") ;
448  vpERROR_TRACE("(at least 4 points are required)") ;
449  vpERROR_TRACE("Not enough point (%d) to compute the pose ",npt) ;
451  "Not enough points ")) ;
452  }
453  try {
454  poseLagrangePlan(cMo, coplanar_plane_type);
455  }
456  catch(...)
457  {
458 // vpERROR_TRACE(" ") ;
459  throw ;
460  }
461  }
462  else
463  {
464  if (npt <4)
465  {
466  vpERROR_TRACE("Lagrange method cannot be used in that case ") ;
467  vpERROR_TRACE("(at least 4 points are required)") ;
468  vpERROR_TRACE("Not enough point (%d) to compute the pose ",npt) ;
470  "Not enough points ")) ;
471  }
472  try {
473  poseLagrangeNonPlan(cMo);
474  }
475  catch(...)
476  {
477 // vpERROR_TRACE(" ") ;
478  throw ;
479  }
480  }
481  }
482  break;
483  case RANSAC:
484  if (npt <4)
485  {
486  vpERROR_TRACE("Ransac method cannot be used in that case ") ;
487  vpERROR_TRACE("(at least 4 points are required)") ;
488  vpERROR_TRACE("Not enough point (%d) to compute the pose ",npt) ;
490  "Not enough points ")) ;
491  }
492  try {
493  return poseRansac(cMo, func);
494  }
495  catch(...)
496  {
497 // vpERROR_TRACE(" ") ;
498  throw ;
499  }
500  break;
501  case LOWE :
502  case VIRTUAL_VS:
503  break ;
504  }
505 
506  switch (method)
507  {
508  case LAGRANGE :
509  case DEMENTHON :
510  case RANSAC :
511  break ;
512  case VIRTUAL_VS:
513  case LAGRANGE_VIRTUAL_VS:
515  {
516  try
517  {
518  poseVirtualVS(cMo);
519  }
520  catch(...)
521  {
522 // vpERROR_TRACE(" ") ;
523  throw ;
524  }
525  }
526  break ;
527  case LOWE:
528  case LAGRANGE_LOWE:
529  case DEMENTHON_LOWE:
530  {
531  try
532  {
533  poseLowe(cMo);
534  }
535  catch(...)
536  {
537 // vpERROR_TRACE(" ") ;
538  throw ;
539  }
540  }
541  break ;
542  }
543 
544  //If here, there was no exception thrown so return true
545  return true;
546 }
547 
548 
549 
550 void
552 {
553  vpPoint P;
554  for(std::list<vpPoint>::const_iterator it=listP.begin(); it != listP.end(); ++it)
555  {
556  P = *it ;
557 
558  std::cout << "3D oP " << P.oP.t() ;
559  std::cout << "3D cP " << P.cP.t() ;
560  std::cout << "2D " << P.p.t() ;
561  }
562 }
563 
573 void
575  vpHomogeneousMatrix &cMo,
576  vpCameraParameters &cam,
577  double size,
578  vpColor col)
579 {
580  vpDisplay::displayFrame(I, cMo, cam, size, col);
581 }
582 
592 void
594  vpHomogeneousMatrix &cMo,
595  vpCameraParameters &cam,
596  double size,
597  vpColor col)
598 {
599  vpDisplay::displayFrame(I,cMo,cam, size,col);
600 }
601 
605 void
607  vpCameraParameters &cam,
608  vpColor col)
609 {
610  vpPoint P ;
611  vpImagePoint ip;
612  for(std::list<vpPoint>::const_iterator it=listP.begin(); it != listP.end(); ++it)
613  {
614  P = *it;
615  vpMeterPixelConversion::convertPoint(cam, P.p[0], P.p[1], ip) ;
616  vpDisplay::displayCross(I, ip, 5, col) ;
617  // std::cout << "3D oP " << P.oP.t() ;
618  // std::cout << "3D cP " << P.cP.t() ;
619  // std::cout << "2D " << P.p.t() ;
620  }
621 }
622 
626 void
628  vpCameraParameters &cam,
629  vpColor col)
630 {
631  vpPoint P ;
632  vpImagePoint ip;
633  for(std::list<vpPoint>::const_iterator it=listP.begin(); it != listP.end(); ++it)
634  {
635  P = *it;
636  vpMeterPixelConversion::convertPoint(cam, P.p[0], P.p[1], ip) ;
637  vpDisplay::displayCross(I, ip, 5, col) ;
638  // std::cout << "3D oP " << P.oP.t() ;
639  // std::cout << "3D cP " << P.cP.t() ;
640  // std::cout << "2D " << P.p.t() ;
641  }
642 }
643 
644 
664 double
666  vpPoint &p3,vpPoint &p4,
667  double lx, vpCameraParameters & cam,
668  vpHomogeneousMatrix & cMo)
669 {
670 
671  std::vector<double> rectx(4) ;
672  std::vector<double> recty(4) ;
673  rectx[0]= 0 ;
674  recty[0]=0 ;
675  rectx[1]=1 ;
676  recty[1]=0 ;
677  rectx[2]=1 ;
678  recty[2]=1 ;
679  rectx[3]=0 ;
680  recty[3]=1 ;
681  std::vector<double> irectx(4) ;
682  std::vector<double> irecty(4) ;
683  irectx[0]=(p1.get_x()) ;
684  irecty[0]=(p1.get_y()) ;
685  irectx[1]=(p2.get_x()) ;
686  irecty[1]=(p2.get_y()) ;
687  irectx[2]=(p3.get_x()) ;
688  irecty[2]=(p3.get_y()) ;
689  irectx[3]=(p4.get_x()) ;
690  irecty[3]=(p4.get_y()) ;
691 
692  //calcul de l'homographie
693  vpMatrix H(3,3);
694  vpHomography hom;
695 
696  // vpHomography::HartleyDLT(rectx,recty,irectx,irecty,hom);
697  vpHomography::HLM(rectx,recty,irectx,irecty,1,hom);
698  for (unsigned int i=0 ; i < 3 ; i++)
699  for(unsigned int j=0 ; j < 3 ; j++)
700  H[i][j] = hom[i][j] ;
701  //calcul de s = ||Kh1||/ ||Kh2|| =ratio (length on x axis/ length on y axis)
702  vpColVector kh1(3);
703  vpColVector kh2(3);
704  vpMatrix K(3,3);
705  K = cam.get_K();
706  K.eye();
707  vpMatrix Kinv =K.pseudoInverse();
708 
709  vpMatrix KinvH =Kinv*H;
710  kh1=KinvH.getCol(0);
711  kh2=KinvH.getCol(1);
712 
713  double s= sqrt(kh1.sumSquare())/sqrt(kh2.sumSquare());
714 
715  vpMatrix D(3,3);
716  D.eye();
717  D[1][1]=1/s;
718  vpMatrix cHo=H*D;
719 
720  //Calcul de la rotation et de la translation
721  // PoseFromRectangle(p1,p2,p3,p4,1/s,lx,cam,cMo );
722  p1.setWorldCoordinates(0,0,0) ;
723  p2.setWorldCoordinates(lx,0,0) ;
724  p3.setWorldCoordinates(lx,lx/s,0) ;
725  p4.setWorldCoordinates(0,lx/s,0) ;
726 
727 
728  vpPose P ;
729  P.addPoint(p1) ;
730  P.addPoint(p2) ;
731  P.addPoint(p3) ;
732  P.addPoint(p4) ;
733 
735  return lx/s ;
736 }
Implementation of a matrix and operations on matrices.
Definition: vpMatrix.h:97
virtual ~vpPose()
Definition: vpPose.cpp:114
double residual
Residual in meter.
Definition: vpPose.h:103
void poseLagrangePlan(vpHomogeneousMatrix &cMo, const int coplanar_plane_type=0)
Compute the pose of a planar object using Lagrange approach.
bool coplanar(int &coplanar_plane_type)
Definition: vpPose.cpp:185
Implementation of an homogeneous matrix and operations on such kind of matrices.
void poseLagrangeNonPlan(vpHomogeneousMatrix &cMo)
static void convertPoint(const vpCameraParameters &cam, const double &x, const double &y, double &u, double &v)
Point coordinates conversion from normalized coordinates in meter to pixel coordinates ...
#define vpERROR_TRACE
Definition: vpDebug.h:391
void init()
Definition: vpPose.cpp:63
Class to define colors available for display functionnalities.
Definition: vpColor.h:121
void displayModel(vpImage< unsigned char > &I, vpCameraParameters &cam, vpColor col=vpColor::none)
Definition: vpPose.cpp:606
void addPoints(const std::vector< vpPoint > &lP)
Definition: vpPose.cpp:161
double get_oY() const
Get the point Y coordinate in the object frame.
Definition: vpPoint.cpp:449
void track(const vpHomogeneousMatrix &cMo)
double get_y() const
Get the point y coordinate in the image plane.
Definition: vpPoint.cpp:458
std::list< vpPoint > listP
Array of point (use here class vpPoint)
Definition: vpPose.h:101
void poseVirtualVS(vpHomogeneousMatrix &cMo)
Compute the pose using virtual visual servoing approach.
Class that defines what is a point.
Definition: vpPoint.h:59
bool poseRansac(vpHomogeneousMatrix &cMo, bool(*func)(vpHomogeneousMatrix *)=NULL)
static void HLM(const std::vector< double > &xb, const std::vector< double > &yb, const std::vector< double > &xa, const std::vector< double > &ya, bool isplanar, vpHomography &aHb)
double lambda
parameters use for the virtual visual servoing approach
Definition: vpPose.h:106
vpColVector cP
Definition: vpTracker.h:77
Implementation of an homography and operations on homographies.
Definition: vpHomography.h:179
static void display(vpImage< unsigned char > &I, vpHomogeneousMatrix &cMo, vpCameraParameters &cam, double size, vpColor col=vpColor::none)
Definition: vpPose.cpp:574
static double poseFromRectangle(vpPoint &p1, vpPoint &p2, vpPoint &p3, vpPoint &p4, double lx, vpCameraParameters &cam, vpHomogeneousMatrix &cMo)
Carries out the camera pose the image of a rectangle and the intrinsec parameters, the length on x axis is known but the proprtion of the rectangle are unknown.
Definition: vpPose.cpp:665
static double sqr(double x)
Definition: vpMath.h:110
vpRowVector t() const
Class used for pose computation from N points (pose from point only). Some of the algorithms implemen...
Definition: vpPose.h:76
Generic class defining intrinsic camera parameters.
vpColVector getCol(const unsigned int j) const
Definition: vpMatrix.cpp:2235
double get_oZ() const
Get the point Z coordinate in the object frame.
Definition: vpPoint.cpp:451
void printPoint()
Definition: vpPose.cpp:551
void poseLowe(vpHomogeneousMatrix &cMo)
Compute the pose using the Lowe non linear approach it consider the minimization of a residual using ...
Definition: vpPoseLowe.cpp:278
bool computePose(vpPoseMethodType method, vpHomogeneousMatrix &cMo, bool(*func)(vpHomogeneousMatrix *)=NULL)
Definition: vpPose.cpp:372
double get_x() const
Get the point x coordinate in the image plane.
Definition: vpPoint.cpp:456
vpPose()
Definition: vpPose.cpp:92
unsigned int npt
Number of point used in pose computation.
Definition: vpPose.h:100
double sumSquare() const
double get_oX() const
Get the point X coordinate in the object frame.
Definition: vpPoint.cpp:447
static void displayFrame(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, double size, const vpColor &color=vpColor::none, unsigned int thickness=1, vpImagePoint offset=vpImagePoint(0, 0))
static void displayCross(const vpImage< unsigned char > &I, const vpImagePoint &ip, unsigned int size, const vpColor &color, unsigned int thickness=1)
vpMatrix get_K() const
void setWorldCoordinates(const double oX, const double oY, const double oZ)
Definition: vpPoint.cpp:111
void poseDementhonPlan(vpHomogeneousMatrix &cMo)
Compute the pose using Dementhon approach for planar objects this is a direct implementation of the a...
Error that can be emited by the vpPose class and its derivates.
void poseDementhonNonPlan(vpHomogeneousMatrix &cMo)
Compute the pose using Dementhon approach for non planar objects this is a direct implementation of t...
Implementation of column vector and the associated operations.
Definition: vpColVector.h:72
vpPoseMethodType
Methods that could be used to estimate the pose from points.
Definition: vpPose.h:80
#define vpDEBUG_TRACE
Definition: vpDebug.h:478
void setDistanceToPlaneForCoplanarityTest(double d)
Definition: vpPose.cpp:168
vpMatrix pseudoInverse(double svThreshold=1e-6) const
Compute the pseudo inverse of the matrix using the SVD.
Definition: vpMatrix.cpp:1741
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Definition: vpImagePoint.h:88
static vpColVector crossProd(const vpColVector &a, const vpColVector &b)
void addPoint(const vpPoint &P)
Definition: vpPose.cpp:145
void eye()
Definition: vpMatrix.cpp:194
vpColVector p
Definition: vpTracker.h:73
double computeResidual(const vpHomogeneousMatrix &cMo) const
Compute and return the residual expressed in meter for the pose matrix 'cMo'.
Definition: vpPose.cpp:337
void clearPoint()
Definition: vpPose.cpp:130