4.5

4.5 | 2 ratings Rate this file 174 downloads (last 30 days) File Size: 50.84 KB File ID: #23847

Sparse Field Methods for Active Contours

by Shawn Lankton

 

21 Apr 2009 (Updated 10 Jun 2009)

Code covered by BSD License  

Very fast implementation of level sets. 2D and 3D support, written in C++/MEX with MATLAB wrapper.

Download Now | Watch this File

File Information
Description

Active contour methods for image segmentation allow a contour to deform iteratively to partition an image into regions. Active contours are often implemented with level set methods because of their power and versatility. The primary drawback of level set methods is that they are slow to compute. This code implements the very efficient sparse field method (SFM) proposed by Whitaker. Specifically, the well-known Chan-Vese energy is minimized.

To run the MATLAB demo, simply unzip the file and run:

>>sfm_chanvese_demo

at the MATLAB prompt. On the first run, this will compile the MEX code on your machine and then run the demo. If the MEX compile fails, please check your MEX setup. The demo is for a 2D image, but the codes work for 3D images as well.

My hope is that other researchers wishing to quickly implement Whitaker’s method can use this information to understand the intricacies of the algorithm and enjoy the same SUBSTANTIAL speed-ups I have.

For a full technical report detailing the algorithm and implementation, please check this post:

[ http://www.shawnlankton.com/2009/04/sfm-and-active-contours ]

Required Products Image Processing Toolbox
MATLAB release MATLAB 7.7 (R2008b)
Other requirements C++ compiler to compile MEX files.
Zip File Content  
Other Files
license.txt,
sfm_chanvese_demo/airplane.png,
sfm_chanvese_demo/compile_sfm_chanvese.m,
sfm_chanvese_demo/energy3c.cpp,
sfm_chanvese_demo/energy3c.h,
sfm_chanvese_demo/llist.cpp,
sfm_chanvese_demo/llist.h,
sfm_chanvese_demo/lsops3c.cpp,
sfm_chanvese_demo/lsops3c.h,
sfm_chanvese_demo/sfm_chanvese.m,
sfm_chanvese_demo/sfm_chanvese_demo.m,
sfm_chanvese_demo/sfm_chanvese_mex.cpp,
sfm_chanvese_demo/sparse3c.h
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
22 Apr 2009 Romeil Sandhu

This is excellent! Very nicely written, and easy to integrate with an already on-going project. It does what it says -- provides a fast implementation of level sets. Great job.

30 Apr 2009 Sebastien Paris

Works fine. Thank you. Do you plan to include "multiphase" version ?. One point Segmentation fault when compiled with Intel compiler, ok with LCC or MSVC ... I'll look inside when I'll have time ...

01 May 2009 Sebastien Paris

Ok I found the bug. Please add "return newll;" in the end of ll_create() function ... Compile fine with Intel ICC right now (around 41% faster than MSVC for my laptop)

Please also compile with the -v option to verbose unused variables and remove them.

10 Jun 2009 Shawn Lankton

Thanks Sebastien. The bug is FIXED now.

Please login to add a comment or rating.
Updates
29 Apr 2009

Fixed bug in the prototype for ls_iteration()

10 Jun 2009

Fixed some bugs, and updated the demo script. Thanks to Sebastien Paris for pointing out a bug in the comments! FIXED.

Tag Activity for this File
Tag Applied By Date/Time
computer vision Shawn Lankton 21 Apr 2009 13:16:39
segmentation Shawn Lankton 21 Apr 2009 13:16:39
active contours Shawn Lankton 21 Apr 2009 13:16:39
level sets Shawn Lankton 21 Apr 2009 13:16:39
mex Shawn Lankton 21 Apr 2009 13:16:39
whitaker Shawn Lankton 21 Apr 2009 13:16:39
chanvese Shawn Lankton 21 Apr 2009 13:16:39
image processing Shawn Lankton 21 Apr 2009 13:16:39
sparse Shawn Lankton 21 Apr 2009 13:16:39
lists Shawn Lankton 21 Apr 2009 13:16:39
chan vese Shawn Lankton 21 Apr 2009 13:16:39
lists Sebastien Paris 30 Apr 2009 13:44:36
level sets Sebastien Paris 30 Apr 2009 13:44:40
demo Shawn Lankton 10 Jun 2009 11:15:34
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com