Skip to main content

🧩 Props: maskConfig

FieldTypeDefaultDescription
semanticColorsMaskSemanticColor[]built-in paletteMask semantic colors (overridable by top-level semanticColors)
blackThresholdnumber30Pixels with max(B,G,R) below this value are treated as black background
maxRegionColorsnumber6Maximum semantic regions retained
quantStepnumber64Baseboard quantization step
baseboardMaxColorDistnumber42Baseboard color distance threshold
baseboardStripQuantKeysstring[]built-in keysBaseboard strip quantization keys, format "b,g,r"
wallQuantKeysstring[]built-in keysWall quantization keys
cabinetQuantKeysstring[]built-in keysCabinet quantization keys
secondarySemanticNamesstring[]garageDoor, roof, eaveSecondary semantic names
secondaryMinPixelRationumber0.002Minimum pixel ratio for secondary semantics
junctionHRadiusPxnumber24Baseboard junction horizontal radius
junctionVRadiusPxnumber2Baseboard junction vertical radius
kickBridgeHalfWPxnumber6Baseboard horizontal gap bridge half-width
baseboardJunctionRowMarginPxnumber1Baseboard junction row margin
baseboardJunctionVReachPxnumber2Baseboard junction vertical reach
baseboardMinRunPxnumber2Minimum run length for mask strips
splitWallsbooleanfalseSplit wall mask into wall-1, wall-2… by texture boundaries
splitWallsMaxCountnumber8Max wall sub-region count
splitWallsMinAreaRationumber0.002Minimum area ratio for fragments (relative to total seg pixels)
splitWallsColorDistSqnumber1400Connected-component chroma mean distance squared threshold
splitWallsChromaBlurRadiusnumber5Reserved: chroma smoothing radius
splitWallsNeutralChromaMaxnumber14White/gray wall low-chroma radius; forced boundary from colored walls
splitWallsEdgeBarrierThresholdnumber160Raw per-channel BGR Sobel gradient threshold for edge barriers (0 = disabled). Visible wall seams ≈ 120–280, subtle lighting gradients ≈ 20–80
splitWallsCloseMaskRadiusnumber3Morphological close radius for wall mask holes (windows, doors) before component labeling. 0 = disable
manualSplitWallsbooleanfalseWhen true, disables automatic texture-based wall splitting. Manual lasso partitioning is used instead
manualSplitWallsMaxCountnumber8Maximum number of manual wall sub-regions defined by lasso
manualSplitWallsGapAbsorbDilatePxnumber5Morphological dilation radius (seg pixels) to merge thin unassigned wall pockets adjacent to the drawn polygon
magneticLassobooleanfalseWhen true, lasso mode uses edge-snapping via Sobel gradient + Dijkstra shortest-path
activeContourRefinebooleanfalseAfter End Lasso, run active contour refinement on each polygon to expand vertices outward toward wall-mask edges

When splitWalls is enabled, the single wall region is replaced by multiple wall-N sub-regions, each independently paintable and undoable. Old sessions with regionName: 'wall' cannot map to new sub-region names and must be repainted.

Manual Wall Split (Lasso Mode)

When manualSplitWalls is enabled, automatic texture-based wall splitting is disabled. Instead, users must use the Lasso feature to manually draw polygons on the wall area:

  • Call ref.startLasso() to enter lasso mode, then tap on wall areas to place polygon vertices.
  • Enable magneticLasso for edge-snapping — paths will follow strong image edges (Sobel gradient + Dijkstra shortest-path).
  • Enable activeContourRefine to automatically expand vertices outward toward the wall-mask boundary after lasso completion.
  • Call ref.endLasso() to convert closed lasso polygons into wall-N sub-regions for painting.
  • Use splitWallsCloseMaskRadius to fill wall mask holes (windows, doors) before component labeling during automatic split.
  • Use splitWallsEdgeBarrierThreshold to prevent BFS from crossing strong edges (window frames, door frames) during automatic split.