首页 > 代码库 > 直方图匹配方法
直方图匹配方法
http://blog.csdn.net/cxf7394373/article/details/6955530
1. 直方图匹配方法
对比直方图相似性的方法有四种:
(1) 相关度
(2) 卡方系数
(3) 相交系数
(4) 巴氏距离
在快速但是不怎么准确匹配的情况下,Intersection方法的效果好,
而在慢速但较精确的情况下,用卡方或者巴氏距离效果好。
如果用颜色直方图匹配的方法进行图像匹配,在这种情况下:不同的图片直方图分部也是一致的,采用直方图匹配的方法则没有效果。对于直方图这种简单的统计方法,这种情况的存在不可避免。
参考:《学习opencv中文版》
· Michael Kemmler
http://www.researchgate.net/post/What_is_chi-squared_distance_I_need_help_with_the_source_code
Hi Needa. The chi squared distance d(x,y) is, as you already know, a distance between two histograms x=[x_1,..,x_n] and y=[y_1,...,y_n] having n bins both. Moreover, both histograms are normalized, i.e. their entries sum up to one.
The distance measure d is usually defined (although alternative definitions exist) as d(x,y) = sum( (xi-yi)^2 / (xi+yi) ) / 2 . It is often used in computer vision to compute distances between some bag-of-visual-word representations of images.
The name of the distance is derived from Pearson‘s chi squared test statistic X2(x,y) = sum( (xi-yi)^2 / xi) for comparing discrete probability distributions (i.e histograms). However, unlike the test statistic, d(x,y) is symmetric wrt. x and y, which is often useful in practice, e.g., when you want to construct a kernel out of the histogram distances.
直方图匹配方法