39 #include <visp3/tt/vpTemplateTrackerWarpAffine.h>
58 p_down[4] = p[4] / 2.;
59 p_down[5] = p[5] / 2.;
135 u2 = (1 + p[0]) * u1 + p[2] * v1 + p[4];
136 v2 = p[1] * u1 + (1 + p[3]) * v1 + p[5];
148 X2[0] = (1.0 + p[0]) * X1[0] + p[2] * X1[1] + p[4];
149 X2[1] = p[1] * X1[0] + (1.0 + p[3]) * X1[1] + p[5];
190 for (
unsigned int i = 0; i <
nbParam; i++) {
191 dM[0][i] = (1. + p[0]) * dwdp0[i] + p[2] * dwdp0[i +
nbParam];
192 dM[1][i] = p[1] * dwdp0[i] + (1. + p[3]) * dwdp0[i +
nbParam];
205 X2[0] = (1 + p[0]) * X1[0] + p[2] * X1[1] + p[4];
206 X2[1] = p[1] * X1[0] + (1 + p[3]) * X1[1] + p[5];
219 double r_00 = 1 + p[0], r_01 = p[2];
220 double r_10 = p[1], r_11 = 1 + p[3];
221 double det = r_00 * r_11 - r_01 * r_10;
222 if (std::fabs(det) < std::numeric_limits<double>::epsilon()) {
224 "cannot inverse 2-by-2 matrix. Matrix determinant is 0."));
227 double ri_11 = r_00 / det;
228 double ri_00 = r_11 / det;
229 double ri_01 = -r_01 / det;
230 double ri_10 = -r_10 / det;
232 p_inv[0] = ri_00 - 1;
235 p_inv[3] = ri_11 - 1;
236 p_inv[4] = -(ri_00 * u + ri_01 * v);
237 p_inv[5] = -(ri_10 * u + ri_11 * v);
250 double r1_00 = 1 + p1[0], r1_01 = p1[2];
251 double r1_10 = p1[1], r1_11 = 1 + p1[3];
252 double r2_00 = 1 + p2[0], r2_01 = p2[2];
253 double r2_10 = p2[1], r2_11 = 1 + p2[3];
259 p12[0] = r1_00 * r2_00 + r1_01 * r2_10 - 1.;
260 p12[1] = r1_10 * r2_00 + r1_11 * r2_10;
261 p12[2] = r1_00 * r2_01 + r1_01 * r2_11;
262 p12[3] = r1_10 * r2_01 + r1_11 * r2_11 - 1.;
263 p12[4] = r1_00 * u2 + r1_01 * v2 + u1;
264 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)
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)
vpTemplateTrackerWarpAffine()
unsigned int nbParam
Number of parameters used to model warp transformation.