Multiroom Floor Plan Detection
First multiroom approach. Room mask + interior wall classification + connected component splitting. Per-room polygon extraction with wall snapping. Door detection at wall gaps.
Edge + Hough + Mask Split → 16 rooms detected
Density-Based Room Detection
Walls = high density, rooms = low density gaps. Threshold + directional morphological closing + connected components. No Hough lines needed.
Density Gaps → 5 rooms (multiroom), 1 room (single)
Watershed Room Segmentation
OpenCV watershed on density image. Wall ridges as barriers, distance-transform room centers as seeds. Handles irregular room shapes naturally.
Watershed → 6 rooms (multiroom), 2 rooms (single)
Watershed + Distance Transform + Hallway Detection
Distance transform seeds + watershed + skeleton-based hallway carving. Correctly identifies 3 rooms + 1 hallway. Polygon extraction with wall snapping.
Watershed+Skeleton → 3R+1H (multiroom), 1R (single)
Wall Grid Cell Classification
Grid cells between Hough walls, classify by interior occupancy. Problem: too many walls → tiny cells, too few → everything merges.
Wall Grid → 1 room (too coarse grid)
Edge-Based Wall Detection
Density ratio between adjacent cells detects walls. Union-find merging. Better separation but rooms have gaps between them.
Edge Graph → 4R+2H (NMS=0.3)
Mask Cut — Wall Scoring
Fill apartment mask, cut along strongest validated walls. Wall scoring = strength × max_run. Boundary exclusion, min separation, fragment merging.
Mask Cut → 4R+1H (12.3, 9.8, 5.3, 4.4m² + 6.1m² hall)
Architectural Floor Plan
v29 detection + clean architectural rendering. Thick wall rectangles, door arcs, scale bar, pastel room fills, room classification.
Architectural → 4R+1H, 37.9m² total
Strip Merge
X cuts → vertical strips (left/center/right). Center strip = hallway. Z cuts split strips into rooms. Door detection via mask adjacency. Matches target layout!
Strip merge → 3R+1H+1C, 34.7m² total