MorphologicalBinarize
✖
MorphologicalBinarize
creates a binary image from image by replacing all values above the upper threshold t2 with 1, also including pixels with intensities above the lower threshold t1 that are connected to the foreground.
uses t as the upper threshold, automatically choosing a suitable value for the lower threshold.
Details and Options

- MorphologicalBinarize effectively performs hysteresis thresholding and is typically used as part of edge-detection methods.
- MorphologicalBinarize works with 2D as well as 3D images. It converts multichannel and color images into grayscale images, then produces an image in which every pixel has value 0 or 1.
- The following short forms can be used for the second argument:
-
t {Automatic,t} t1 computed automatically {t} {t,Automatic} t2 computed automatically {func} {t1,t2} t1=func[t2] with t2 automatic {t,func} {t,t2} t2=func[t] - The following options can be given:
-
CornerNeighbors True whether to include corner neighbors Method "Cluster" method to use to specify the upper threshold - MorphologicalBinarize[image,{t},Method->method] specifies the method to use to determine the threshold. See the reference page for FindThreshold for full documentation of available methods.
Examples
open allclose allBasic Examples (1)Summary of the most common use cases
Scope (6)Survey of the scope of standard use cases
Find connected foreground regions between the two specified thresholds:

https://wolfram.com/xid/0cf1mfbhsb0sshy-25qnud

Use a fixed upper threshold and compute the lower threshold automatically:

https://wolfram.com/xid/0cf1mfbhsb0sshy-86124r

Use a fixed lower threshold and compute the upper threshold automatically:

https://wolfram.com/xid/0cf1mfbhsb0sshy-wwehrc

Compute the lower threshold as a function of the automatically computed upper threshold:

https://wolfram.com/xid/0cf1mfbhsb0sshy-88jc12

Find the upper and lower thresholds automatically:

https://wolfram.com/xid/0cf1mfbhsb0sshy-gsymo9


https://wolfram.com/xid/0cf1mfbhsb0sshy-fccall

Options (3)Common values & functionality for each option
CornerNeighbors (2)
Applications (1)Sample problems that can be solved with this function
Properties & Relations (5)Properties of the function, and connections to other functions
With color images, the thresholding is performed on intensity values:

https://wolfram.com/xid/0cf1mfbhsb0sshy-jggcri

https://wolfram.com/xid/0cf1mfbhsb0sshy-d3w9k

With ColorSpace->Automatic multi-channel images, the mean of channel values is used:

https://wolfram.com/xid/0cf1mfbhsb0sshy-n6nsr5


https://wolfram.com/xid/0cf1mfbhsb0sshy-qe3ac6

If both the upper threshold and a Method option are specified, the method is ignored:

https://wolfram.com/xid/0cf1mfbhsb0sshy-vih21f

https://wolfram.com/xid/0cf1mfbhsb0sshy-zvz8ps

MorphologicalBinarize operates on pixel values considering neighboring pixel values:

https://wolfram.com/xid/0cf1mfbhsb0sshy-x061l6

Binarize operates on a pixel value regardless of neighboring pixels:

https://wolfram.com/xid/0cf1mfbhsb0sshy-rl17o

MorphologicalBinarize[image,{t1,t2}] is effectively the geodesic dilation of two binary images:

https://wolfram.com/xid/0cf1mfbhsb0sshy-xs3gux

The marker image is binarized using t2 and the mask image is binarized using t1:

https://wolfram.com/xid/0cf1mfbhsb0sshy-hrcdr6

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