40 #include <visp3/tt_mi/vpTemplateTrackerMIESM.h>
42 #ifdef VISP_HAVE_OPENMP
48 HDirect(), HInverse(), HdesireDirect(), HdesireInverse(), GDirect(), GInverse()
53 std::cerr<<
"The selected warp function is not appropriate for the ESM algorithm..."<<std::endl;
59 std::cout<<
"Initialise Hessian at Desired position..."<<std::endl;
81 Warp->computeCoeff(
p);
138 Warp->computeCoeff(
p);
169 double *tptemp=
new double[
nbParam];
170 for(
unsigned int it=0;it<
nbParam;it++)
171 tptemp[it] =dW[0][it]*dx+dW[1][it]*dy;
221 ptTemplateSupp=
new vpTemplateTrackerPointSuppMIInv[
templateSize];
239 int ct=(int)((Tij*(
Nc-1))/255.);
240 double et=(Tij*(
Nc-1))/255.-ct;
241 ptTemplateSupp[point].et=et;
242 ptTemplateSupp[point].ct=ct;
243 ptTemplateSupp[point].Bt=
new double[4];
244 ptTemplateSupp[point].dBt=
new double[4];
245 for(
char it=-1;it<=2;it++)
247 ptTemplateSupp[point].Bt[it+1] =vpTemplateTrackerBSpline::Bspline4(-it+et);
248 ptTemplateSupp[point].dBt[it+1] =vpTemplateTrackerMIBSpline::dBspline4(-it+et);
257 std::cout<<
"Compositionnal tracking no initialised\nUse initCompInverse(vpImage<unsigned char> &I) function"<<std::endl;
290 unsigned int iteration=0;
302 Warp->computeCoeff(
p);
361 Warp->computeCoeff(
p);
362 #ifdef VISP_HAVE_OPENMP
363 int nthreads = omp_get_num_procs() ;
365 omp_set_num_threads(nthreads);
366 #pragma omp parallel for private(point, i,j,i2,j2) default(shared)
398 double *tptemp=
new double[
nbParam];
399 for(
unsigned int it=0;it<
nbParam;it++)
400 tptemp[it] =dW[0][it]*dx+dW[1][it]*dy;
virtual void dWarpCompo(const vpColVector &X1, const vpColVector &X2, const vpColVector &ParamM, const double *dwdp0, vpMatrix &dW)=0
void computeHessien(vpMatrix &H)
unsigned int getWidth() const
void resize(const unsigned int nrows, const unsigned int ncols, const bool flagNullify=true)
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
vpTemplateTrackerMIESM()
Default constructor.
void computeOptimalBrentGain(const vpImage< unsigned char > &I, vpColVector &tp, double tMI, vpColVector &direction, double &alpha)
error that can be emited by ViSP classes.
Type getValue(double i, double j) const
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)
vpHessienApproximationType ApproxHessian
unsigned int templateSize
unsigned int iterationMax
Error that can be emited by the vpTracker class and its derivates.
double getCost(const vpImage< unsigned char > &I, const vpColVector &tp)
void initHessienDesired(const vpImage< unsigned char > &I)
void computeMI(double &MI)
virtual bool isESMcompatible() const =0
virtual void getdW0(const int &i, const int &j, const double &dy, const double &dx, double *dIdW)=0
void trackNoPyr(const vpImage< unsigned char > &I)
vpMinimizationTypeMIESM minimizationMethod
vpMatrix HLMdesireInverse
vpTemplateTrackerPointCompo * ptTemplateCompo
Implementation of column vector and the associated operations.
vpMatrix inverseByLU() const
unsigned int getHeight() const
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)
void computeProba(int &nbpoint)
vpHessienType hessianComputation
void resize(const unsigned int i, const bool flagNullify=true)