MATLAB: Detect all the rectangles in image

rectangle detectionshape detection

Hey all,
in the following image, all the rectangles are a little bit deformed due to power leakage effect. I want to detect all the rectangles and obtain the positions of the rectangles.
Is there a way to detect all rectangles?
Thank you

Best Answer

It's trivial. Just use regionprops(). See my Image Segmentation Tutorial