40 #include <visp3/core/vpImageFilter.h> 41 #include <visp3/tt/vpTemplateTrackerSSDForwardCompositional.h> 50 for (
unsigned int point = 0; point <
templateSize; point++) {
67 std::cout <<
"Compositionnal tracking not initialised.\nUse initCompo() function." << std::endl;
79 double IW, dIWx, dIWy;
81 unsigned int iteration = 0;
88 double evolRMS_init = 0;
89 double evolRMS_prec = 0;
91 double *tempt =
new double[
nbParam];
94 unsigned int Nbpoint = 0;
98 Warp->computeCoeff(
p);
99 for (
unsigned int point = 0; point <
templateSize; point++) {
110 if ((i2 >= 0) && (j2 >= 0) && (i2 < I.
getHeight() - 1) && (j2 < I.
getWidth() - 1)) {
122 for (
unsigned int it = 0; it <
nbParam; it++)
123 tempt[it] = dW[0][it] * dIWx + dW[1][it] * dIWy;
125 for (
unsigned int it = 0; it <
nbParam; it++)
126 for (
unsigned int jt = 0; jt <
nbParam; jt++)
127 H[it][jt] += tempt[it] * tempt[jt];
129 double er = (Tij - IW);
130 for (
unsigned int it = 0; it <
nbParam; it++)
131 G[it] += er * tempt[it];
160 if (iteration == 0) {
165 evolRMS_delta = std::fabs(
evolRMS - evolRMS_prec);
virtual void warpX(const int &v1, const int &u1, double &v2, double &u2, const vpColVector &p)=0
Type getValue(unsigned int i, unsigned int j) const
vpTemplateTrackerPoint * ptTemplate
vpMatrix inverseByLU() const
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 void pRondp(const vpColVector &p1, const vpColVector &p2, vpColVector &p12) const =0
static void filter(const vpImage< double > &I, vpImage< double > &Iu, vpImage< double > &Iv, const vpMatrix &M, bool convolve=false)
unsigned int getHeight() const
vpTemplateTrackerWarp * Warp
static void computeHLM(const vpMatrix &H, const double &alpha, vpMatrix &HLM)
unsigned int getWidth() const