Skip to content
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

feat: add grey dilation and erosion operators #3

Merged
merged 5 commits into from
Dec 31, 2023
Merged

Conversation

william-silversmith
Copy link
Contributor

Did all this work for multi-label, why not add grayscale as well (spelled as the British English "grey" to harmonize with SciPy and Scikit-Image, what a headache that would be if they didn't agree!).

I decided to go with an enum for selecting the mode. Multi-label is the default. You can select grey with mode=fastmorph.Mode.grey.

@william-silversmith william-silversmith added the enhancement New feature or request label Dec 31, 2023
@william-silversmith
Copy link
Contributor Author

william-silversmith commented Dec 31, 2023

Performance tests on random 8-bit uint labels.

scipy grey_dilation: 17.8 sec
fastmorph grey_dilate / 1 thread: 4.0 sec (4.5x)
fastmorph grey_dilate / 2 threads: 2.9 sec (6.1x)
fastmorph grey_dilate / 4 threads: 2.5 sec (7.1x)

scipy grey_erosion: 19.1 sec
fastmorph grey_erode / 1 thread: 4.0 sec (4.8x)
fastmorph grey_erode / 2 threads: 2.9 sec (6.6x)
fastmorph grey_erode / 4 threads: 2.6 sec (7.3x)

@william-silversmith william-silversmith marked this pull request as ready for review December 31, 2023 06:43
@william-silversmith william-silversmith merged commit e8162fc into main Dec 31, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant