39#include <visp3/core/vpImageFilter.h>
40#include <visp3/tt/vpTemplateTrackerSSDESM.h>
48 if (!
Warp->isESMcompatible()) {
49 throw(vpException(vpException::badValue,
"The selected warp function is not appropriate for the ESM algorithm..."));
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)) {
136 IW = I.getValue(i2, j2);
138 IW =
BI.getValue(i2, j2);
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);
error that can be emitted by ViSP classes.
static void getGradYGauss2D(const vpImage< ImageType > &I, vpImage< FilterType > &dIy, const FilterType *gaussianKernel, const FilterType *gaussianDerivativeKernel, unsigned int size)
static void getGradXGauss2D(const vpImage< ImageType > &I, vpImage< FilterType > &dIx, const FilterType *gaussianKernel, const FilterType *gaussianDerivativeKernel, unsigned int size)
static void filter(const vpImage< unsigned char > &I, vpImage< FilterType > &If, const vpArray2D< FilterType > &M, bool convolve=false)
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.