Python edge detection and curvature calculation

前端 未结 4 587
眼角桃花
眼角桃花 2021-01-31 22:56

I know the edge detection problem has been posted before (in Java: Count the number of objects in an Image, language independent: Image edge detection), but I want to know how t

4条回答
  •  不知归路
    2021-01-31 23:07

    You can easily achieve edge detection with scipy in python.

    from scipy import ndimage
    edge_horizont = ndimage.sobel(greyscale, 0)
    edge_vertical = ndimage.sobel(greyscale, 1)
    magnitude = np.hypot(edge_horizont, edge_vertical)
    

    And here is an example of original image and the image after edge detection.

    In scikit-image, there is a special page with explanations of how to do edge detection.

提交回复
热议问题