mask = boundarymask(L) computes
a mask that represents the region boundaries for the input label matrix L.
The output, mask, is a logical image that is true at
boundary locations and false at non-boundary locations.
Create a superpixel representation of the image, returned as a label matrix.
L = superpixels(I,100);
Display the label matrix.
imshow(label2rgb(L))
Find the region boundaries of the label matrix.
mask = boundarymask(L);
Display the boundary mask over the original image by using the labeloverlay function. The region boundaries of the label matrix appear as 1-pixel wide cyan lines.
Pixels are connected if their edges touch. The neighborhood of a pixel
are the adjacent pixels in the horizontal or vertical
direction.
Current pixel is shown in gray.
8
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.
Current pixel is shown in gray.
Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32
Rasterized grid of region boundaries, specified as a 2-D logical matrix of the same size as
the input image. A pixel in mask is
true when the corresponding pixel in the input image
with value P has a neighboring pixel with a different
value than P.
boundarymask supports the generation of C
code (requires MATLAB®
Coder™). Note that if you choose the generic MATLAB Host Computer
target platform, 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 Types of Code Generation Support in Image Processing Toolbox.
When generating code, the input argument conn
must be a compile-time constant.
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window.
Web browsers do not support MATLAB commands.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.