Comments (1)
Dear Abed,
Thanks for the message. When I run this I get a different answer:
array([[ 1.70710678, 1. , 1.70710678],
[ 1. , 0. , 1. ],
[ 1.70710678, 1. , 1.70710678]])
What version are you using?
To address your question: I think this is an error inherent in the method. The good news is that the error is corrected as interface propagates outward. The maximum error in the method occurs along the diagonals and is greatest on the zero level set. Because of the way the gradient operator is discretized the diagonal points can only "see" the points to the N,S,E and W. They cannot "see" the central point. This is corrected as the interface marches out because points start to "see" the curvature of the interface via the N,S,E and W points.
The following shows that as the interface marches out the relative error decreases:
phi = np.ones((31, 31))
phi[15, 15] = 0
d = skfmm.distance(phi)
print d[-1,-1], d[0,0], d[-1,0], d[0,-1]
print (2*15.5**2 )**.5
21.4520926896 21.4520926896 21.4520926896 21.4520926896
21.9203102168
phi = np.ones((301, 301))
phi[150, 150] = 0
d = skfmm.distance(phi)
print d[-1,-1], d[0,0], d[-1,0], d[0,-1]
print (2*150.5**2 )**.5
212.348795302 212.348795302 212.348795302 212.348795302
212.839141137
There are some ways to improve this error. One method is to use a gradient stencil which accounts for the diagonal directions (See: M. Sabry Hassouna and Aly A. Farag, "Multistencils Fast Marching Methods: A Highly Accurate Solution to the Eikonal Equation on Cartesian Domains," IEEE Transaction on Pattern Analysis and Machine Intelligence PAMI, vol. 29, no. 9, pp. 1-12, Sep 2007.)
Another option is to reconstruct the zero level-set using multidimensional cubic interpolation to to better initialize the distance of the adjacent points. There is a new-init
branch where we experimented with this approach: https://github.com/scikit-fmm/scikit-fmm/tree/new-init There is also some discussion of this on the mailing list https://groups.google.com/forum/#!topic/scikit-fmm/labxaSVAUqA
from scikit-fmm.
Related Issues (20)
- Unable to use wheel with older versions of numpy HOT 2
- PyPI build seems to be broken HOT 4
- No wheels for python3.9 HOT 3
- Support for Python 3.10 HOT 7
- GIL is held while marching HOT 3
- Pip install broken on CIs HOT 4
- about cfmm HOT 1
- ValueError: the array phi contains no zero contour (no zero level set) HOT 1
- cannot import skfmm due to arm64 incompatibility? HOT 1
- Support for python 3.11 HOT 2
- Installation went well, but unable to import HOT 2
- Marching issue in a skeleton HOT 2
- numpy.distutils is no longer available in Python 3.12 HOT 26
- Inaccurate travel paths HOT 2
- Add a less formal introduction of FMM and what it can be used for in the README HOT 1
- error: Multiple top-level packages discovered in a flat-layout: ['skfmm', 'profile']. HOT 5
- Negative curvature of signed distance HOT 9
- a relevant way to cite scikit-fmm
- [Enhancement] Release GIL HOT 3
- Exact representation of contour HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scikit-fmm.