40 #include <visp3/tt/vpTemplateTrackerWarpAffine.h> 62 p_down[4] = p[4] / 2.;
63 p_down[5] = p[5] / 2.;
139 u2 = (1 + p[0]) * u1 + p[2] * v1 + p[4];
140 v2 = p[1] * u1 + (1 + p[3]) * v1 + p[5];
152 X2[0] = (1.0 + p[0]) * X1[0] + p[2] * X1[1] + p[4];
153 X2[1] = p[1] * X1[0] + (1.0 + p[3]) * X1[1] + p[5];
194 for (
unsigned int i = 0; i <
nbParam; i++) {
195 dM[0][i] = (1. + p[0]) * dwdp0[i] + p[2] * dwdp0[i + nbParam];
196 dM[1][i] = p[1] * dwdp0[i] + (1. + p[3]) * dwdp0[i + nbParam];
209 X2[0] = (1 + p[0]) * X1[0] + p[2] * X1[1] + p[4];
210 X2[1] = p[1] * X1[0] + (1 + p[3]) * X1[1] + p[5];
223 double r_00 = 1 + p[0], r_01 = p[2];
224 double r_10 = p[1], r_11 = 1 + p[3];
225 double det = r_00 * r_11 - r_01 * r_10;
226 if (std::fabs(det) < std::numeric_limits<double>::epsilon()) {
228 "In vpTemplateTrackerWarpAffine::getParamInverse() " 229 "cannot inverse 2-by-2 matrix. Matrix determinant is 0."));
232 double ri_11 = r_00 / det;
233 double ri_00 = r_11 / det;
234 double ri_01 = -r_01 / det;
235 double ri_10 = -r_10 / det;
237 p_inv[0] = ri_00 - 1;
240 p_inv[3] = ri_11 - 1;
241 p_inv[4] = -(ri_00 * u + ri_01 * v);
242 p_inv[5] = -(ri_10 * u + ri_11 * v);
255 double r1_00 = 1 + p1[0], r1_01 = p1[2];
256 double r1_10 = p1[1], r1_11 = 1 + p1[3];
257 double r2_00 = 1 + p2[0], r2_01 = p2[2];
258 double r2_10 = p2[1], r2_11 = 1 + p2[3];
264 p12[0] = r1_00 * r2_00 + r1_01 * r2_10 - 1.;
265 p12[1] = r1_10 * r2_00 + r1_11 * r2_10;
266 p12[2] = r1_00 * r2_01 + r1_01 * r2_11;
267 p12[3] = r1_10 * r2_01 + r1_11 * r2_11 - 1.;
268 p12[4] = r1_00 * u2 + r1_01 * v2 + u1;
269 p12[5] = r1_10 * u2 + r1_11 * v2 + v1;
Implementation of a matrix and operations on matrices.
void getParamPyramidDown(const vpColVector &p, vpColVector &p_down)
error that can be emited by ViSP classes.
void warpXInv(const vpColVector &X1, vpColVector &X2, const vpColVector &p)
void warpX(const vpColVector &X1, vpColVector &X2, const vpColVector &p)
void getParamInverse(const vpColVector &p, vpColVector &p_inv) const
void dWarp(const vpColVector &X, const vpColVector &, const vpColVector &, vpMatrix &dM)
void dWarpCompo(const vpColVector &, const vpColVector &, const vpColVector &p, const double *dwdp0, vpMatrix &dM)
void getdW0(const int &v, const int &u, const double &dv, const double &du, double *dIdW)
void getParamPyramidUp(const vpColVector &p, vpColVector &p_up)
Implementation of column vector and the associated operations.
void pRondp(const vpColVector &p1, const vpColVector &p2, vpColVector &p12) const
void getdWdp0(const int &v, const int &u, double *dIdW)
vpTemplateTrackerWarpAffine()
unsigned int nbParam
Number of parameters used to model warp transformation.