FUNCTION REFERENCE
bwboundaries
Trace closed object and hole boundaries.
Trace closed object and hole boundaries.
Syntax
[B, L, N, A] = bwboundaries(BW, conn, options)conn is 4 or 8 (default 8). options is 'holes' (default) or 'noholes' and may follow BW directly. B is a column cell array of row-column coordinate matrices, with the starting pixel repeated at the end. Objects precede holes. N counts objects; L is a double label matrix including holes when requested. A is sparse logical with A(child,parent)=true. Labels follow column-major component discovery. Uses Moore-neighbour tracing with the directed-edge stopping criterion.
Example
[B,L,N,A]=bwboundaries(logical([1 1 1; 1 0 1; 1 1 1]))Differences from MATLAB: 2-D only; newer TraceStyle and CoordinateOrder options are not supported. Singleton boundaries repeat their sole pixel. Boundary workspace is limited to 524288 pixels.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.