Find walls in a scan
trace_backgroundConvert background image into wall segments: dark or gray bands become walls, ignoring colored areas; collinear pieces split by doors/windows join within a max gap. Returns coordinates in cm.
Instructions
Trace walls from the background image (set_background first): thick dark or gray bands across or down the image become walls (colored areas — lawn, plants, furniture — are ignored; collinear pieces split by doors/windows up to max_gap join; region limits the search). Returns rows [[x1,y1],[x2,y2],t] in plan cm; trace_walls adds them as walls. Check with render_plan bg=0.5.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| h | No | Wall height cm when creating (default 250) | |
| t_max | No | Thickest wall kept, cm (default 45) | |
| t_min | No | Thinnest wall kept, cm (default 5) | |
| region | No | Only this part of the plan `[x0, y0, x1, y1]` cm | |
| max_gap | No | Doors and windows up to this wide don't split a wall, cm (default 130) | |
| min_len | No | Shortest wall kept, cm (default 60) | |
| threshold | No | Luminance 0..255 below which a gray pixel is ink (default 128; raise it for light gray walls) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | Walls found: [[x1,y1], [x2,y2], thickness] |