42 #include <visp/vpTemplateTrackerWarpAffine.h>
97 j2=(1+ParamM[0])*j+ParamM[2]*i+ParamM[4];
98 i2=ParamM[1]*j+(1+ParamM[3])*i+ParamM[5];
104 vXres[0]=(1.0+ParamM[0])*vX[0]+ParamM[2]*vX[1]+ParamM[4];
105 vXres[1]=ParamM[1]*vX[0]+(1.0+ParamM[3])*vX[1]+ParamM[5];
113 dW_[0][0]=j;dW_[0][2]=i;dW_[0][4]=1;
114 dW_[1][1]=j;dW_[1][3]=i;dW_[1][5]=1;
122 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];Trans[1]=ParamM[5];
139 MWrap[0][0]=1+ParamM[0];MWrap[0][1]=ParamM[2];
140 MWrap[1][0]=ParamM[1];MWrap[1][1]=1+ParamM[3];
143 vpColVector TransInv(2);TransInv=-1*MWrapInv*Trans;
145 ParamMinv[0]=MWrapInv[0][0]-1;ParamMinv[2]=MWrapInv[0][1];
146 ParamMinv[1]=MWrapInv[1][0];ParamMinv[3]=MWrapInv[1][1]-1;
147 ParamMinv[4]=TransInv[0];ParamMinv[5]=TransInv[1];
154 Trans1[0]=p1[4];Trans1[1]=p1[5];
155 MWrap1[0][0]=1+p1[0];MWrap1[0][1]=p1[2];
156 MWrap1[1][0]=p1[1];MWrap1[1][1]=1+p1[3];
160 Trans2[0]=p2[4];Trans2[1]=p2[5];
161 MWrap2[0][0]=1+p2[0];MWrap2[0][1]=p2[2];
162 MWrap2[1][0]=p2[1];MWrap2[1][1]=1+p2[3];
166 TransRes=MWrap1*Trans2+Trans1;
167 MWrapRes=MWrap1*MWrap2;
169 pres[0]=MWrapRes[0][0]-1;pres[2]=MWrapRes[0][1];
170 pres[1]=MWrapRes[1][0];pres[3]=MWrapRes[1][1]-1;
171 pres[4]=TransRes[0];pres[5]=TransRes[1];
Definition of the vpMatrix class.
void resize(const unsigned int nrows, const unsigned int ncols, const bool nullify=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)
Class that provides a data structure for the column vectors as well as a set of operations on these v...
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)