5.0

5.0 | 3 ratings Rate this file 293 downloads (last 30 days) File Size: 65.14 KB File ID: #24531

Accurate Fast Marching

by Dirk-Jan Kroon

 

23 Jun 2009 (Updated 01 Oct 2009)

Code covered by BSD License  

Multistencils second order Fast Marching 2D and 3D including rk4 shortest path tracing

Download Now | Watch this File

File Information
Description

Description:
The function MSFM2D/MSFM3D calculates the shortest distance from a list of points to all other pixels in an 2D or 3D image, using the Multistencil Fast Marching Method (MSFM). This method gives more accurate distances by using second order derivatives and cross neighbors.

The function SHORTESTPATH traces the shortest path from start point to source point using Runge Kutta 4 in the 2D or 3D distance map.

Implementation:
The 2D fast marching method is implemented in both Matlab-code and c-code. The c-code uses a custom build unsorted binary tree minimum search which out performs a normal binary sorted tree. The c-code is more than 500 times as fast as the matlab-code (compiled with the Microsoft Visual compiler).

Literature:
We used two papers:
- J. Andreas Baerentzen "On the implementation of fast marching methods for 3D lattices"
 - M. Sabry Hassouna et al. "Multistencils Fast Marching Methods: A Highly Accurate Solution to the Eikonal Equation on Cartesian Domains"

We compared the results of our implementation with the results in the paper:
- Normal fast marching 1th order, exact the same results.
- 2th order, significant smaller errors than in the paper.
- Multistencil 1th order, larger errors than in the paper
- Multistencil 2th order, significant worse results than published in the paper.

We also compared our implementation with another independent implementation to see if we made some errors in the multistencil extension, but got exact the same results.
Conclusion, enable 2th order or Multistencil but not at the same time because it will not give better results, at least with our implementation.

Examples:
Compile the c-code with mex msfm2d.c; mex msfm3d.c; mex rk4.c;

Try the examples in the help of msfm2d and shortestpath

MATLAB release MATLAB 7.8 (R2009a)
Zip File Content  
Other Files license.txt,
maze.gif,
msfm2d.c,
msfm2d.m,
msfm3d.c,
msfm3d.c~,
msfm3d.m,
rk4.c,
rk4.m,
shortestpath.m
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
24 Jun 2009 Sebastien Paris

Fast and work perfectly. Very usefull for Path Planning

07 Aug 2009 Petros Mpogiatzis

Great submition, works perfectly, simple to understand how it works, well done!

27 Aug 2009 Nora

Nice submission, works perfectly, and well commented. Thank you!
One thing I was wondering:
Is it possible to give a maximum distance to compute, and not fill the entire image with correct distances? In my problem that would speed up computation considerably.

Furthermore, I deleted the line
if(itt==652221) { printf("569 \n"); }
in msfm2d.c as it put my command window full with 569s.

22 Oct 2009 Matteo

Does this work with R2007a? Thank you

Please login to add a comment or rating.
Updates
23 Jun 2009

text

28 Sep 2009

Changed c-code comments // to /* */
In help added, that speed function must be larger than zero

01 Oct 2009

Linux Ubuntu Tested

Tag Activity for this File
Tag Applied By Date/Time
msfm Dirk-Jan Kroon 23 Jun 2009 12:39:33
multistencils Dirk-Jan Kroon 23 Jun 2009 12:39:33
multi stencils Dirk-Jan Kroon 23 Jun 2009 12:39:33
fast marching Dirk-Jan Kroon 23 Jun 2009 12:39:33
eikonal Dirk-Jan Kroon 23 Jun 2009 12:39:33
equation Dirk-Jan Kroon 23 Jun 2009 12:39:33
shortest path Dirk-Jan Kroon 23 Jun 2009 12:39:33
binary tree Dirk-Jan Kroon 23 Jun 2009 12:39:33
 

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