Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Extracting features with unclean canny detection

Hi Guys!

I performed a canny edge detection on an object and playing with the thresholds, I got the following output: Click here

The topmost rectangle is part of the part which I wish to ignore

The bottom two rectangles are the features I wish to outline in my original image. I know that it maybe possible to use HoughTransform to find the rectangles but I hoping to find a more generic method as my feature may not be of a fixed shape (perhaps using approxPolyDP?).

I'm not sure if it's possible but is it possible to: 1. extract the contours of the image 2. join lines that are close to one another 3. if the lines form a closed loop -> box the object if it's just stray lines, ignore.

If it is, can anyone give me the rough outline of how to do it? If it's not, do you guys have any other suggestions?

Thanks in advance!