OpenCV 和 c++ ;比较两个二值图像并获得输出(结果)
我想比较两个二进制图像并获得结果输出。
我该怎么做?
我可以使用 cvSobel() 来做到这一点吗?
二进制图像有白色边缘,有没有办法计算白色像素之类的???
谢谢 !
I want to compare two binary images and get an output as a result .
How can i do this ??
Can i use cvSobel() to do that??
Binary image has white edges and is there a way to count white pixels or something ???
Thank you !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试简历::比较:
http://opencv.willowgarage.com/documentation/cpp/operations_on_arrays.html #cv-比较
try cv::compare:
http://opencv.willowgarage.com/documentation/cpp/operations_on_arrays.html#cv-compare
这是我根据以下论文编写的函数。 (应该检查我的代码!我将不胜感激!)
值得关注的论文:AJ Baddeley:二进制图像的错误度量
作者还有一个统计包,可以在其中找到代码。它称为“spatstat”www.spatstat.org。要使用 spatstat,请首先从 http://www.r-project.org/。误差度量可作为称为“deltametric”的函数使用。要查看帮助文件,请键入 help(deltametric)。
代码说明:
该函数输入两个文件名,应该是二进制图像文件!返回值是 Baddeley 错误度量编号。
还应该包括 OpenCV 标头和命名空间!
Here is a function that I have written, based on the following paper. (One should CHECK my CODE! it would be greatly appreciated!)
Paper to look after: A J Baddeley: An error metric for binary images
Also the author has a statistic package, where the code can be found. It is called "spatstat" www.spatstat.org. To use the spatstat first download the R-Stat from http://www.r-project.org/. The error metric is available as a function called 'deltametric'. To see the help file, type help(deltametric).
Description of code:
The input of this function two filename, which should be binary image files! The return value is the Baddeley Error metric number.
One should include the OpenCV headers and namespace also!
为什么不使用直接比较呢? (逐像素)
无论如何,Sobel 都会占用 O(pixels),因此像素与像素之间的比较不会改变复杂性。
Why not use a straightforward comparison? (pixel by pixel)
Sobel will take you O(pixels) anyway, so comparing pixel to pixel won't change complexity.