37#include <visp3/core/vpColVector.h>
38#include <visp3/core/vpConfig.h>
39#include <visp3/core/vpHomogeneousMatrix.h>
40#include <visp3/core/vpMatrix.h>
41#include <visp3/core/vpMatrixException.h>
42#include <visp3/core/vpTranslationVector.h>
57 double denom = (
static_cast<double>(A.
getRows()));
59 if (denom <= std::numeric_limits<double>::epsilon()) {
61 "Impossible to compute covariance matrix: not enough data");
64 double sigma2 = (b - (A * x)).
t() * (b - (A * x));
89 unsigned int w_cols = W.
getCols();
90 for (
unsigned int i = 0; i < w_cols; ++i) {
92 W2[i][i] = W[i][i] * W[i][i];
95 if (denom <= std::numeric_limits<double>::epsilon()) {
97 "Impossible to compute covariance matrix: not enough data");
102 double sigma2 = ((W * b) - (W * A * x)).
t() * ((W * b) - (W * A * x));
105 return (A.
t() * W2 * A).
pseudoInverse(A.
getCols() * std::numeric_limits<double>::epsilon()) * sigma2;
160 const unsigned int index_0 = 0;
161 const unsigned int index_1 = 1;
162 const unsigned int index_2 = 2;
163 LpInv[index_0][index_0] = -1.0;
164 LpInv[index_1][index_1] = -1.0;
165 LpInv[index_2][index_2] = -1.0;
169 cMo.extract(ctoInit);
176 const unsigned int val_3 = 3;
177 for (
unsigned int i = 0; i < val_3; ++i) {
181 double theta = sqrt(
tu.sumSquare());
188 LthetauInvAnalytic = -I3;
190 if ((theta / (2.0 * M_PI)) > std::numeric_limits<double>::epsilon()) {
192 vpColVector theta2u(3);
193 for (
unsigned int i = 0;
i < val_3; ++
i) {
194 theta2u[
i] =
tu[
i] / 2.0;
199 for (
unsigned int i = 0;
i < val_3; ++
i) {
200 u[
i] =
tu[
i] / theta;
204 LthetauInvAnalytic +=
210 ctoInitSkew = ctoInitSkew * LthetauInvAnalytic;
212 const unsigned int index_3 = 3;
213 for (
unsigned int a = 0; a < val_3; ++a) {
214 for (
unsigned int b = 0; b < val_3; ++b) {
215 LpInv[a][b + index_3] = ctoInitSkew[a][b];
219 for (
unsigned int a = 0; a < val_3; ++a) {
220 for (
unsigned int b = 0; b < val_3; ++b) {
221 LpInv[a + index_3][b + index_3] = LthetauInvAnalytic[a][b];
unsigned int getCols() const
unsigned int getRows() const
Implementation of column vector and the associated operations.
static vpMatrix skew(const vpColVector &v)
@ divideByZeroError
Division by zero.
Implementation of an homogeneous matrix and operations on such kind of matrices.
static double sinc(double x)
static double sqr(double x)
error that can be emitted by the vpMatrix class and its derivatives
Implementation of a matrix and operations on matrices.
static vpMatrix computeCovarianceMatrixVVS(const vpHomogeneousMatrix &cMo, const vpColVector &deltaS, const vpMatrix &Ls, const vpMatrix &W)
vpMatrix pseudoInverse(double svThreshold=1e-6) const
static vpMatrix computeCovarianceMatrix(const vpMatrix &A, const vpColVector &x, const vpColVector &b)
Implementation of a rotation vector as axis-angle minimal representation.
Class that consider the case of a translation vector.