GrowCutComponents
✖
GrowCutComponents
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 True whether to include corner neighbors MaxIterations Automatic maximum number of iterations to use - With MaxIterations->Automatic the algorithm runs until convergence.

Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Grow-cut segmentation of an image:

https://wolfram.com/xid/0fq7yiv6we6r3-f2dbx4

Grow-cut binarization of a color image:

https://wolfram.com/xid/0fq7yiv6we6r3-f10jdh

Mask the image with the detected foreground area:

https://wolfram.com/xid/0fq7yiv6we6r3-e3ja2m


https://wolfram.com/xid/0fq7yiv6we6r3-noiej2

https://wolfram.com/xid/0fq7yiv6we6r3-cct95h

Options (2)Common values & functionality for each option
CornerNeighbors (1)
By default, CornerNeighbors->True is used:

https://wolfram.com/xid/0fq7yiv6we6r3-e8dnu2

Use CornerNeighbors->False:

https://wolfram.com/xid/0fq7yiv6we6r3-6ssej8

Applications (3)Sample problems that can be solved with this function
Use grow-cut segmentation to separate foreground and background in a complex image:

https://wolfram.com/xid/0fq7yiv6we6r3-49dfz4

https://wolfram.com/xid/0fq7yiv6we6r3-f1l6bp

https://wolfram.com/xid/0fq7yiv6we6r3-5cx7qp

Separate foreground and background in an image:

https://wolfram.com/xid/0fq7yiv6we6r3-ga1vjl

https://wolfram.com/xid/0fq7yiv6we6r3-qj9x14

https://wolfram.com/xid/0fq7yiv6we6r3-yevmn

Use the binary mask as an alpha channel:

https://wolfram.com/xid/0fq7yiv6we6r3-f35zc6

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

https://wolfram.com/xid/0fq7yiv6we6r3-7own58

Place the detected foreground on a different background:

https://wolfram.com/xid/0fq7yiv6we6r3-p8ecoh

https://wolfram.com/xid/0fq7yiv6we6r3-5os73p

https://wolfram.com/xid/0fq7yiv6we6r3-dswspw

Compose image foreground to a new background:

https://wolfram.com/xid/0fq7yiv6we6r3-y8hzkz

https://wolfram.com/xid/0fq7yiv6we6r3-khxtzc

Properties & Relations (3)Properties of the function, and connections to other functions
Switching the foreground and background marker will result in the complement mask:

https://wolfram.com/xid/0fq7yiv6we6r3-pkglte

https://wolfram.com/xid/0fq7yiv6we6r3-h3pcdu

https://wolfram.com/xid/0fq7yiv6we6r3-lvlpq9


https://wolfram.com/xid/0fq7yiv6we6r3-0ks4sv

Not all pixels are necessarily segmented:

https://wolfram.com/xid/0fq7yiv6we6r3-x6emzs

https://wolfram.com/xid/0fq7yiv6we6r3-5x7dng

https://wolfram.com/xid/0fq7yiv6we6r3-uphut8

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

https://wolfram.com/xid/0fq7yiv6we6r3-wjv9e3

https://wolfram.com/xid/0fq7yiv6we6r3-zeuo8h

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
]}
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
]}