Skip to main content

compare

Function compare 

Source
pub fn compare(a: &Signature, b: &Signature, ignore_scale: bool) -> Similarity
Expand description

Compares two signatures:

  • shape = 1 − ½·Σ|d2ₐ − d2ᵦ| (the histograms sum to 1, so 0…1);
  • size = exp(−2·d), d = mean of |ln(eₐ/eᵦ)| over the three sorted extents – or, with ignore_scale, over the two proportions (middle/largest, smallest/largest), so a scaled copy scores 1;
  • score = shape × size.

5 % larger in every direction costs about 10 % of the score; twice the size leaves a quarter.