43 #include <visp3/vision/vpPose.h>
44 #include <visp3/core/vpPoint.h>
45 #include <visp3/core/vpExponentialMap.h>
46 #include <visp3/core/vpRobust.h>
61 double residu_1 = 1e8 ;
68 unsigned int nb = (
unsigned int)
listP.size() ;
75 std::list<vpPoint> lP ;
79 for (std::list<vpPoint>::const_iterator it =
listP.begin(); it !=
listP.end(); ++it)
83 sd[2*k+1] = P.
get_y() ;
90 while(std::fabs((residu_1 - r)*1e12) > std::numeric_limits<double>::epsilon())
96 for (std::list<vpPoint>::const_iterator it = lP.begin(); it != lP.end(); ++it)
104 double x = s[2*k] = P.
get_x();
105 double y = s[2*k+1] = P.
get_y();
106 double Z = P.
get_Z() ;
111 L[2*k][4] = -(1+x*x) ;
117 L[2*k+1][3] = 1+y*y ;
140 if (iter++>vvsIterMax) break ;
143 if(computeCovariance)
166 double residu_1 = 1e8 ;
175 unsigned int nb = (
unsigned int)
listP.size() ;
183 std::list<vpPoint> lP ;
187 for (std::list<vpPoint>::const_iterator it =
listP.begin(); it !=
listP.end(); ++it)
190 sd[2*k_] = P.
get_x() ;
191 sd[2*k_+1] = P.
get_y() ;
202 while(std::fabs((residu_1 - r)*1e12) > std::numeric_limits<double>::epsilon())
208 for (std::list<vpPoint>::const_iterator it = lP.begin(); it != lP.end(); ++it)
216 double x = s[2*k_] = P.
get_x();
217 double y = s[2*k_+1] = P.
get_y();
218 double Z = P.
get_Z() ;
223 L[2*k_][4] = -(1+x*x) ;
227 L[2*k_+1][1] = -1/Z ;
229 L[2*k_+1][3] = 1+y*y ;
230 L[2*k_+1][4] = -x*y ;
241 for(
unsigned int k=0 ; k <error.
getRows()/2 ; k++)
249 for (
unsigned int k=0 ; k < error.
getRows()/2 ; k++)
252 W[2*k+1][2*k+1] = w[k] ;
256 (W*L).pseudoInverse(Lp,1e-6) ;
262 if (iter++>vvsIterMax) break ;
265 if(computeCovariance)
Implementation of a matrix and operations on matrices.
static vpMatrix computeCovarianceMatrixVVS(const vpHomogeneousMatrix &cMo, const vpColVector &deltaS, const vpMatrix &Ls, const vpMatrix &W)
void MEstimator(const vpRobustEstimatorType method, const vpColVector &residues, vpColVector &weights)
Compute the weights according a residue vector and a PsiFunction.
void poseVirtualVSrobust(vpHomogeneousMatrix &cMo)
Compute the pose using virtual visual servoing approach and a robust control law. ...
void resize(const unsigned int nrows, const unsigned int ncols, const bool flagNullify=true)
Implementation of an homogeneous matrix and operations on such kind of matrices.
void track(const vpHomogeneousMatrix &cMo)
double get_y() const
Get the point y coordinate in the image plane.
std::list< vpPoint > listP
Array of point (use here class vpPoint)
static vpMatrix computeCovarianceMatrix(const vpMatrix &A, const vpColVector &x, const vpColVector &b)
void poseVirtualVS(vpHomogeneousMatrix &cMo)
Compute the pose using virtual visual servoing approach.
Class that defines what is a point.
double lambda
parameters use for the virtual visual servoing approach
static double sqr(double x)
double get_x() const
Get the point x coordinate in the image plane.
unsigned int getRows() const
Return the number of rows of the 2D array.
double get_Z() const
Get the point Z coordinate in the camera frame.
Implementation of column vector and the associated operations.
vpHomogeneousMatrix inverse() const
static vpHomogeneousMatrix direct(const vpColVector &v)
Contains an M-Estimator and various influence function.
vpMatrix pseudoInverse(double svThreshold=1e-6) const
Compute the pseudo inverse of the matrix using the SVD.
void setThreshold(const double noise_threshold)
void setIteration(const unsigned int iter)
Set iteration.
void resize(const unsigned int i, const bool flagNullify=true)