40 #include <visp3/tt/vpTemplateTrackerWarpAffine.h> 94 j2 = (1 + ParamM[0]) * j + ParamM[2] * i + ParamM[4];
95 i2 = ParamM[1] * j + (1 + ParamM[3]) * i + ParamM[5];
100 vXres[0] = (1.0 + ParamM[0]) * vX[0] + ParamM[2] * vX[1] + ParamM[4];
101 vXres[1] = ParamM[1] * vX[0] + (1.0 + ParamM[3]) * vX[1] + ParamM[5];
123 for (
unsigned int i = 0; i <
nbParam; i++) {
124 dW_[0][i] = (1. + ParamM[0]) * dwdp0[i] + ParamM[2] * dwdp0[i + nbParam];
125 dW_[1][i] = ParamM[1] * dwdp0[i] + (1. + ParamM[3]) * dwdp0[i + nbParam];
131 vXres[0] = (1 + ParamM[0]) * vX[0] + ParamM[2] * vX[1] + ParamM[4];
132 vXres[1] = ParamM[1] * vX[0] + (1 + ParamM[3]) * vX[1] + ParamM[5];
138 Trans[0] = ParamM[4];
139 Trans[1] = ParamM[5];
140 MWrap[0][0] = 1 + ParamM[0];
141 MWrap[0][1] = ParamM[2];
142 MWrap[1][0] = ParamM[1];
143 MWrap[1][1] = 1 + ParamM[3];
148 TransInv = -1 * MWrapInv * Trans;
150 ParamMinv[0] = MWrapInv[0][0] - 1;
151 ParamMinv[2] = MWrapInv[0][1];
152 ParamMinv[1] = MWrapInv[1][0];
153 ParamMinv[3] = MWrapInv[1][1] - 1;
154 ParamMinv[4] = TransInv[0];
155 ParamMinv[5] = TransInv[1];
164 MWrap1[0][0] = 1 + p1[0];
165 MWrap1[0][1] = p1[2];
166 MWrap1[1][0] = p1[1];
167 MWrap1[1][1] = 1 + p1[3];
173 MWrap2[0][0] = 1 + p2[0];
174 MWrap2[0][1] = p2[2];
175 MWrap2[1][0] = p2[1];
176 MWrap2[1][1] = 1 + p2[3];
180 TransRes = MWrap1 * Trans2 + Trans1;
181 MWrapRes = MWrap1 * MWrap2;
183 pres[0] = MWrapRes[0][0] - 1;
184 pres[2] = MWrapRes[0][1];
185 pres[1] = MWrapRes[1][0];
186 pres[3] = MWrapRes[1][1] - 1;
187 pres[4] = TransRes[0];
188 pres[5] = TransRes[1];
Implementation of a matrix and operations on matrices.
void resize(unsigned int nrows, unsigned int ncols, bool flagNullify=true, bool recopy_=true)
void getParamInverse(const vpColVector &ParamM, vpColVector &ParamMinv) const
void getParamPyramidUp(const vpColVector &p, vpColVector &pup)
vpMatrix inverseByLU() const
void pRondp(const vpColVector &p1, const vpColVector &p2, vpColVector &pres) const
void getParamPyramidDown(const vpColVector &p, vpColVector &pdown)
void getdW0(const int &i, const int &j, const double &dy, const double &dx, double *dIdW)
void getdWdp0(const int &i, const int &j, double *dIdW)
void dWarp(const vpColVector &X1, const vpColVector &X2, const vpColVector &ParamM, vpMatrix &dW)
Implementation of column vector and the associated operations.
void warpXInv(const vpColVector &vX, vpColVector &vXres, const vpColVector &ParamM)
void warpX(const vpColVector &vX, vpColVector &vXres, const vpColVector &ParamM)
vpTemplateTrackerWarpAffine()
void dWarpCompo(const vpColVector &X1, const vpColVector &X2, const vpColVector &ParamM, const double *dwdp0, vpMatrix &dW)