2026-07-01 05:41:17 +00:00
|
|
|
import type { SegmentMaskResult } from './maskSegmentation';
|
2026-07-02 02:07:32 +00:00
|
|
|
/** Placeholder value for non-wall pixels in wallSubLabels */
|
2026-07-01 05:41:17 +00:00
|
|
|
export declare const WALL_SUB_LABEL_NONE = 255;
|
feat: add manual lasso wall splitting with magnetic edge-snapping and active contour refinement
- New magneticLasso module: Sobel energy map + Dijkstra shortest-path + Douglas-Peucker
- New activeContour module: greedy snake + balloon force for polygon-to-edge refinement
- wallTextureSplit: edge barrier mask, morphological mask hole closing, Moore boundary tracing, simplified polygon contours, manual pick map patching, gap absorption
- MaskSegmentCanvas: full lasso gesture pipeline (tap vertices, drag, magnetic paths, close polygon, endLasso/cancelLasso/deleteLasso)
- New maskConfig options: splitWallsEdgeBarrierThreshold, splitWallsCloseMaskRadius, manualSplitWalls, manualSplitWallsMaxCount, manualSplitWallsGapAbsorbDilatePx, magneticLasso, activeContourRefine
- New ref methods: startLasso, endLasso, cancelLasso, getManualRegions, deleteLasso
- New exported types: LassoPolygon, ManualWallPartition
- RegionMaskData carries indexToName and wallSemanticIdx through downsample
- Simplify README to point to documentation site
- Update documentation site (EN + ZH-CN) with all new APIs and interaction guide
- Example app: lasso mode toggles and operation buttons
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 03:23:57 +00:00
|
|
|
export declare function buildPickMapAfterWallSplit(labels: Uint8Array, baseboardBinary: Uint8Array, wallIdx: number, wallSubLabels: Uint8Array, indexToName: string[], nameToId: Map<string, number>, cols: number, rows: number): Uint8Array;
|
|
|
|
|
/**
|
|
|
|
|
* Manual lasso split: copy the existing pick map and rewrite wall pixels only.
|
|
|
|
|
* Non-wall pick codes stay identical so prior paints and hit-testing remain stable.
|
|
|
|
|
*/
|
|
|
|
|
export declare function patchPickMapForManualWallSplit(existingPick: Uint8Array, labels: Uint8Array, baseboardBinary: Uint8Array, wallIdx: number, wallSubLabels: Uint8Array, nameToId: Map<string, number>, cols: number, rows: number): Uint8Array;
|
|
|
|
|
export declare function dilatePickBuffer1px(pick: Uint8Array, cols: number, rows: number): Uint8Array;
|
|
|
|
|
export type LassoPolyBBox = {
|
|
|
|
|
x: number;
|
|
|
|
|
y: number;
|
|
|
|
|
w: number;
|
|
|
|
|
h: number;
|
|
|
|
|
};
|
|
|
|
|
/**
|
|
|
|
|
* Morphologically dilate each lasso polygon into adjacent unassigned wall pixels
|
|
|
|
|
* (up to `dilateRadius` seg pixels) so thin gaps against the wall mask merge in.
|
|
|
|
|
*/
|
|
|
|
|
export declare function absorbSmallWallGapsForLassoPolygons(polyLabels: Uint8Array, polyCount: number, areas: number[], bboxes: LassoPolyBBox[], labels: Uint8Array, baseboardBinary: Uint8Array, wallSemanticIdx: number, priorAssignedLabels: Uint8Array, cols: number, rows: number, dilateRadius: number): void;
|
2026-07-01 05:41:17 +00:00
|
|
|
/**
|
2026-07-02 02:07:32 +00:00
|
|
|
* After semantic segmentation, subdivide the wall region into wall-1, wall-2… by source image texture features
|
2026-07-01 05:41:17 +00:00
|
|
|
*/
|
|
|
|
|
export declare function splitWallRegionsByTexture(result: SegmentMaskResult, originBgr: Uint8Array, cols: number, rows: number, minArea: number): SegmentMaskResult;
|
|
|
|
|
export declare function isWallSubRegionName(name: string): boolean;
|