I need to extract the ALL Wall Edges (including floor,wall intersections and wall,door intersections) from the following image.If I use the canny detection and hough transform (probabilistic). It gives me to many redundant and unnecessary lines. I was looking if I could refine the canny image before hough transform is run on it.
Input Image
This following is the canny image given by the canny detection algorithm
I am using canny parameters as 0,20 for min and max threshold. I can't use a very high value for max threshold otherwise I will lose wall edges but gradient will be low there compared to rest of the image.
I thought of identifying a high density cluster of points in a window and set them to zero if it is above some threshold.
The following is the canny image obtained after that. You can see the wall edges are preserved.
Can anyone suggest me a better way of handling this problem? I mean refining the canny image so that I can identify cluster of random points and getting away with those but setting them to zero . I was thinking of checking for colinear points in a window but don't know how effective that would be? Any Comments would be welcome
I think you can filter out longest and nearly vertical lines, after using hough transform. Check out this link.
SimpleCV is just a shortcut library including OpenCV functions, you dont need to use it. I dont think you will encounter problems implementing the algorithm after getting the idea.
Edit: Ok, I thought more about your problem. Setting clusters to zero as a preprocessing step is not bad actually. What about increasing the window size step by step? I mean after obtaining second image, apply another cluster filter with 2*window size, same threshold. I think you can go on like this, as the wall edges are hard to be cancelled out.
Another way, use a rectangular window (width >= 5*height) for cluster filtering as you need vertical edges.
Another way, play with erosion and dilation and filter out blobs having large area.
Another way, check out the top part of the image, there is only the wall edges and the chandelier. You can search horizontally for a white pattern, then follow its neighbours to specify the length of connected points. Then filter out longer ones.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With