What Operations can I use to extract the Hard Edges/Lines from this image

I'm able to detect the main hard edges in an image quite well using morphological gradient - see below image. How can I process this image to just extract the hardest/whitest edges? Thresholding either results in a very noisy image or hard edges lacking in detail/too eroded.

在这里输入图像描述

My thresholding result: 在这里输入图像描述

My goal is something like this: 在这里输入图像描述

*Note: I'm attempting to use the Morphological Gradient operation as a light weight way to detect the hard/main edges in an image. The OpenCV code will run on a raspberry pi robot so I'm trying to be quite efficient with my resources - thus I'm using Morphological Gradient as opposed to Canny or etc.

Original image: 在这里输入图像描述


I initially said Difference of Gaussians but you already had a better threshold image.

So I took the first image as input and performed Otsu Threshold . I used the image obtained from the function cv2.threshold(img, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU) to detect lines.

Lines were detected using cv2.HoughLinesP()

My (not so good) result:

在这里输入图像描述

You have the option of drawing the lines onto your original image.

链接地址: http://www.djcxy.com/p/23702.html

上一篇: 将Mat转换为BufferedImage

下一篇: 我可以使用哪些操作从此图像中提取硬边线/边线