39 #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);
void resize(unsigned int nrows, unsigned int ncols, bool flagNullify=true, bool recopy_=true)
Implementation of column vector and the associated operations.
void resize(unsigned int i, bool flagNullify=true)
error that can be emitted by ViSP classes.
@ divideByZeroError
Division by zero.
unsigned int getWidth() const
Type getValue(unsigned int i, unsigned int j) const
unsigned int getHeight() const
void resize(unsigned int i, bool flagNullify=true)
virtual void warpX(const int &v1, const int &u1, double &v2, double &u2, const vpColVector &p)=0
VP_EXPLICIT vpTemplateTrackerZNCC(vpTemplateTrackerWarp *warp)
double getCost(const vpImage< unsigned char > &I, const vpColVector &tp)
vpTemplateTrackerPoint * ptTemplate
vpTemplateTrackerWarp * Warp
unsigned int templateSize