37#include <visp3/core/vpImageFilter.h>
38#include <visp3/tt/vpTemplateTrackerSSDESM.h>
47 if (!
Warp->isESMcompatible()) {
48 throw(vpException(vpException::badValue,
"The selected warp function is not appropriate for the ESM algorithm..."));
66 for (
unsigned int point = 0; point <
templateSize; point++) {
75 for (
unsigned int point = 0; point <
templateSize; point++) {
82 for (
unsigned int it = 0; it <
nbParam; it++)
83 for (
unsigned int jt = 0; jt <
nbParam; jt++)
98 double IW, dIWx, dIWy;
100 unsigned int iteration = 0;
107 double evolRMS_init = 0;
108 double evolRMS_prec = 0;
109 double evolRMS_delta;
110 double *tempt =
new double[
nbParam];
113 unsigned int Nbpoint = 0;
119 Warp->computeCoeff(
p);
120 for (
unsigned int point = 0; point <
templateSize; point++) {
131 if ((i2 >= 0) && (j2 >= 0) && (i2 < I.getHeight() - 1) && (j2 < I.getWidth() - 1)) {
135 IW = I.getValue(i2, j2);
137 IW =
BI.getValue(i2, j2);
139 double er = (Tij - IW);
140 for (
unsigned int it = 0; it <
nbParam; it++)
151 for (
unsigned int it = 0; it <
nbParam; it++)
152 tempt[it] =
dW[0][it] * dIWx +
dW[1][it] * dIWy;
154 for (
unsigned int it = 0; it <
nbParam; it++)
155 for (
unsigned int jt = 0; jt <
nbParam; jt++)
156 HDir[it][jt] += tempt[it] * tempt[jt];
158 for (
unsigned int it = 0; it <
nbParam; it++)
159 GDir[it] += er * tempt[it];
188 if (iteration == 0) {
194 evolRMS_delta = std::fabs(
evolRMS - evolRMS_prec);
error that can be emitted by ViSP classes.
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)
Definition of the vpImage class member functions.
static void computeHLM(const vpMatrix &H, const double &alpha, vpMatrix &HLM)
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.