creates a segmentation from image by growing each markeri.

Details and Options

  • GrowCutComponents models the image using cellular automata where the automata evolution leads to an image segmentation.
  • GrowCutComponents works with arbitrary 2D and 3D images.
  • Each marker markeri can be given either as an image or a list of points in the standard image coordinate system.
  • The following options can be specified:
  • CornerNeighbors Truewhether to include corner neighbors
    MaxIterations Automaticmaximum number of iterations to use
  • With MaxIterations->Automatic the algorithm runs until convergence.


open allclose all

Basic Examples  (3)

Grow-cut segmentation of an image:

Grow-cut binarization of a color image:

Mask the image with the detected foreground area:

Segment a 3D image:

Options  (2)

CornerNeighbors  (1)

By default, CornerNeighbors->True is used:

Use CornerNeighbors->False:

MaxIterations  (1)

By default, the algorithm is iterated until convergence:

Specify the number of iterations:

Applications  (3)

Use grow-cut segmentation to separate foreground and background in a complex image:

Separate foreground and background in an image:

Use the binary mask as an alpha channel:

Blur the binary mask for a smoother separation of foreground and background:

Place the detected foreground on a different background:

Detect the foreground:

Compose image foreground to a new background:

Properties & Relations  (3)

Switching the foreground and background marker will result in the complement mask:

Not all pixels are necessarily segmented:

Use ArrayComponents to relabel the array and convert the label matrix into an Image object:

Wolfram Research (2014), GrowCutComponents, Wolfram Language function,


Wolfram Research (2014), GrowCutComponents, Wolfram Language function,


Wolfram Language. 2014. "GrowCutComponents." Wolfram Language & System Documentation Center. Wolfram Research.


Wolfram Language. (2014). GrowCutComponents. Wolfram Language & System Documentation Center. Retrieved from


@misc{reference.wolfram_2024_growcutcomponents, author="Wolfram Research", title="{GrowCutComponents}", year="2014", howpublished="\url{}", note=[Accessed: 14-June-2024 ]}


@online{reference.wolfram_2024_growcutcomponents, organization={Wolfram Research}, title={GrowCutComponents}, year={2014}, url={}, note=[Accessed: 14-June-2024 ]}