IFCA-Advanced-Computing/frouros

Histogram intersection return wrong distance

Closed this issue · 2 comments

Histogram intersection method returns $\rm 1 - H(I,M)$ instead of $\rm H(I,M)$.

From Swain and Ballard 1991, Histogram intersection is defined as :

$\rm H_{SW}(I,M) = \dfrac{\sum_i \min(I_i,M_i)}{\sum_i M_i}$

The class HistrogramIntersection, instead, calculates it as:

$\rm H_{FR}(I,M) = 1 - \dfrac{\sum_i \min(I_i,M_i)}{\sum_i M_i} = 1 - H_{SW}(I,M)$

This way the class calculates the "percentage" of non-intersection rather than that of the intersection of the two histograms.

@FabRez Thanks for reporting this issue.

I have renamed that class to HINormalizedComplement to reflect that what you want to calculate is a distance between two distributions using the normalized complement of the histogram intersection of that distributions.

@jaime-cespedes-sisniega Thank you for fixing it. I am glad that this was useful