File Exchange

image thumbnail

Active contours driven by local Gaussian distribution

version (982 KB) by li wang
This Matlab code implements a segmentation method using local Gaussian distribution fitting energy.


Updated 23 Apr 2020

View Version History

View License

This Matlab code implements a segmentation method using local Gaussian distribution fitting energy, proposed by Li Wang et al's in the paper "Active Contours Driven by Local Gaussian Distribution Fitting Energy. Signal Processing, 89(12), 2009, p. 2435-2447"
The local image intensities are described by Gaussian distributions with different means and variances. The energy minimization is achieved by an interleaved level set evolution and estimation of local intensity means and variances in an iterative process. The means and variances of local intensities are considered as spatially varying functions to handle intensity inhomogeneities and noise of spatially varying strength.
More source codes on image segmentation, such as infant or neonatal brain MR image segmentation using patch-based sparse representation and random forest with auto-context model, can be found in other published papers in the following website:

The code of patch-based sparse representation can be downloaded from here

Cite As

li wang (2021). Active contours driven by local Gaussian distribution (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (9)

Arash Rabbani

irfana bibi

Ratna raju

Hello li wang,
Thank you for your contribution to the image processing community. When I tested you code on Brain MRI image with MATLAB 2015b windows 64-bit, the final contour converged to the outside the desired boundary. Is there any way to initialize the curve on the Region of Interest(ROI), i.e how to place the initial curve on the ROI?
Thank you for your reply.


Shen Zhao


Thank you for the useful code.I have successfully run it on some MRI slices of my own.However when i use an image of size 512X512 i start getting complex values ph phi and contour cannot be drawn.I tried to fix the code but couldnt find the main line which should be fixed.Please help if you could by giving some hints .thanks


Thank you for this contribution.

muthu Kumar


Nice, good job!

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!