Existem várias medidas de distância entre dois histogramas. Você pode ler uma boa categorização dessas medidas em:
K. Meshgi e S. Ishii, "Expandindo o histograma de cores com grade para melhorar a precisão do rastreamento", em Proc. de MVA'15, Tóquio, Japão, maio de 2015.
As funções de distância mais populares estão listadas aqui para sua conveniência:
- eu0 0 Distância L 0 ou Hellinger
DL 0= ∑Euh1( I ) ≠ h2( I )
- eu1Distância L 1 , Manhattan ou City Block
DL 1= ∑Eu| h1( I ) - h2( I ) |
- L = 2 ou distância euclidiana
DL 2= ∑Eu( h1( I ) - h2(i))2−−−−−−−−−−−−−−−√
- Distância L ∞ ou Chybyshev∞
DL ∞= m a xEu| h1(I )- h2( i) |
- L p ou distância fracionária (parte da família de distância Minkowski)p
DL p= ( ∑Eu| h1( I ) - h2( I ) |p)1 / p e0 < p < 1
D∩= 1 - ∑Eu( m i n ( h1( I ) , h2( I ) )m i n ( | 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))