39 #include <visp3/core/vpImageFilter.h>
40 #include <visp3/tt/vpTemplateTrackerSSDESM.h>
43 :
vpTemplateTrackerSSD(warp), compoInitialised(false), HDir(), HInv(), HLMDir(), HLMInv(), GDir(), GInv()
67 for (
unsigned int point = 0; point <
templateSize; point++) {
76 for (
unsigned int point = 0; point <
templateSize; point++) {
83 for (
unsigned int it = 0; it <
nbParam; it++)
84 for (
unsigned int jt = 0; jt <
nbParam; jt++)
99 double IW, dIWx, dIWy;
101 unsigned int iteration = 0;
108 double evolRMS_init = 0;
109 double evolRMS_prec = 0;
110 double evolRMS_delta;
111 double *tempt =
new double[
nbParam];
114 unsigned int Nbpoint = 0;
120 Warp->computeCoeff(
p);
121 for (
unsigned int point = 0; point <
templateSize; point++) {
132 if ((i2 >= 0) && (j2 >= 0) && (i2 < I.
getHeight() - 1) && (j2 < I.
getWidth() - 1)) {
140 double er = (Tij - IW);
141 for (
unsigned int it = 0; it <
nbParam; it++)
152 for (
unsigned int it = 0; it <
nbParam; it++)
153 tempt[it] =
dW[0][it] * dIWx +
dW[1][it] * dIWy;
155 for (
unsigned int it = 0; it <
nbParam; it++)
156 for (
unsigned int jt = 0; jt <
nbParam; jt++)
157 HDir[it][jt] += tempt[it] * tempt[jt];
159 for (
unsigned int it = 0; it <
nbParam; it++)
160 GDir[it] += er * tempt[it];
188 if (iteration == 0) {
194 evolRMS_delta = std::fabs(
evolRMS - evolRMS_prec);
void resize(unsigned int nrows, unsigned int ncols, bool flagNullify=true, bool recopy_=true)
void resize(unsigned int i, bool flagNullify=true)
error that can be emitted by ViSP classes.
@ badValue
Used to indicate that a value is not in the allowed range.
static void getGradYGauss2D(const vpImage< ImageType > &I, vpImage< FilterType > &dIy, const FilterType *gaussianKernel, const FilterType *gaussianDerivativeKernel, unsigned int size)
static void filter(const vpImage< ImageType > &I, vpImage< FilterType > &If, const vpArray2D< FilterType > &M, bool convolve=false)
static void getGradXGauss2D(const vpImage< ImageType > &I, vpImage< FilterType > &dIx, const FilterType *gaussianKernel, const FilterType *gaussianDerivativeKernel, unsigned int size)
unsigned int getWidth() const
Type getValue(unsigned int i, unsigned int j) const
unsigned int getHeight() const
static void computeHLM(const vpMatrix &H, const double &alpha, vpMatrix &HLM)
virtual void dWarpCompo(const vpColVector &X1, const vpColVector &X2, const vpColVector &p, const double *dwdp0, vpMatrix &dM)=0
virtual bool isESMcompatible() const =0
virtual void getdW0(const int &v, const int &u, const double &dv, const double &du, double *dIdW)=0
virtual void getdWdp0(const int &v, const int &u, double *dIdW)=0
virtual void warpX(const int &v1, const int &u1, double &v2, double &u2, const vpColVector &p)=0
void computeEvalRMS(const vpColVector &p)
void computeOptimalBrentGain(const vpImage< unsigned char > &I, vpColVector &tp, double tMI, vpColVector &direction, double &alpha)
unsigned int iterationMax
void initPosEvalRMS(const vpColVector &p)
vpTemplateTrackerPoint * ptTemplate
vpTemplateTrackerWarp * Warp
unsigned int templateSize
vpTemplateTrackerPointCompo * ptTemplateCompo
Error that can be emitted by the vpTracker class and its derivatives.
@ notEnoughPointError
Not enough point to track.