Reliably extract lines from an image

I need to extract ALL Wall Edges (including floor, wall intersection, walls, door intersections) from the following image. If I use canny definition and hough transformation (probabilistic). This gives me a lot of redundant and unnecessary lines. I looked to see if I can process the canonical image before the conversion is started on it.

Input image Input image

The following is the canonical image specified by the canny detection algorithm. I use canny parameters as 0.20 for the minimum and maximum threshold. I cannot use a very high value for the maximum threshold, otherwise I will lose the edges of the wall, but the gradient will be low there compared to the rest of the image.
Normal Canny Image

I thought about identifying a cluster with a high density of points in the window and set them to zero if it is above a certain threshold.

The following is the image obtained after this. You can see that the edges of the wall are saved. Modified Canny Image

Can someone suggest me a better way to deal with this problem? I mean refining the canonical image so that I can identify the cluster of random points and leave with them, but setting them to zero. I was thinking about checking collinear glasses in a window, but I don’t know how effective it would be? Any comments would be welcome.

+7
source share
1 answer

I think you can filter out the longest and most vertical lines after using the hough transform. Check out the link .

SimpleCV is just a shortcut library, including OpenCV features, you don't need to use it. I do not think that you will encounter problems implementing the algorithm after receiving the idea.

Edit: Well, I was thinking more about your problem. Setting clusters to zero as a preprocessing step is actually quite good. How about increasing the size of the window step by step? I mean, having received the second image, apply another cluster filter with a window size of 2 *, the same threshold. I think you can continue as the edges of the wall are hard to undo.

Another way: use a rectangular window (width> = 5 * height) to filter clusters as you need vertical edges.

In another way, play with erosion and expansion and filter out drops that have a large area.

Another way, check the top of the image, there are only the edges of the wall and the chandelier. You can search horizontally for a white picture, and then follow your neighbors to indicate the length of the connected dots. Then filter the longer ones.

+7
source

All Articles