39 #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];
101 vXres[0]=(1.0+ParamM[0])*vX[0]+ParamM[2]*vX[1]+ParamM[4];
102 vXres[1]=ParamM[1]*vX[0]+(1.0+ParamM[3])*vX[1]+ParamM[5];
110 dW_[0][0]=j;dW_[0][2]=i;dW_[0][4]=1;
111 dW_[1][1]=j;dW_[1][3]=i;dW_[1][5]=1;
119 for(
unsigned int i=0;i<
nbParam;i++)
121 dW_[0][i]=(1.+ParamM[0])*dwdp0[i]+ParamM[2]*dwdp0[i+nbParam];
122 dW_[1][i]=ParamM[1]*dwdp0[i]+(1.+ParamM[3])*dwdp0[i+nbParam];
128 vXres[0]=(1+ParamM[0])*vX[0]+ParamM[2]*vX[1]+ParamM[4];
129 vXres[1]=ParamM[1]*vX[0]+(1+ParamM[3])*vX[1]+ParamM[5];
135 Trans[0]=ParamM[4];Trans[1]=ParamM[5];
136 MWrap[0][0]=1+ParamM[0];MWrap[0][1]=ParamM[2];
137 MWrap[1][0]=ParamM[1];MWrap[1][1]=1+ParamM[3];
140 vpColVector TransInv(2);TransInv=-1*MWrapInv*Trans;
142 ParamMinv[0]=MWrapInv[0][0]-1;ParamMinv[2]=MWrapInv[0][1];
143 ParamMinv[1]=MWrapInv[1][0];ParamMinv[3]=MWrapInv[1][1]-1;
144 ParamMinv[4]=TransInv[0];ParamMinv[5]=TransInv[1];
151 Trans1[0]=p1[4];Trans1[1]=p1[5];
152 MWrap1[0][0]=1+p1[0];MWrap1[0][1]=p1[2];
153 MWrap1[1][0]=p1[1];MWrap1[1][1]=1+p1[3];
157 Trans2[0]=p2[4];Trans2[1]=p2[5];
158 MWrap2[0][0]=1+p2[0];MWrap2[0][1]=p2[2];
159 MWrap2[1][0]=p2[1];MWrap2[1][1]=1+p2[3];
163 TransRes=MWrap1*Trans2+Trans1;
164 MWrapRes=MWrap1*MWrap2;
166 pres[0]=MWrapRes[0][0]-1;pres[2]=MWrapRes[0][1];
167 pres[1]=MWrapRes[1][0];pres[3]=MWrapRes[1][1]-1;
168 pres[4]=TransRes[0];pres[5]=TransRes[1];
Implementation of a matrix and operations on matrices.
void resize(const unsigned int nrows, const unsigned int ncols, const bool flagNullify=true)
void getParamPyramidUp(const vpColVector &p, vpColVector &pup)
void getParamPyramidDown(const vpColVector &p, vpColVector &pdown)
void getParamInverse(const vpColVector &ParamM, vpColVector &ParamMinv) const
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 pRondp(const vpColVector &p1, const vpColVector &p2, vpColVector &pres) const
void dWarp(const vpColVector &X1, const vpColVector &X2, const vpColVector &ParamM, vpMatrix &dW)
Implementation of column vector and the associated operations.
vpMatrix inverseByLU() const
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)