39#include <visp3/tt/vpTemplateTrackerZNCC.h>
62 Warp->computeCoeff(tp);
66 for (
unsigned int point = 0; point <
templateSize; point++) {
71 Warp->computeDenom(
X1, tp);
76 if ((j2 < I.
getWidth() - 1) && (i2 < I.
getHeight() - 1) && (i2 > 0) && (j2 > 0)) {
92 moyTij = moyTij / Nbpoint;
93 moyIW = moyIW / Nbpoint;
96 double var1 = 0, var2 = 0;
97 for (
unsigned int point = 0; point <
templateSize; point++) {
102 Warp->computeDenom(
X1, tp);
107 if ((j2 < I.
getWidth() - 1) && (i2 < I.
getHeight() - 1) && (i2 > 0) && (j2 > 0)) {
113 nom += (Tij - moyTij) * (IW - moyIW);
114 var1 += (IW - moyIW) * (IW - moyIW);
115 var2 += (Tij - moyTij) * (Tij - moyTij);
120 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.
Definition of the vpImage class member functions.
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
vpTemplateTrackerZNCC(vpTemplateTrackerWarp *warp)
double getCost(const vpImage< unsigned char > &I, const vpColVector &tp)
vpTemplateTrackerPoint * ptTemplate
vpTemplateTrackerWarp * Warp
unsigned int templateSize