Існує велика кількість дистанційних заходів між двома гістограмами. Ви можете прочитати хорошу категоризацію цих заходів у:
К. Мешгі та С. Ішій, “Розширення гістограми кольорів за допомогою сітки для підвищення точності відстеження”, у зб. MVA'15, Токіо, Японія, травень 2015 року.
Тут представлені найпопулярніші функції дистанції для вашої зручності:
- L0 або відстань Геллінгера
DL0=∑ih1(i)≠h2(i)
- L1, Manhattan, or City Block Distance
DL1=∑i|h1(i)−h2(i)|
- L=2 or Euclidean Distance
DL2=∑i(h1(i)−h2(i))2−−−−−−−−−−−−−−−√
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))