label2rgb
Convert label matrix into RGB image
Syntax
Description
converts a label image, RGB
= label2rgb(L
)L
into an RGB color image for the
purpose of visualizing the labeled regions. The label2rgb
function determines the color to assign to each object based on the number of
objects in the label matrix. The label2rgb
function picks
colors from the entire range of the colormap.
controls how RGB
= label2rgb(L
,cmap
,zerocolor
,colorAssignment
)label2rgb
assigns colors to regions in the label
matrix.
enables you to specify that the function return a list of unique colors instead of
an RGB image.RGB
= label2rgb(___,OutputFormat=outputFormat
)
Before R2021a, use the equivalent syntax RGB =
label2rgb(__,"OutputFormat",outputFormat)
Examples
Input Arguments
Output Arguments
Extended Capabilities
Version History
Introduced before R2006aSee Also
bwconncomp
| bwlabel
| bwlabeln
| colormap
| ismember
| labelmatrix
| watershed
Topics
- Get Started with Image Segmentation
- Get Started with Semantic Segmentation Using Deep Learning (Computer Vision Toolbox)