44 #include <visp3/core/vpExponentialMap.h> 45 #include <visp3/core/vpPoint.h> 46 #include <visp3/core/vpRobust.h> 47 #include <visp3/vision/vpPose.h> 60 double residu_1 = 1e8;
67 unsigned int nb = (
unsigned int)
listP.size();
74 std::list<vpPoint> lP;
78 for (std::list<vpPoint>::const_iterator it =
listP.begin(); it !=
listP.end(); ++it) {
80 sd[2 * k] = P.
get_x();
81 sd[2 * k + 1] = P.
get_y();
90 while (std::fabs(residu_1 - r) > vvsEpsilon) {
95 for (std::list<vpPoint>::const_iterator it = lP.begin(); it != lP.end(); ++it) {
102 double x = s[2 * k] = P.
get_x();
103 double y = s[2 * k + 1] = P.
get_y();
104 double Z = P.
get_Z();
105 L[2 * k][0] = -1 / Z;
109 L[2 * k][4] = -(1 + x * x);
113 L[2 * k + 1][1] = -1 / Z;
114 L[2 * k + 1][2] = y / Z;
115 L[2 * k + 1][3] = 1 + y * y;
116 L[2 * k + 1][4] = -x * y;
117 L[2 * k + 1][5] = -x;
139 if (iter++ > vvsIterMax) {
144 if (computeCovariance)
165 double residu_1 = 1e8;
174 unsigned int nb = (
unsigned int)
listP.size();
181 std::list<vpPoint> lP;
185 for (std::list<vpPoint>::const_iterator it =
listP.begin(); it !=
listP.end(); ++it) {
187 sd[2 * k_] = P.
get_x();
188 sd[2 * k_ + 1] = P.
get_y();
199 while (std::fabs((residu_1 - r) * 1e12) > std::numeric_limits<double>::epsilon()) {
204 for (std::list<vpPoint>::const_iterator it = lP.begin(); it != lP.end(); ++it) {
211 double x = s[2 * k_] = P.
get_x();
212 double y = s[2 * k_ + 1] = P.
get_y();
213 double Z = P.
get_Z();
214 L[2 * k_][0] = -1 / Z;
216 L[2 * k_][2] = x / Z;
217 L[2 * k_][3] = x * y;
218 L[2 * k_][4] = -(1 + x * x);
221 L[2 * k_ + 1][0] = 0;
222 L[2 * k_ + 1][1] = -1 / Z;
223 L[2 * k_ + 1][2] = y / Z;
224 L[2 * k_ + 1][3] = 1 + y * y;
225 L[2 * k_ + 1][4] = -x * y;
226 L[2 * k_ + 1][5] = -x;
235 for (
unsigned int k = 0; k < error.
getRows() / 2; k++) {
241 for (
unsigned int k = 0; k < error.
getRows() / 2; k++) {
242 W[2 * k][2 * k] = w[k];
243 W[2 * k + 1][2 * k + 1] = w[k];
247 (W * L).pseudoInverse(Lp, 1e-6);
250 v = -
lambda * Lp * W * error;
253 if (iter++ > vvsIterMax)
257 if (computeCovariance)
Implementation of a matrix and operations on matrices.
vpMatrix pseudoInverse(double svThreshold=1e-6) const
void resize(unsigned int nrows, unsigned int ncols, bool flagNullify=true, bool recopy_=true)
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)
void poseVirtualVSrobust(vpHomogeneousMatrix &cMo)
Compute the pose using virtual visual servoing approach and a robust control law. ...
Implementation of an homogeneous matrix and operations on such kind of matrices.
unsigned int getRows() const
void track(const vpHomogeneousMatrix &cMo)
vpHomogeneousMatrix inverse() const
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 a 3D point in the object frame and allows forward projection of a 3D point in the ...
double lambda
parameters use for the virtual visual servoing approach
static double sqr(double x)
void resize(unsigned int i, bool flagNullify=true)
Implementation of column vector and the associated operations.
double get_x() const
Get the point x coordinate in the image plane.
static vpHomogeneousMatrix direct(const vpColVector &v)
double get_y() const
Get the point y coordinate in the image plane.
Contains an M-estimator and various influence function.
Tukey influence function.
void setMinMedianAbsoluteDeviation(double mad_min)
double get_Z() const
Get the point cZ coordinate in the camera frame.