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