40 #include <visp3/core/vpImageFilter.h> 41 #include <visp3/tt/vpTemplateTrackerZNCCForwardAdditional.h> 63 Warp->computeCoeff(
p);
64 double IW, dIWx, dIWy;
73 for (
unsigned int point = 0; point <
templateSize; point++) {
86 if ((i2 >= 0) && (j2 >= 0) && (i2 < I.
getHeight() - 1) && (j2 < I.
getWidth() - 1)) {
99 moyTij = moyTij / Nbpoint;
100 moyIW = moyIW / Nbpoint;
102 for (
unsigned int point = 0; point <
templateSize; point++) {
115 if ((i2 >= 0) && (j2 >= 0) && (i2 < I.
getHeight() - 1) && (j2 < I.
getWidth() - 1)) {
127 double *tempt =
new double[
nbParam];
128 for (
unsigned int it = 0; it <
nbParam; it++)
129 tempt[it] =
dW[0][it] * dIWx +
dW[1][it] * dIWy;
131 double prod = (Tij - moyTij);
133 double d_Ixx = dIxx.
getValue(i2, j2);
134 double d_Iyy = dIyy.
getValue(i2, j2);
135 double d_Ixy = dIxy.
getValue(i2, j2);
137 for (
unsigned int it = 0; it <
nbParam; it++)
138 for (
unsigned int jt = 0; jt <
nbParam; jt++)
139 Hdesire[it][jt] += prod * (
dW[0][it] * (
dW[0][jt] * d_Ixx +
dW[1][jt] * d_Ixy) +
140 dW[1][it] * (
dW[0][jt] * d_Ixy +
dW[1][jt] * d_Iyy));
146 denom += (Tij - moyTij) * (Tij - moyTij) * (IW - moyIW) * (IW - moyIW);
174 double IW, dIWx, dIWy;
176 unsigned int iteration = 0;
185 Warp->computeCoeff(
p);
189 for (
unsigned int point = 0; point <
templateSize; point++) {
200 if ((i2 >= 0) && (j2 >= 0) && (i2 < I.
getHeight() - 1) && (j2 < I.
getWidth() - 1)) {
218 moyTij = moyTij / Nbpoint;
219 moyIW = moyIW / Nbpoint;
222 for (
unsigned int point = 0; point <
templateSize; point++) {
233 if ((i2 >= 0) && (j2 >= 0) && (i2 < I.
getHeight() - 1) && (j2 < I.
getWidth() - 1)) {
245 double *tempt =
new double[
nbParam];
246 for (
unsigned int it = 0; it <
nbParam; it++)
247 tempt[it] =
dW[0][it] * dIWx +
dW[1][it] * dIWy;
249 double prod = (Tij - moyTij);
250 for (
unsigned int it = 0; it <
nbParam; it++)
251 G[it] += prod * tempt[it];
270 double er = (Tij - IW);
272 denom += (Tij - moyTij) * (Tij - moyTij) * (IW - moyIW) * (IW - moyIW);
static void getGradX(const vpImage< unsigned char > &I, vpImage< double > &dIx)
vpTemplateTrackerPoint * ptTemplate
static void getGradY(const vpImage< unsigned char > &I, vpImage< double > &dIy)
virtual void warpX(const int &i, const int &j, double &i2, double &j2, const vpColVector &ParamM)=0
vpMatrix inverseByLU() const
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
Type getValue(double i, double j) const
vpMatrix HLMdesireInverse
unsigned int getHeight() const
void initHessienDesired(const vpImage< unsigned char > &I)
static void filter(const vpImage< double > &I, vpImage< double > &Iu, vpImage< double > &Iv, const vpMatrix &M, const bool convolve=false)
void trackNoPyr(const vpImage< unsigned char > &I)
vpTemplateTrackerZNCCForwardAdditional(vpTemplateTrackerWarp *warp)
vpTemplateTrackerWarp * Warp
static void computeHLM(const vpMatrix &H, const double &alpha, vpMatrix &HLM)
unsigned int getWidth() const
virtual void dWarp(const vpColVector &X1, const vpColVector &X2, const vpColVector &ParamM, vpMatrix &dW)=0