Find region boundaries of segmentation
mask = boundarymask(L)
mask = boundarymask(BW)
mask = boundarymask(___,conn)
Read image into the workspace.
A = imread('kobi.png');
Create a superpixel representation of the image, returned as a label matrix.
L = superpixels(A,100);
Create the rasterized grid of the regions in the label matrix.
mask = boundarymask(L);
Display the boundary mask binary image.
L— Label matrix
Label matrix, specified as a 2-D numeric matrix of nonnegative numbers or a 2-D logical matrix.
BW— Binary image
Binary image, specified as a numeric or logical matrix of the same size as
conn— Pixel connectivity
Pixel connectivity, specified as
Pixels are connected if their edges touch. The neighborhood of a pixel are the adjacent pixels in the horizontal or vertical direction.
Pixels are connected if their edges or corners touch. The neighborhood of a pixel are the adjacent pixels in the horizontal, vertical, or diagonal direction.
mask— Rasterized grid of region boundaries
Rasterized grid of region boundaries, specified as a 2-D logical matrix of the same size as
the input image. A pixel in
true when the corresponding pixel in the input image
with value P has a neighboring pixel with a different
value than P.
Usage notes and limitations:
boundarymask supports the generation of C
code (requires MATLAB®
Coder™). Note that if you choose the generic
MATLAB Host Computer
boundarymask generates code that uses a precompiled,
platform-specific shared library. Use of a shared library preserves performance optimizations
but limits the target platforms for which code can be generated. For more information, see Code Generation Using a Shared Library.
When generating code, the input argument
be a compile-time constant.