39 #include <visp3/tt/vpTemplateTrackerWarpHomography.h>
40 #include <visp3/core/vpTrackingException.h>
72 dIdW[2]=-j*j*dx-i*j*dy;
75 dIdW[5]=-i*j*dx-i*i*dy;
102 denom=(1./(ParamM[2]*vX[0]+ParamM[5]*vX[1]+1.));
107 j2=((1.+ParamM[0])*j+ParamM[3]*i+ParamM[6])*
denom;
108 i2=(ParamM[1]*j+(1.+ParamM[4])*i+ParamM[7])*
denom;
117 vXres[0]=((1+ParamM[0])*vX[0]+ParamM[3]*vX[1]+ParamM[6])*
denom;
118 vXres[1]=(ParamM[1]*vX[0]+(1+ParamM[4])*vX[1]+ParamM[7])*
denom;
130 dW_[0][2]=-j*X2[0]*
denom;
132 dW_[0][5]=-i*X2[0]*
denom;
136 dW_[1][2]=-j*X2[1]*
denom;
138 dW_[1][5]=-i*X2[1]*
denom;
149 dwdx0=((1.+ParamM[0])-X2[0]*ParamM[2])*
denom;
150 dwdx1=(ParamM[1]-X2[1]*ParamM[2])*
denom;
151 dwdy0=(ParamM[3]-X2[0]*ParamM[5])*
denom;
152 dwdy1=((1.+ParamM[4])-X2[1]*ParamM[5])*
denom;
153 for(
unsigned int i=0;i<
nbParam;i++)
155 dW_[0][i]=dwdx0*dwdp0[i]+dwdy0*dwdp0[i+
nbParam];
156 dW_[1][i]=dwdx1*dwdp0[i]+dwdy1*dwdp0[i+
nbParam];
163 if((ParamM[2]*vX[0]+ParamM[5]*vX[1]+1)<0)
165 vXres[0]=((1+ParamM[0])*vX[0]+ParamM[3]*vX[1]+ParamM[6])/(ParamM[2]*vX[0]+ParamM[5]*vX[1]+1);
166 vXres[1]=(ParamM[1]*vX[0]+(1+ParamM[4])*vX[1]+ParamM[7])/(ParamM[2]*vX[0]+ParamM[5]*vX[1]+1);
182 for(
unsigned int i=0;i<3;i++)
183 for(
unsigned int j=0;j<3;j++)
187 H[i][j]=ParamM[i+3*j];
199 for(
unsigned int i=0;i<3;i++)
200 for(
unsigned int j=0;j<3;j++)
204 par[i+3*j]=H[i][j]/H[2][2];
205 if(i==j)par[i+3*j]--;
void getdW0(const int &i, const int &j, const double &dy, const double &dx, double *dIdW)
Implementation of a matrix and operations on matrices.
void getParamPyramidDown(const vpColVector &p, vpColVector &pdown)
void resize(const unsigned int nrows, const unsigned int ncols, const bool flagNullify=true)
void dWarpCompo(const vpColVector &X1, const vpColVector &X2, const vpColVector &ParamM, const double *dwdp0, vpMatrix &dW)
Implementation of an homography and operations on homographies.
Error that can be emited by the vpTracker class and its derivates.
void getParamInverse(const vpColVector &ParamM, vpColVector &ParamMinv) const
void computeDenom(vpColVector &vX, const vpColVector &ParamM)
void dWarp(const vpColVector &X1, const vpColVector &X2, const vpColVector &ParamM, vpMatrix &dW)
void getdWdp0(const int &i, const int &j, double *dIdW)
void pRondp(const vpColVector &p1, const vpColVector &p2, vpColVector &pres) const
Implementation of column vector and the associated operations.
vpTemplateTrackerWarpHomography()
vpHomography inverse() const
invert the homography
void warpX(const vpColVector &vX, vpColVector &vXres, const vpColVector &ParamM)
void getParam(const vpHomography &H, vpColVector &par) const
void getParamPyramidUp(const vpColVector &p, vpColVector &pup)
void warpXInv(const vpColVector &vX, vpColVector &vXres, const vpColVector &ParamM)
vpHomography getHomography(const vpColVector &ParamM) const