What is the method for edge detection of a binary image in python?

六眼飞鱼酱① 提交于 2021-01-01 11:09:04

问题


I have a binary image [0,1]. I want to use Python to find the edge of the image. I have tried sobel method on the binary but it provides a bad result. I expect the output like the image


回答1:


The best way is to apply a 1-pixel morphological erosion, then take the difference between the input image and the result. In pseudo-code:

edges = image - erosion(image)


来源:https://stackoverflow.com/questions/54134295/what-is-the-method-for-edge-detection-of-a-binary-image-in-python

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