Research Article
How Many Bedrooms Do You Need? A Real-Estate Recommender System from Architectural Floor Plan Images
Algorithm 2
Room segmentation and decor items retrieval.
| | Input: | | | coordinate point of an independent room image | | | x-axis image size of an independent room | | | y-axis image size of an independent room | | | Output: | | | number of independent rooms | | (1) | ; | | (2) | ; | | (3) | While = 1 indicates that a new area has been found | | (4) | do | | (5) | ; | | (6) | ; | | (7) | fordo | | (8) | fordo | | (9) | if pixel intensity of 255 indicates white | | (10) | then | | (11) | ; | | (12) | ; | | (13) | break | | (14) | ; | | (15) | While Q = 1 indicates there may be missing points | | (16) | do | | (17) | ; | | (18) | fordo | | (19) | fordo | | (20) | Ifthen | | (21) | Convert the pixel values to 255 in the top, bottom, left, and right directions of points into | | (22) | This process is terminated when it encounters 0. | | (23) | if a pixel is converted then | | (24) | ; | | (25) | else ifthen | | (26) | Determine whether there is T before 0 is encountered in the four directions of point . | | (27) | | | (28) | for do | | (29) | if These two cases are not considered as a room | | (30) | then | | (31) | continue; | | (32) | else | | (33) | Convert all to 0 and convert other values to 255. | | (34) | Stack the decor items on the respective detected rooms. |
|