Skip to content

sor8sh/Room-Segmentation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Automatic Room Segmentation

This repository is made for the Computer Vision course project - Jan 2019.

Dependencies:


Detecting rooms of a floor plan.

algorithm

  • Make it square
  • Convert to black-and-white
  • Line Segment Detection (LSD)
  • Morphology (Erosion, Open)
  • Connected Components

First, the input image is converted into a squared black-and-white image. Then the lines of the squared image are detected using the LSD algorithm. Every line shorter than a predefined value (first_line_tresh) is removed, and the lines with the same linear equation are connected with new lines. The same step is repeated after the image is rotated for 90 degrees. Next, to make the new lines larger, the morphology operations (erode and open) are applied to the image. Finally, using the connected component algorithm with 4-way connectivity, the connected areas (rooms) are detected and filled with the same colour.

comparision

Results

steps

  • Input:

    input

  • 0: SquareImage and black-and-white

    0-SquareImage

  • 1: DetectedLines

    1-DetectedLines

  • 2: ExtendedLines

    2-ExtendedLines

  • 3: DetectedLines

    3-DetectedLines

  • 4: ExtendedLines

    4-ExtendedLines

  • 5: MorphologyErodeOpen

    5-MorphologyErodeOpen

  • 6: Output

    6-output_office_i

related