Esistono molte misure di distanza tra due istogrammi. Puoi leggere una buona categorizzazione di queste misure in:
K. Meshgi e S. Ishii, "Ampliamento dell'istogramma dei colori con griglia per migliorare la precisione di tracciamento", in Proc. di MVA'15, Tokyo, Giappone, maggio 2015.
Le funzioni di distanza più popolari sono elencate qui per comodità:
- L0 o Hellinger Distance
DL0=∑ih1(i)≠h2(i)
- L1 , Manhattan o City Block Distance
DL1=∑i|h1(i)−h2(i)|
- L=2 o distanza euclidea
DL2=∑i(h1(i)−h2(i))2−−−−−−−−−−−−−−−√
- L∞ or Chybyshev Distance
DL∞=maxi|h1(i)−h2(i)|
- Lp or Fractional Distance (part of Minkowski distance family)
DLp=(∑i|h1(i)−h2(i)|p)1/p and 0<p<1
D∩=1−∑i(min(h1(i),h2(i))min(|h1(i)|,|h2(i)|)
DCO=1−∑ih1(i)h2(i)
DCB=∑i|h1(i)−h2(i)|min(|h1(i)|,|h2(i)|)
- Pearson's Correlation Coefficient
DCR=∑i(h1(i)−1n)(h2(i)−1n)∑i(h1(i)−1n)2∑i(h2(i)−1n)2√
- Kolmogorov-Smirnov Divergance
DKS=maxi|h1(i)−h2(i)|
DMA=∑i|h1(i)−h2(i)|
- Cramer-von Mises Distance
DCM=∑i(h1(i)−h2(i))2
Dχ2=∑i(h1(i)−h2(i))2h1(i)+h2(i)
DBH=1−∑ih1(i)h2(i)−−−−−−−−√−−−−−−−−−−−−−−−−√ & hellinger
DSC=∑i(h1(i)−−−−√−h2(i)−−−−√)2
- Kullback-Liebler Divergance
DKL=∑ih1(i)logh1(i)m(i)
DJD=∑i(h1(i)logh1(i)m(i)+h2(i)logh2(i)m(i))
- Earth Mover's Distance (this is the first member of Transportation distances that embed binning information A into the distance, for more information please refer to the abovementioned paper or Wikipedia entry.
DEM=minfij∑i,jfijAijsumi,jfij
∑jfij≤h1(i),∑jfij≤h2(j),∑i,jfij=min(∑ih1(i)∑jh2(j)) and fij represents the flow from
i to j
DQU=∑i,jAij(h1(i)−h2(j))2−−−−−−−−−−−−−−−−−−−√
DQC=∑i,jAij(h1(i)−h2(i)(∑cAci(h1(c)+h2(c)))m)(h1(j)−h2(j)(∑cAcj(h1(c)+h2(c)))m)−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−√ and 00≡0
A Matlab implementation of some of these distances is available from my GitHub repository:
https://github.com/meshgi/Histogram_of_Color_Advancements/tree/master/distance
Also you can search guys like Yossi Rubner, Ofir Pele, Marco Cuturi and Haibin Ling for more state-of-the-art distances.
Update: Alternative explaination for the distances appears here and there in the literature, so I list them here for sake of completeness.
- Canberra distance (another version)
DCB=∑i|h1(i)−h2(i)||h1(i)|+|h2(i)|
- Bray-Curtis Dissimilarity, Sorensen Distance (since the sum of histograms are equal to one, it equals to DL0)
DBC=1−2∑ih1(i)=h2(i)∑ih1(i)+∑ih2(i)
- Jaccard Distance (i.e. intersection over union, another version)
DIOU=1−∑imin(h1(i),h2(i))∑imax(h1(i),h2(i))