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)) {
93 moyTij = moyTij / Nbpoint;
94 moyIW = moyIW / Nbpoint;
97 double var1 = 0, var2 = 0;
98 for (
unsigned int point = 0; point <
templateSize; point++) {
103 Warp->computeDenom(
X1, tp);
108 if ((j2 < I.
getWidth() - 1) && (i2 < I.
getHeight() - 1) && (i2 > 0) && (j2 > 0)) {
114 nom += (Tij - moyTij) * (IW - moyIW);
115 var1 += (IW - moyIW) * (IW - moyIW);
116 var2 += (Tij - moyTij) * (Tij - moyTij);
121 return -nom / sqrt(var1 * var2);
virtual void warpX(const int &v1, const int &u1, double &v2, double &u2, const vpColVector &p)=0
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
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)