Code covered by the BSD License  

Highlights from
Sparse Field Methods for Active Contours

4.66667

4.7 | 3 ratings Rate this file 44 Downloads (last 30 days) File Size: 50.8 KB File ID: #23847
image thumbnail

Sparse Field Methods for Active Contours

by

 

21 Apr 2009 (Updated )

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

| 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.
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (8)
16 Apr 2013 Vincent Gigot

It does not seem to work on my Matlab version (R2012b).
Following error message that seems to comme from the compilation, I'va got the compiler toolbox :
"""Compiling sfm_chanvese_mex...
Error: Could not detect a compiler on local system
which can compile the specified input file(s)
Error using mex (line 206)
Unable to complete successfully.

Error in compile_sfm_chanvese (line 6)
mex sfm_chanvese_mex.cpp llist.cpp energy3c.cpp lsops3c.cpp

Error in sfm_chanvese (line 26)
compile_sfm_chanvese

Error in sfm_chanvese_demo (line 18)
[seg] = sfm_chanvese(img,mask,iterations,lambda);"""

16 Jul 2012 Robert  
24 Jan 2012 Anusha

How can I implement this as 3D level set?

24 Nov 2009 Alex Kararg

Could you please help on how I could use your algorithm with 3D images? I have the x,y,z coordinates of the points. I am kind of new to matlab.

10 Jun 2009 Shawn Lankton

Thanks Sebastien. The bug is FIXED now.

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.

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 ...

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.

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.

Contact us