segments part of image specified by marker and returns an image mask.

Details and Options

  • ImageSegmentationFilter segments objects or components of interest in an image and returns it as a single-channel image. It is also known as image matting and foreground separation.
  • The following marker specifications can be given:
  • possegments the component containing the position pos
    {pos1,pos2,}segments the component containing all posi
    Rectangle[]segments the component indicated by a bounding box
  • The following options can be given:
  • PerformanceGoal Automaticaspects of performance to try to optimize
    TargetDevice"CPU"the target device on which to perform training
  • Possible settings for PerformanceGoal include:
  • Automaticautomatic 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


open allclose all

Basic Examples  (2)

Get a mask for an object specified by a point:

Get a mask for a segment specified by a bounding box:

Scope  (1)

Use different markers to specify the objects to segment:

Use a single point:

Use multiple points as markers:

Get the mask:

Use a rectangle as a marker:

Get the mask:

Highlight the image with the computed mask:

Options  (1)

PerformanceGoal  (1)

Compare the result using "Speed":

Compare the result using "Quality":

Applications  (2)

Find a mask based on an image segment:

Blur the background to focus on the object of interest:

Segmenting a person in a Toulouse-Lautrec painting:

Wolfram Research (2023), ImageSegmentationFilter, Wolfram Language function,


Wolfram Research (2023), ImageSegmentationFilter, Wolfram Language function,


Wolfram Language. 2023. "ImageSegmentationFilter." Wolfram Language & System Documentation Center. Wolfram Research.


Wolfram Language. (2023). ImageSegmentationFilter. Wolfram Language & System Documentation Center. Retrieved from


@misc{reference.wolfram_2023_imagesegmentationfilter, author="Wolfram Research", title="{ImageSegmentationFilter}", year="2023", howpublished="\url{}", note=[Accessed: 21-April-2024 ]}


@online{reference.wolfram_2023_imagesegmentationfilter, organization={Wolfram Research}, title={ImageSegmentationFilter}, year={2023}, url={}, note=[Accessed: 21-April-2024 ]}