WOLFRAM

GrowCutComponents[image,{marker1,marker2,}]

creates a segmentation from image by growing each markeri.

GrowCutComponents[video,]

returns segmentation for each frame in video.

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.

Examples

open allclose all

Basic Examples  (3)Summary of the most common use cases

Grow-cut segmentation of an image:

Out[1]=1

Grow-cut binarization of a color image:

Out[1]=1

Mask the image with the detected foreground area:

Out[2]=2

Segment a 3D image:

Out[2]=2

Options  (2)Common values & functionality for each option

CornerNeighbors  (1)

By default, CornerNeighbors->True is used:

Out[2]=2

Use CornerNeighbors->False:

Out[3]=3

MaxIterations  (1)

By default, the algorithm is iterated until convergence:

Out[36]=36

Specify the number of iterations:

Out[38]=38

Applications  (3)Sample problems that can be solved with this function

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

Out[4]=4

Separate foreground and background in an image:

Out[3]=3

Use the binary mask as an alpha channel:

Out[4]=4

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

Out[5]=5

Place the detected foreground on a different background:

Detect the foreground:

Out[3]=3

Compose image foreground to a new background:

Out[5]=5

Properties & Relations  (3)Properties of the function, and connections to other functions

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

Out[3]=3
Out[4]=4

Not all pixels are necessarily segmented:

Out[3]=3

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

Out[2]=2
Wolfram Research (2014), GrowCutComponents, Wolfram Language function, https://reference.wolfram.com/language/ref/GrowCutComponents.html (updated 2025).
Wolfram Research (2014), GrowCutComponents, Wolfram Language function, https://reference.wolfram.com/language/ref/GrowCutComponents.html (updated 2025).

Text

Wolfram Research (2014), GrowCutComponents, Wolfram Language function, https://reference.wolfram.com/language/ref/GrowCutComponents.html (updated 2025).

Wolfram Research (2014), GrowCutComponents, Wolfram Language function, https://reference.wolfram.com/language/ref/GrowCutComponents.html (updated 2025).

CMS

Wolfram Language. 2014. "GrowCutComponents." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/GrowCutComponents.html.

Wolfram Language. 2014. "GrowCutComponents." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/GrowCutComponents.html.

APA

Wolfram Language. (2014). GrowCutComponents. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GrowCutComponents.html

Wolfram Language. (2014). GrowCutComponents. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GrowCutComponents.html

BibTeX

@misc{reference.wolfram_2025_growcutcomponents, author="Wolfram Research", title="{GrowCutComponents}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/GrowCutComponents.html}", note=[Accessed: 29-March-2025 ]}

@misc{reference.wolfram_2025_growcutcomponents, author="Wolfram Research", title="{GrowCutComponents}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/GrowCutComponents.html}", note=[Accessed: 29-March-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_growcutcomponents, organization={Wolfram Research}, title={GrowCutComponents}, year={2025}, url={https://reference.wolfram.com/language/ref/GrowCutComponents.html}, note=[Accessed: 29-March-2025 ]}

@online{reference.wolfram_2025_growcutcomponents, organization={Wolfram Research}, title={GrowCutComponents}, year={2025}, url={https://reference.wolfram.com/language/ref/GrowCutComponents.html}, note=[Accessed: 29-March-2025 ]}