18 typedef double ElementType;
19 typedef double ResultType;
20 SSDDist(
const string &_name,
const bool _dist_from_likelihood,
21 const double _likelihood_alpha,
const unsigned int _patch_size);
23 size_t size,
double worst_dist = -1)
const override{
26 -exp(-
likelihood_alpha * sqrt(dist / (static_cast<double>(patch_size)))) : dist;
31 const unsigned int patch_size;
40 SSD(
const ParamType *ssd_params =
nullptr,
const int _n_channels = 1);
42 return exp(-params.likelihood_alpha * sqrt(-f / (static_cast<double>(patch_size))));
44 void updateModel(
const Matrix2Xd& curr_pts)
override;
47 const DistType* getDistFunc()
override{
48 return new DistType(name, params.dist_from_likelihood,
49 params.likelihood_alpha, patch_size);
double operator()(const double *a, const double *b, size_t size, double worst_dist=-1) const override
Squared Euclidean distance functor, optimized version.
bool dist_from_likelihood
use negative of likelihood as the distance measure
Definition: AMParams.h:17
double likelihood_alpha
multiplicative and additive factors for the exponent in the likelihood
Definition: AMParams.h:15
SSDParams(const AMParams *am_params, bool _show_template)
value constructor
double getLikelihood() const override
returns a normalized version of the similarity that lies between 0 and 1 and can be interpreted as th...
Definition: SSD.h:41
Definition: AMParams.h:12
base class for appearance models that use the negative sum of squared differences ("SSD") or L2 norm ...
Definition: SSDBase.h:16
double operator()(const double *a, const double *b, size_t size, double worst_dist=-1) const override
computes the distance / dissimilarity between two patches where each is codified or represented by a ...
Definition: SSD.h:22