39 #include <visp3/tt/vpTemplateTrackerWarpAffine.h>
59 p_down[4] = p[4] / 2.;
60 p_down[5] = p[5] / 2.;
136 u2 = (1 + p[0]) * u1 + p[2] * v1 + p[4];
137 v2 = p[1] * u1 + (1 + p[3]) * v1 + p[5];
149 X2[0] = (1.0 + p[0]) * X1[0] + p[2] * X1[1] + p[4];
150 X2[1] = p[1] * X1[0] + (1.0 + p[3]) * X1[1] + p[5];
191 for (
unsigned int i = 0; i <
nbParam; i++) {
192 dM[0][i] = (1. + p[0]) * dwdp0[i] + p[2] * dwdp0[i +
nbParam];
193 dM[1][i] = p[1] * dwdp0[i] + (1. + p[3]) * dwdp0[i +
nbParam];
206 X2[0] = (1 + p[0]) * X1[0] + p[2] * X1[1] + p[4];
207 X2[1] = p[1] * X1[0] + (1 + p[3]) * X1[1] + p[5];
220 double r_00 = 1 + p[0], r_01 = p[2];
221 double r_10 = p[1], r_11 = 1 + p[3];
222 double det = r_00 * r_11 - r_01 * r_10;
223 if (std::fabs(det) < std::numeric_limits<double>::epsilon()) {
225 "cannot inverse 2-by-2 matrix. Matrix determinant is 0."));
228 double ri_11 = r_00 / det;
229 double ri_00 = r_11 / det;
230 double ri_01 = -r_01 / det;
231 double ri_10 = -r_10 / det;
233 p_inv[0] = ri_00 - 1;
236 p_inv[3] = ri_11 - 1;
237 p_inv[4] = -(ri_00 * u + ri_01 * v);
238 p_inv[5] = -(ri_10 * u + ri_11 * v);
251 double r1_00 = 1 + p1[0], r1_01 = p1[2];
252 double r1_10 = p1[1], r1_11 = 1 + p1[3];
253 double r2_00 = 1 + p2[0], r2_01 = p2[2];
254 double r2_10 = p2[1], r2_11 = 1 + p2[3];
260 p12[0] = r1_00 * r2_00 + r1_01 * r2_10 - 1.;
261 p12[1] = r1_10 * r2_00 + r1_11 * r2_10;
262 p12[2] = r1_00 * r2_01 + r1_01 * r2_11;
263 p12[3] = r1_10 * r2_01 + r1_11 * r2_11 - 1.;
264 p12[4] = r1_00 * u2 + r1_01 * v2 + u1;
265 p12[5] = r1_10 * u2 + r1_11 * v2 + v1;
Implementation of column vector and the associated operations.
error that can be emitted by ViSP classes.
Implementation of a matrix and operations on matrices.
void pRondp(const vpColVector &p1, const vpColVector &p2, vpColVector &p12) const
void getParamPyramidDown(const vpColVector &p, vpColVector &p_down)
void getdW0(const int &v, const int &u, const double &dv, const double &du, double *dIdW)
void warpX(const vpColVector &X1, vpColVector &X2, const vpColVector &p)
vpTemplateTrackerWarpAffine()
void getParamInverse(const vpColVector &p, vpColVector &p_inv) const
void dWarp(const vpColVector &X, const vpColVector &, const vpColVector &, vpMatrix &dM)
void getParamPyramidUp(const vpColVector &p, vpColVector &p_up)
void warpXInv(const vpColVector &X1, vpColVector &X2, const vpColVector &p)
void dWarpCompo(const vpColVector &, const vpColVector &, const vpColVector &p, const double *dwdp0, vpMatrix &dM)
void getdWdp0(const int &v, const int &u, double *dIdW)
unsigned int nbParam
Number of parameters used to model warp transformation.