收入囊中
- 使用4种不同的方法进行直方图比較
葵花宝典
要比較两个直方图,
首先必需要选择一个衡量直方图相似度的对照标准。也就是先说明要在哪个方面做对照。
我们能够想出非常多办法,OpenCV採用了下面4种
公式也都不难,我们自己就能实现。
d越小,表示差异越低,两幅图像越接近,越相似
初识API
- C++: double compareHist(InputArray H1, InputArray H2, int method)
- C++: double compareHist(const SparseMat& H1, const SparseMat& H2, int method)
-
- H1 – First compared histogram.
- H2 – Second compared histogram of the same size as H1 .
-
method –
Comparison method that could be one of the following:
- CV_COMP_CORREL Correlation
- CV_COMP_CHISQR Chi-Square
- CV_COMP_INTERSECT Intersection
- CV_COMP_BHATTACHARYYA Bhattacharyya distance
- CV_COMP_HELLINGER Synonym for CV_COMP_BHATTACHARYYA
荷枪实弹
举一反三
这篇直方图比較很easy,没什么要说的了
计算机视觉讨论群:162501053
转载请注明:http://blog.csdn.net/abcd1992719g