-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Fast Marching method #45
Conversation
Signed-off-by: masadcv <[email protected]>
Signed-off-by: masadcv <[email protected]>
Signed-off-by: masadcv <[email protected]>
Signed-off-by: masadcv <[email protected]>
For clarity, it may be good to clean up a bit the pixel queue implementation. Maybe adding some comments to refer back to the algorithm described in Also, I would replace the hand-crafted heaps by a standard use of a For the fast marching, could you fetch the fast-marching-method repo or add it as a git submodule rather than copying the file here? |
Many thanks! I will look into FMM submodule bit, I would ideally like to keep installations hassle-free (e.g. pip install git+repo or pip install FastGeodis), which is one of the reason why I copied the file over. I will try submodules, if not then copy the working directory of FMM git as dependency like done in SimpleCRF here |
Signed-off-by: masadcv <[email protected]>
This now uses fmm external dependency as it is (not a submodule though) copied within |
Signed-off-by: masadcv <[email protected]>
@tvercaut This happens especially for signed distance calculation when image is bigger and only a single seed point is selected. I am unsure what is causing this, do you know? |
Signed-off-by: masadcv <[email protected]>
Signed-off-by: masadcv <[email protected]>
Signed-off-by: masadcv <[email protected]>
Signed-off-by: masadcv <[email protected]>
Fast marching uses the inverse of the speed and even the inverse of the square of the speed. The most likely explanation is that your speed contains too low values. Looking at FastGeodis/FastGeodis/geodis_fastmarch.cpp Line 183 in 100a4e4
I would be more conservative. At least use sqrt(machine_espilon) rather than machine_espilon. There might be other issues but I'll start with this. Also, unrelated to numerical stability but you should use the high-accuracy eikonal solver here: FastGeodis/FastGeodis/geodis_fastmarch.cpp Lines 47 to 51 in 100a4e4
|
I added a fallback in case the Eikonal equation is degenerate in this branch: Can you give it a try? |
Many thanks! Let me give it a try now. |
Signed-off-by: masadcv <[email protected]>
Signed-off-by: masadcv <[email protected]>
I have included both sqrt(eps) and degenerate fallback within this PR. It is stable now and works fine for all cases. I have also switched to high accuracy eikonal solver but have left in commented code for lower accuracy method if needed. Thanks once again for your help with FMM, it wouldn't have been possible without it. |
Signed-off-by: masadcv <[email protected]>
Nice. Thanks! |
Fixes #42 and issues raised in #40
This PR implements Fast Marching Method as indicated in #42
It has the following changes:
pixelqueue
method