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 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.
Normal Canny 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. Modified Canny Image

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

Edit
Report