MATLAB Answers

How to find coordinates of a rotated room in a floor plan?

2 views (last 30 days)
CHINTALA NIRMAL SRINIVAS
CHINTALA NIRMAL SRINIVAS on 22 Jun 2020
Commented: Matt J on 22 Jun 2020
I am new to this platform. So please help me in clarifying my doubt. Actually I had a floorplan in which I need to identify roomc oordinates. I use regionprops() to get the bounding boxes around it and got the coordinates of the rooms. But what if the floor plan is rotated with some angle, then regionprops() is not giving correct coordinates. Could anyone please help me? Also I want to close all the doors in the floorplan image so that I could identify all the rooms. I do not know how to close the doors if the floor plan is rotated.Can somebody please help me?
I could not close all the doors.

  0 Comments

Sign in to comment.

Answers (1)

Matt J
Matt J on 22 Jun 2020
Edited: Matt J on 22 Jun 2020
Use imerode to get rid of everything except the thicker lines demarcating the walls. Then use houghlines to fit line segments to each of the walls. Once you have the equations for the lines you can compute the rotation angle.

  2 Comments

CHINTALA NIRMAL SRINIVAS
CHINTALA NIRMAL SRINIVAS on 22 Jun 2020
Actually I had a standard code given by superior to get the coordinates. But it is giving incorrect output for rotated floor plans. I am trying to figure out where it is going wrong. It is unable to close all the doors. But I don't understand why as I do not have much knowledge about the functions in matlab. Could you please tell me where it is going wrong?I am here attached the zip folder of it. Kindly help me to solve this issue.

Sign in to comment.