MATLAB: How to get bounding boxes around rectangular rooms which are rotated by some angle

bounding boxroom segmentationrotated floor plan

I have a floorplan which is rotated with some angle. I do not know the angle. Can I get the bounding box around the rooms in floor plan . If it is not rotated, using regionprops(), I am able to get the bounding boxes. But if it is rotated, since the bounding box do not rotates, I am unable to get the bounding box around the rooms. I want to get the coordinates of those rooms. Is there any other way to get the coordinates of the rooms with/without using bounding box method?Or I sit possible to get the coordinates of the 4 line segments of each room which bound the rooms?

Best Answer

You could also use this FEX file to get the vertices of each room,
though you would have to generate an image of each room separately. You could also use it to find the corners of the convex hull of the floorplan.