ChanVeseBinarize
finds a two-level segmentation of image by computing optimal contours around regions of consistent intensity in image.
Details and Options


- ChanVeseBinarize implements an iterative active contour method to achieve a two-level segmentation of image.
- ChanVeseBinarize works with arbitrary 2D as well as 3D images.
- The target region marker can be any of the following:
-
markerimage a marker image {pos1,pos2,…} a list of positions fgcolor foreground color {{fgcolor,bgcolor}} foreground and background colors - Positions posi are assumed to be in the standard image coordinate system.
- ChanVeseBinarize uses the Euclidean distance between channel vectors to determine the similarity between pixels inside and outside of the contour.
- The Chan–Vese segmentation of an image domain
into the two segments
and
with contour
minimizes the following functional
of image
:
-
- The functional is parametrized by the length penalty
, the area penalty
, and level penalties
and
.
- The Chan–Vese algorithm partitions image such that the first segment
will differ as little as possible from constant
and the second segment
will deviate as little as possible from constant
. If constants
and
are not specified, one assumes c1=Mean[f] in
, and c2=Mean[f] in
.
- The contour
between the two resulting segments
and
will exhibit a short length for
, and for
the area of
will tend to be small or for
tend to be large.
- ChanVeseBinarize iteratively minimizes a functional that is a weighted sum of the contour length, the enclosed area, and the deviation between the image and the two-level segmentation.
- The maximum number of iteration steps is given by the MaxIterations option with default setting 100.

Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Scope (8)Survey of the scope of standard use cases
Specify the foreground color to be used for an initial marker:

https://wolfram.com/xid/0cf1s4k3uf8x3pi-plu7e6

Specify both foreground and background colors for creating an initial marker:

https://wolfram.com/xid/0cf1s4k3uf8x3pi-hnccem

Use foreground edges as the marker image:

https://wolfram.com/xid/0cf1s4k3uf8x3pi-f68zoh


https://wolfram.com/xid/0cf1s4k3uf8x3pi-dnqsn1

Control the area of the segmented region:

https://wolfram.com/xid/0cf1s4k3uf8x3pi-b2beom

Increase the smoothness of the segmented region:

https://wolfram.com/xid/0cf1s4k3uf8x3pi-d456px

Increase the length penalty when segmenting noisy images:

https://wolfram.com/xid/0cf1s4k3uf8x3pi-eua76z

Increase the penalty for the segment to select background pixels:

https://wolfram.com/xid/0cf1s4k3uf8x3pi-iwapol

Increase the penalty for the segment to improve the segmentation of a satellite image:

https://wolfram.com/xid/0cf1s4k3uf8x3pi-eq472

Options (1)Common values & functionality for each option
Applications (3)Sample problems that can be solved with this function

https://wolfram.com/xid/0cf1s4k3uf8x3pi-c9qid7

Compose the separated foreground with a different background:

https://wolfram.com/xid/0cf1s4k3uf8x3pi-1b9zp

Find the precise contour of a coastline in a satellite image:

https://wolfram.com/xid/0cf1s4k3uf8x3pi-474zet

Improve text recognition of a noisy image:

https://wolfram.com/xid/0cf1s4k3uf8x3pi-jnj253


https://wolfram.com/xid/0cf1s4k3uf8x3pi-vhoj6c

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