40 #ifndef vpTemplateTrackerMI_hh
41 #define vpTemplateTrackerMI_hh
43 #include <visp3/core/vpConfig.h>
45 #include <visp3/core/vpImageFilter.h>
46 #include <visp3/tt/vpTemplateTracker.h>
47 #include <visp3/tt/vpTemplateTrackerHeader.h>
58 HESSIAN_NONSECOND = -1,
64 } vpHessienApproximationType;
67 typedef enum { USE_HESSIEN_NORMAL, USE_HESSIEN_DESIRE, USE_HESSIEN_BEST_COND } vpHessienType;
70 typedef enum { BSPLINE_THIRD_ORDER = 3, BSPLINE_FOURTH_ORDER = 4 } vpBsplineType;
99 double MI_preEstimation;
100 double MI_postEstimation;
102 double NMI_preEstimation;
103 double NMI_postEstimation;
106 bool computeCovariance;
109 std::vector<double> m_du;
110 std::vector<double> m_dv;
111 std::vector<double> m_A;
112 std::vector<double> m_dB;
113 std::vector< std::vector<double> > m_d2u;
114 std::vector< std::vector<double> > m_d2v;
115 std::vector< std::vector<double> > m_dA;
118 void computeGradient();
120 void computeHessienNormalized(
vpMatrix &H);
121 void computeMI(
double &MI);
122 void computeProba(
int &nbpoint);
130 void zeroProbabilities();
156 :
vpTemplateTracker(), hessianComputation(USE_HESSIEN_NORMAL), ApproxHessian(HESSIAN_0), lambda(0), temp(NULL),
157 Prt(NULL), dPrt(NULL), Pt(NULL), Pr(NULL), d2Prt(NULL), PrtTout(NULL), dprtemp(NULL), PrtD(NULL), dPrtD(NULL),
158 influBspline(0), bspline(0), Nc(0), Ncb(0), d2Ix(), d2Iy(), d2Ixy(), MI_preEstimation(0), MI_postEstimation(0),
159 NMI_preEstimation(0), NMI_postEstimation(0), covarianceMatrix(), computeCovariance(false),
160 m_du(), m_dv(), m_A(), m_dB(), m_d2u(), m_d2v(), m_dA()
165 vpMatrix getCovarianceMatrix()
const {
return covarianceMatrix; }
166 double getMI()
const {
return MI_postEstimation; }
169 double getNMI()
const {
return NMI_postEstimation; }
172 void setCovarianceComputation(
const bool &flag) { computeCovariance = flag; }
173 void setHessianComputation(vpHessienType type) { hessianComputation = type; }
175 void setLambda(
double _l) { lambda = _l; }
176 void setNc(
int newNc);