47 #include <visp/vpPose.h>
48 #include <visp/vpPoint.h>
49 #include <visp/vpFeatureBuilder.h>
50 #include <visp/vpFeaturePoint.h>
51 #include <visp/vpExponentialMap.h>
52 #include <visp/vpRobust.h>
67 double residu_1 = 1e8 ;
74 unsigned int nb = (
unsigned int)
listP.size() ;
81 std::list<vpPoint> lP ;
85 for (std::list<vpPoint>::const_iterator it =
listP.begin(); it !=
listP.end(); ++it)
89 sd[2*k+1] = P.
get_y() ;
94 while((
int)((residu_1 - r)*1e12) !=0)
100 for (std::list<vpPoint>::const_iterator it = lP.begin(); it != lP.end(); ++it)
108 double x = s[2*k] = P.
get_x();
109 double y = s[2*k+1] = P.
get_y();
110 double Z = P.
get_Z() ;
115 L[2*k][4] = -(1+x*x) ;
121 L[2*k+1][3] = 1+y*y ;
143 if (iter++>vvsIterMax) break ;
146 if(computeCovariance)
169 double residu_1 = 1e8 ;
178 unsigned int nb = (
unsigned int)
listP.size() ;
186 std::list<vpPoint> lP ;
190 for (std::list<vpPoint>::const_iterator it =
listP.begin(); it !=
listP.end(); ++it)
193 sd[2*k_] = P.
get_x() ;
194 sd[2*k_+1] = P.
get_y() ;
204 while((
int)((residu_1 - r)*1e12) !=0)
210 for (std::list<vpPoint>::const_iterator it = lP.begin(); it != lP.end(); ++it)
218 double x = s[2*k_] = P.
get_x();
219 double y = s[2*k_+1] = P.
get_y();
220 double Z = P.
get_Z() ;
225 L[2*k_][4] = -(1+x*x) ;
229 L[2*k_+1][1] = -1/Z ;
231 L[2*k_+1][3] = 1+y*y ;
232 L[2*k_+1][4] = -x*y ;
243 for(
unsigned int k=0 ; k <error.
getRows()/2 ; k++)
251 for (
unsigned int k=0 ; k < error.
getRows()/2 ; k++)
254 W[2*k+1][2*k+1] = w[k] ;
258 (W*L).pseudoInverse(Lp,1e-6) ;
264 if (iter++>vvsIterMax) break ;
267 if(computeCovariance)
Definition of the vpMatrix class.
void resize(const unsigned int nrows, const unsigned int ncols, const bool nullify=true)
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 a robust virtual visual servoing approach
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
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.
double get_Z() const
Get the point Z coordinate in the camera frame.
Class that provides a data structure for the column vectors as well as a set of operations on these v...
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)
unsigned int getRows() const
Return the number of rows of the matrix.
void setIteration(const unsigned int iter)
Set iteration.
void resize(const unsigned int i, const bool flagNullify=true)