40 #include <visp3/core/vpImageFilter.h> 41 #include <visp3/tt/vpTemplateTrackerSSDESM.h> 44 :
vpTemplateTrackerSSD(warp), compoInitialised(false), HDir(), HInv(), HLMDir(), HLMInv(), GDir(), GInv()
51 "The selected warp function is not appropriate for the ESM algorithm..."));
69 for (
unsigned int point = 0; point <
templateSize; point++) {
78 for (
unsigned int point = 0; point <
templateSize; point++) {
85 for (
unsigned int it = 0; it <
nbParam; it++)
86 for (
unsigned int jt = 0; jt <
nbParam; jt++)
101 double IW, dIWx, dIWy;
103 unsigned int iteration = 0;
110 double evolRMS_init = 0;
111 double evolRMS_prec = 0;
112 double evolRMS_delta;
113 double *tempt =
new double[
nbParam];
116 unsigned int Nbpoint = 0;
122 Warp->computeCoeff(
p);
123 for (
unsigned int point = 0; point <
templateSize; point++) {
134 if ((i2 >= 0) && (j2 >= 0) && (i2 < I.
getHeight() - 1) && (j2 < I.
getWidth() - 1)) {
142 double er = (Tij - IW);
143 for (
unsigned int it = 0; it <
nbParam; it++)
154 for (
unsigned int it = 0; it <
nbParam; it++)
155 tempt[it] = dW[0][it] * dIWx + dW[1][it] * dIWy;
157 for (
unsigned int it = 0; it <
nbParam; it++)
158 for (
unsigned int jt = 0; jt <
nbParam; jt++)
159 HDir[it][jt] += tempt[it] * tempt[jt];
161 for (
unsigned int it = 0; it <
nbParam; it++)
162 GDir[it] += er * tempt[it];
190 if (iteration == 0) {
196 evolRMS_delta = std::fabs(
evolRMS - evolRMS_prec);
virtual void warpX(const int &v1, const int &u1, double &v2, double &u2, const vpColVector &p)=0
Used to indicate that a value is not in the allowed range.
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
void computeOptimalBrentGain(const vpImage< unsigned char > &I, vpColVector &tp, double tMI, vpColVector &direction, double &alpha)
virtual void dWarpCompo(const vpColVector &X1, const vpColVector &X2, const vpColVector &p, const double *dwdp0, vpMatrix &dM)=0
error that can be emited by ViSP classes.
void initPosEvalRMS(const vpColVector &p)
static void getGradYGauss2D(const vpImage< unsigned char > &I, vpImage< double > &dIy, const double *gaussianKernel, const double *gaussianDerivativeKernel, unsigned int size)
void computeEvalRMS(const vpColVector &p)
static void getGradXGauss2D(const vpImage< unsigned char > &I, vpImage< double > &dIx, const double *gaussianKernel, const double *gaussianDerivativeKernel, unsigned int size)
unsigned int templateSize
virtual void getdWdp0(const int &v, const int &u, double *dIdW)=0
unsigned int iterationMax
Error that can be emited by the vpTracker class and its derivates.
virtual bool isESMcompatible() const =0
virtual void getdW0(const int &v, const int &u, const double &dv, const double &du, double *dIdW)=0
static void filter(const vpImage< double > &I, vpImage< double > &Iu, vpImage< double > &Iv, const vpMatrix &M, bool convolve=false)
void resize(unsigned int i, bool flagNullify=true)
unsigned int getHeight() const
vpTemplateTrackerPointCompo * ptTemplateCompo
vpTemplateTrackerWarp * Warp
static void computeHLM(const vpMatrix &H, const double &alpha, vpMatrix &HLM)
unsigned int getWidth() const