ImageSegmentationComponents
ImageSegmentationComponents[image]
performs a global segmentation of image and returns a label matrix of components.
ImageSegmentationComponents[image,spec]
segments an image into components based on the given spec.
ImageSegmentationComponents[video,…]
segments frames of video.
Details and Options
![](Files/ImageSegmentationComponents.en/details_1.png)
- ImageSegmentationComponents is a high-level image segmentation that can either segment the whole image or segment specified objects and components in an image.
- The following specifications spec can be given:
-
pos segments a component specified by an {x,y} coordinate {pos1,pos2,…} attempts to segment the image into components corresponding to every posi {{pos11,pos12,…},{pos21,…},…} specify each component with a list of positions Rectangle[…] specify each component with a bounding box {Rectangle[…],Rectangle[…],…} a list of bounding boxes, one for each component - When multiple positions or rectangles are provided, a segment is computed for every marker. If different markers generate significantly overlapping components, the less dominant segment will be suppressed.
- The following options can be given:
-
PerformanceGoal Automatic aspects of performance to try to optimize TargetDevice "CPU" the target device on which to perform training - Possible settings for PerformanceGoal include:
-
Automatic automatic tradeoff between speed and quality "Balanced" medium quality for average speed "Quality" optimize for quality of final results "Speed" optimize for speed of getting results
![](Files/ImageSegmentationComponents.en/Image_1.gif)
Examples
open allclose allScope (3)
Segment an image and colorize the segments:
Highlight segments on the image:
Generate a mask for a segment indicated by a list of positions:
Highlight the specified target points as well as the segmentation on the image:
Generate a mask for a segment inside a bounding box:
Highlight the bounding box as well as the segmentation on the image:
Options (1)
Text
Wolfram Research (2024), ImageSegmentationComponents, Wolfram Language function, https://reference.wolfram.com/language/ref/ImageSegmentationComponents.html (updated 2025).
CMS
Wolfram Language. 2024. "ImageSegmentationComponents." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/ImageSegmentationComponents.html.
APA
Wolfram Language. (2024). ImageSegmentationComponents. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ImageSegmentationComponents.html