OpenCV Watershed : 4 point connectivity

。_饼干妹妹 提交于 2019-12-23 04:45:38

问题


I am writing a code for watershed in OpenCV.

But i want the watershed boundaries to be 4 point connected and not 8 point.

Currently this is the interface:

void watershed(InputArray image, InputOutputArray markers)

Does anybody have any solution for this?

Also, is there any simple way to perform morphological watershed in opencv for automatic over-segmentation, the current one takes user input?


回答1:


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.

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, 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.



来源:https://stackoverflow.com/questions/20219670/opencv-watershed-4-point-connectivity

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!