40 #include <visp3/core/vpImageFilter.h> 41 #include <visp3/tt/vpTemplateTrackerSSDESM.h> 44 :
vpTemplateTrackerSSD(warp), compoInitialised(false), HDir(), HInv(), HLMDir(), HLMInv(), GDir(), GInv()
50 std::cerr <<
"The selected warp function is not appropriate for the ESM " 71 for (
unsigned int point = 0; point <
templateSize; point++) {
83 for (
unsigned int point = 0; point <
templateSize; point++) {
93 for (
unsigned int it = 0; it <
nbParam; it++)
94 for (
unsigned int jt = 0; jt <
nbParam; jt++)
109 double IW, dIWx, dIWy;
111 unsigned int iteration = 0;
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++)
159 double *tempt =
new double[
nbParam];
160 for (
unsigned int it = 0; it <
nbParam; it++)
161 tempt[it] = dW[0][it] * dIWx + dW[1][it] * dIWy;
163 for (
unsigned int it = 0; it <
nbParam; it++)
164 for (
unsigned int jt = 0; jt <
nbParam; jt++)
165 HDir[it][jt] += tempt[it] * tempt[jt];
167 for (
unsigned int it = 0; it <
nbParam; it++)
168 GDir[it] += er * tempt[it];
virtual void dWarpCompo(const vpColVector &X1, const vpColVector &X2, const vpColVector &ParamM, const double *dwdp0, vpMatrix &dW)=0
vpTemplateTrackerPoint * ptTemplate
virtual void warpX(const int &i, const int &j, double &i2, double &j2, const vpColVector &ParamM)=0
void resize(const unsigned int nrows, const unsigned int ncols, const bool flagNullify=true, const bool recopy_=true)
void computeOptimalBrentGain(const vpImage< unsigned char > &I, vpColVector &tp, double tMI, vpColVector &direction, double &alpha)
error that can be emited by ViSP classes.
static void getGradYGauss2D(const vpImage< unsigned char > &I, vpImage< double > &dIy, const double *gaussianKernel, const double *gaussianDerivativeKernel, unsigned int size)
static void getGradXGauss2D(const vpImage< unsigned char > &I, vpImage< double > &dIx, const double *gaussianKernel, const double *gaussianDerivativeKernel, unsigned int size)
unsigned int templateSize
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 &i, const int &j, const double &dy, const double &dx, double *dIdW)=0
Type getValue(double i, double j) const
unsigned int getHeight() const
vpTemplateTrackerPointCompo * ptTemplateCompo
static void filter(const vpImage< double > &I, vpImage< double > &Iu, vpImage< double > &Iv, const vpMatrix &M, const bool convolve=false)
virtual void getdWdp0(const int &i, const int &j, double *dIdW)=0
vpTemplateTrackerWarp * Warp
static void computeHLM(const vpMatrix &H, const double &alpha, vpMatrix &HLM)
unsigned int getWidth() const
void resize(const unsigned int i, const bool flagNullify=true)