RegionBinarize
✖
RegionBinarize
gives a binary version of image that includes the foreground pixels of marker and also connected regions whose pixel values are within a distance d.
grows regions in marker by adding pixels whose average intensity is also constrained within an interval {t1,t2}.
Details and Options


- RegionBinarize implements a variety of region-growing methods to find a binary segmentation of an image.
- RegionBinarize works with arbitrary 2D and 3D images.
- The target region marker can be any of the following:
-
markerimage a marker image {pos1,pos2,…} a list of positions - Positions posi are assumed to be in the standard image coordinate system.
- RegionBinarize[image,marker,d,backgroundmarker] grows regions starting from marker by adding only pixels that are not connected to backgroundmarker.
- The following options can be specified:
-
MaxIterations 1 maximum number of iterations to perform Method "MeanEuclidean" method used in computing pixel distances - With a setting MaxIterations->n, RegionBinarize is applied up to n times, using the previous result as the marker in each iteration.
- Setting for the Method option specifies how to compute the distance between the values of pixels to be added and the image region to be grown. Pixels are included in the segmentation only if the distance is less than or equal to d. Possible settings are:
-
"MeanEuclidean" Euclidean distance to the mean of the region to be grown "Mahalanobis" Mahalanobis distance - The "Mahalanobis" distance is a Euclidean distance with a metric that is the inverse of the covariance matrix of pixel values in the region to be grown. If the initial region consists of only one or two pixels, then the covariance matrix is computed from a range-1 neighborhood around those pixels.
- The possible range for the distance parameter d depends on the distance method as well as the dimension of the color space.

Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Scope (4)Survey of the scope of standard use cases
Binary segmentation of a grayscale image:

https://wolfram.com/xid/0g7ijzwns42-kcqrgf

Use a lower and upper threshold to limit the growing of the region:

https://wolfram.com/xid/0g7ijzwns42-3yd8

Grow the region by using only the constrained intensity values:

https://wolfram.com/xid/0g7ijzwns42-bh1wua

Use a background marker to segment a region from a background with a similar color:

https://wolfram.com/xid/0g7ijzwns42-c6lj7

Options (2)Common values & functionality for each option
MaxIterations (1)
Applications (3)Sample problems that can be solved with this function
Segmentation of an MRI image, highlighting a brain tumor:

https://wolfram.com/xid/0g7ijzwns42-p9ujoo


https://wolfram.com/xid/0g7ijzwns42-bi2p4a

Find the skin-colored region in a portrait:

https://wolfram.com/xid/0g7ijzwns42-e94nzq

Find a background mask using multiple marker regions:

https://wolfram.com/xid/0g7ijzwns42-bhldcp

https://wolfram.com/xid/0g7ijzwns42-b6r1dw

Use the negated mask as the alpha channel:

https://wolfram.com/xid/0g7ijzwns42-6jhe2g

Wolfram Research (2010), RegionBinarize, Wolfram Language function, https://reference.wolfram.com/language/ref/RegionBinarize.html (updated 2012).
Text
Wolfram Research (2010), RegionBinarize, Wolfram Language function, https://reference.wolfram.com/language/ref/RegionBinarize.html (updated 2012).
Wolfram Research (2010), RegionBinarize, Wolfram Language function, https://reference.wolfram.com/language/ref/RegionBinarize.html (updated 2012).
CMS
Wolfram Language. 2010. "RegionBinarize." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2012. https://reference.wolfram.com/language/ref/RegionBinarize.html.
Wolfram Language. 2010. "RegionBinarize." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2012. https://reference.wolfram.com/language/ref/RegionBinarize.html.
APA
Wolfram Language. (2010). RegionBinarize. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RegionBinarize.html
Wolfram Language. (2010). RegionBinarize. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RegionBinarize.html
BibTeX
@misc{reference.wolfram_2025_regionbinarize, author="Wolfram Research", title="{RegionBinarize}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/RegionBinarize.html}", note=[Accessed: 28-April-2025
]}
BibLaTeX
@online{reference.wolfram_2025_regionbinarize, organization={Wolfram Research}, title={RegionBinarize}, year={2012}, url={https://reference.wolfram.com/language/ref/RegionBinarize.html}, note=[Accessed: 28-April-2025
]}