4 #include "AppearanceModel.h" 29 int _n_bins,
double _pre_seed,
30 bool _partition_of_unity,
38 typedef double ElementType;
39 typedef double ResultType;
40 MIDist(
const string &_name,
const int _n_bins,
41 const unsigned int _feat_size,
const unsigned int _patch_size,
42 const double _hist_pre_seed,
const double _pre_seed,
43 const MatrixX2i *_std_bspl_ids,
44 const double _log_hist_norm_mult);
45 double operator()(
const double* a,
const double* b,
46 size_t size,
double worst_dist = -1)
const override;
49 const unsigned int feat_size;
50 const unsigned int patch_size;
51 const double pre_seed, hist_pre_seed;
52 const MatrixX2i *std_bspl_ids;
53 const double log_hist_norm_mult;
62 MI(
const ParamType *mi_params =
nullptr,
const int _n_channels = 1);
64 double getLikelihood()
const override;
66 void initializePixVals(
const Matrix2Xd& init_pts)
override;
67 void initializeSimilarity()
override;
68 void initializeGrad()
override;
69 void initializeHess()
override;
71 void updatePixVals(
const Matrix2Xd& curr_pts)
override;
72 void updateSimilarity(
bool prereq_only =
true)
override;
73 void updateInitGrad()
override;
74 void updateCurrGrad()
override;
76 void cmptInitHessian(MatrixXd &hessian,
const MatrixXd &curr_pix_jacobian)
override;
77 void cmptCurrHessian(MatrixXd &hessian,
const MatrixXd &curr_pix_jacobian)
override;
79 void cmptInitHessian(MatrixXd &init_hessian,
const MatrixXd &init_pix_jacobian,
80 const MatrixXd &init_pix_hessian)
override;
81 void cmptCurrHessian(MatrixXd &curr_hessian,
const MatrixXd &curr_pix_jacobian,
82 const MatrixXd &curr_pix_hessian)
override;
84 void cmptSelfHessian(MatrixXd &self_hessian,
const MatrixXd &curr_pix_jacobian)
override;
85 void cmptSelfHessian(MatrixXd &self_hessian,
const MatrixXd &curr_pix_jacobian,
86 const MatrixXd &curr_pix_hessian)
override;
91 const DistType* getDistFunc()
override{
92 return new DistType(name, params.n_bins, feat_size,
93 patch_size, hist_pre_seed, params.pre_seed,
94 &std_bspl_ids, log_hist_norm_mult);
97 feat_vec.resize(feat_size);
100 updateDistFeat(feat_vec.data());
102 const double* getDistFeat()
override{
return feat_vec.data(); }
103 void updateDistFeat(
double* feat_addr)
override;
112 double max_similarity;
115 double hist_pre_seed;
117 double hist_norm_mult;
118 unsigned int joint_hist_size;
123 VectorXd init_hist, curr_hist;
124 MatrixXd init_hist_mat, curr_hist_mat;
127 MatrixXd init_joint_hist_grad, curr_joint_hist_grad;
129 MatrixXd init_hist_grad, curr_hist_grad;
130 MatrixXd init_hist_hess, curr_hist_hess;
131 MatrixXd init_grad_factor, curr_grad_factor;
133 VectorXd init_hist_log, curr_hist_log;
134 MatrixXd joint_hist_log;
136 MatrixXd self_joint_hist, self_joint_hist_log;
137 MatrixXd self_grad_factor;
139 unsigned int feat_size;
141 double log_hist_norm_mult;
144 MatrixX2i std_bspl_ids;
145 MatrixX2i init_bspl_ids;
146 MatrixX2i curr_bspl_ids;
MIParams(const AMParams *am_params, int _n_bins, double _pre_seed, bool _partition_of_unity, ImageBase *_pix_mapper, bool _debug_mode)
decides whether logging data will be printed for debugging purposes;
unsigned int getDistFeatSize() override
returns the size of the distance vector
Definition: MI.h:104
void initializeDistFeat() override
to be called once during initialization if any of the distance feature functionality is to be used ...
Definition: MI.h:96
double pre_seed
initial value with which each bin of the joint histogram is pre-seeded
Definition: MI.h:18
bool partition_of_unity
decides whether the partition of unity constraint has to be strictly observed for border bins; if ena...
Definition: MI.h:21
void updateDistFeat() override
computes a "distance" vector using the current image patch such that, when the distance vectors corre...
Definition: MI.h:99
Definition: AMParams.h:12
Distance functor for FLANN.
Definition: AppearanceModel.h:40
Definition: ImageBase.h:51
int n_bins
no.
Definition: MI.h:14
Similarity function that indicates how well a candidate warped patch matches the template.
Definition: AppearanceModel.h:63