40 #include <visp3/tt/vpTemplateTrackerZNCC.h> 63 Warp->computeCoeff(tp);
67 for (
unsigned int point = 0; point <
templateSize; point++) {
72 Warp->computeDenom(
X1, tp);
77 if ((j2 < I.
getWidth() - 1) && (i2 < I.
getHeight() - 1) && (i2 > 0) && (j2 > 0)) {
94 moyTij = moyTij / Nbpoint;
95 moyIW = moyIW / Nbpoint;
98 double var1 = 0, var2 = 0;
99 for (
unsigned int point = 0; point <
templateSize; point++) {
104 Warp->computeDenom(
X1, tp);
109 if ((j2 < I.
getWidth() - 1) && (i2 < I.
getHeight() - 1) && (i2 > 0) && (j2 > 0)) {
116 nom += (Tij - moyTij) * (IW - moyIW);
118 var1 += (IW - moyIW) * (IW - moyIW);
119 var2 += (Tij - moyTij) * (Tij - moyTij);
126 return -nom / sqrt(var1 * var2);
void resize(unsigned int nrows, unsigned int ncols, bool flagNullify=true, bool recopy_=true)
Type getValue(unsigned int i, unsigned int j) const
vpTemplateTrackerPoint * ptTemplate
virtual void warpX(const int &i, const int &j, double &i2, double &j2, const vpColVector &ParamM)=0
error that can be emited by ViSP classes.
vpTemplateTrackerZNCC(vpTemplateTrackerWarp *warp)
unsigned int templateSize
void resize(unsigned int i, bool flagNullify=true)
unsigned int getHeight() const
Implementation of column vector and the associated operations.
vpTemplateTrackerWarp * Warp
unsigned int getWidth() const
void resize(unsigned int i, bool flagNullify=true)
double getCost(const vpImage< unsigned char > &I, const vpColVector &tp)