GrowCutComponents

GrowCutComponents[image,{marker1,marker2,}]

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.

Examples

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, https://reference.wolfram.com/language/ref/GrowCutComponents.html.

Text

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

CMS

Wolfram Language. 2014. "GrowCutComponents." Wolfram Language & System Documentation Center. Wolfram Research. 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

BibTeX

@misc{reference.wolfram_2024_growcutcomponents, author="Wolfram Research", title="{GrowCutComponents}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/GrowCutComponents.html}", note=[Accessed: 22-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_growcutcomponents, organization={Wolfram Research}, title={GrowCutComponents}, year={2014}, url={https://reference.wolfram.com/language/ref/GrowCutComponents.html}, note=[Accessed: 22-December-2024 ]}