gpt4 book ai didi

OpenCV 直方图比较方法

转载 作者:太空宇宙 更新时间:2023-11-03 20:50:03 25 4
gpt4 key购买 nike

查看 Histogram Documentation , 有 4(5) 种不同的比较方法:

  1. CV_COMP_CORREL 相关性
  2. CV_COMP_CHISQR 卡方
  3. CV_COMP_INTERSECT 交点
  4. CV_COMP_BHATTACHARYYA Bhattacharyya 距离
  5. CV_COMP_HELLINGER 同义词 CV_COMP_BHATTACHARYYA

它们都提供不同的输出,如 Compare Histogram Documentation 所示.但是我找不到任何可以说明每种方法相互比较的效果如何的信息。每种方法当然都有优点和缺点,否则为什么要有多种方法?

即使是 OpenCV 2 Computer Vision Application Programming Cookbook对差异无话可说:

The call to cv::compareHist is straightforward. You just input the two histograms and the function returns the measured distance. The specific measurement method you want to use is specified using a flag. In the ImageComparator class, the intersection method is used (with flag CV_COMP_INTERSECT). This method simply compares, for each bin, the two values in each histogram, and keeps the minimum one. The similarity measure is then simply the sum of these minimum values. Consequently, two images having histograms with no colors in common would get an intersection value of 0, while two identical histograms would get a value equal to the total number of pixels.

The other methods available are the Chi-Square (flag CV_COMP_CHISQR) which sums the normalized square difference between the bins, the correlation method (flag CV_COMP_CORREL) which is based on the normalized cross-correlation operator used in signal processing to measure the similarity between two signals, and the Bhattacharyya measure (flag CV_COMP_BHATTACHARYYA) used in statistics to estimate the similarity between two probabilistic distributions.

方法之间肯定有区别,所以我的问题是它们是什么?它们在什么情况下效果最好?

最佳答案

CV_COMP_INTERSECT 计算速度很快,因为您只需要每个 bin 的最小值。但它不会告诉你很多关于差异的分布。其他方法试图在对像素分布的不同假设下获得更好和更连续的匹配分数。

您可以在以下位置找到不同方法中使用的公式

http://docs.opencv.org/doc/tutorials/imgproc/histograms/histogram_comparison/histogram_comparison.html

可以在以下位置找到有关匹配算法的更多详细信息的一些引用:

http://siri.lmao.sk/fiit/DSO/Prednasky/7%20a%20Histogram%20based%20methods/7%20a%20Histogram%20based%20methods.pdf

关于OpenCV 直方图比较方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30258119/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com