OpenCV分水岭:4点连接 [英] OpenCV Watershed : 4 point connectivity
问题描述
我正在用OpenCV编写分水岭的代码.
I am writing a code for watershed in OpenCV.
但是我希望分水岭边界是4点连接的,而不是8点.
But i want the watershed boundaries to be 4 point connected and not 8 point.
当前这是接口:
void watershed(InputArray image, InputOutputArray markers)
有人对此有解决方案吗?
Does anybody have any solution for this?
还有,有什么简单的方法可以在opencv中执行形态分水岭以实现自动过度分割,当前的方法需要用户输入?
Also, is there any simple way to perform morphological watershed in opencv for automatic over-segmentation, the current one takes user input?
推荐答案
分水岭没有明确解释该函数中使用的连接性.它只是指论文MEYER,Fernand.彩色图像分割.在:图像处理及其应用,1992年.国际会议上,. IET,1992. 303-306.
OpenCV help for watershed does not explicitly explain the connectivity used in the function. It just refers to the paper MEYER, Fernand. Color image segmentation. In: Image Processing and its Applications, 1992., International Conference on. IET, 1992. p. 303-306.
也许您必须从OpenCV中可用的算法开始实现自己的分水岭算法(OpenCV 2.4实现为
Maybe you have to implement your own watershed algorithm, starting from the one available in OpenCV (OpenCV 2.4 implementation is here), or creating a new one; for example the following paper describes an algorithm where the connectivity is properly highlighted:
VINCENT,Luc;皮埃尔·SOILLE.数字空间中的分水岭:一种基于沉浸模拟的高效算法. 关于模式分析和机器智能的IEEE交易,1991,13.6:583-598.
VINCENT, Luc; SOILLE, Pierre. Watersheds in digital spaces: an efficient algorithm based on immersion simulations. IEEE transactions on pattern analysis and machine intelligence, 1991, 13.6: 583-598.
这篇关于OpenCV分水岭:4点连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!