39 #include <visp3/core/vpImageFilter.h>
40 #include <visp3/tt/vpTemplateTrackerSSDESM.h>
44 :
vpTemplateTrackerSSD(warp), compoInitialised(false), HDir(), HInv(), HLMDir(), HLMInv(), GDir(), GInv()
68 for (
unsigned int point = 0; point <
templateSize; point++) {
77 for (
unsigned int point = 0; point <
templateSize; point++) {
84 for (
unsigned int it = 0; it <
nbParam; it++)
85 for (
unsigned int jt = 0; jt <
nbParam; jt++)
100 double IW, dIWx, dIWy;
102 unsigned int iteration = 0;
109 double evolRMS_init = 0;
110 double evolRMS_prec = 0;
111 double evolRMS_delta;
112 double *tempt =
new double[
nbParam];
115 unsigned int Nbpoint = 0;
121 Warp->computeCoeff(
p);
122 for (
unsigned int point = 0; point <
templateSize; point++) {
133 if ((i2 >= 0) && (j2 >= 0) && (i2 < I.
getHeight() - 1) && (j2 < I.
getWidth() - 1)) {
141 double er = (Tij - IW);
142 for (
unsigned int it = 0; it <
nbParam; it++)
153 for (
unsigned int it = 0; it <
nbParam; it++)
154 tempt[it] =
dW[0][it] * dIWx +
dW[1][it] * dIWy;
156 for (
unsigned int it = 0; it <
nbParam; it++)
157 for (
unsigned int jt = 0; jt <
nbParam; jt++)
158 HDir[it][jt] += tempt[it] * tempt[jt];
160 for (
unsigned int it = 0; it <
nbParam; it++)
161 GDir[it] += er * tempt[it];
190 if (iteration == 0) {
196 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 getGradXGauss2D(const vpImage< ImageType > &I, vpImage< FilterType > &dIx, const FilterType *gaussianKernel, const FilterType *gaussianDerivativeKernel, unsigned int size, const vpImage< bool > *p_mask=nullptr)
static void filter(const vpImage< ImageType > &I, vpImage< FilterType > &If, const vpArray2D< FilterType > &M, bool convolve=false, const vpImage< bool > *p_mask=nullptr)
static void getGradYGauss2D(const vpImage< ImageType > &I, vpImage< FilterType > &dIy, const FilterType *gaussianKernel, const FilterType *gaussianDerivativeKernel, unsigned int size, const vpImage< bool > *p_mask=nullptr)
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.