İki histogram arasında birçok mesafe ölçümü vardır. Bu önlemlerin iyi bir sınıflandırmasını şurada okuyabilirsiniz:
K. Meshgi ve S. Ishii, Proc., "İzleme Doğruluğunu Geliştirmek İçin Izgara Renkleriyle Histogramı Genişletmek", Proc. MVA'15, Tokyo, Japonya, Mayıs 2015.
Rahatınız için en popüler mesafe işlevleri burada listelenmiştir:
- L0 veya Hellinger Mesafe
DL0=∑ih1(i)≠h2(i)
- L1 , Manhattan veya Şehir Bloğu Mesafesi
DL1=∑i|h1(i)−h2(i)|
- L=2 veya Öklid Uzaklığı
DL2=∑i(h1(i)−h2(i))2−−−−−−−−−−−−−−−√
- L ∞∞ veya Chybyshev Mesafe
DL∞=maxi|h1(i)−h2(i)|
- L p veya Kesirli Mesafe (Minkowski mesafe ailesinin bir parçası)p
DLp=(∑i|h1(i)−h2(i)|p)1/p ve0<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 Korelasyon Katsayısı
DCR=∑i(h1(i)−1n)(h2(i)−1n)∑i(h1(i)−1n)2∑i(h2(i)−1n)2√
- Kolmogorov-Smirnov Diverganlığı
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))