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

Using Scipy.ndimage to speedup label2rgb #3343

Open
cmarshak opened this issue Aug 12, 2018 · 2 comments
Open

Using Scipy.ndimage to speedup label2rgb #3343

cmarshak opened this issue Aug 12, 2018 · 2 comments

Comments

@cmarshak
Copy link

cmarshak commented Aug 12, 2018

Description

I wanted to propose an application of scipy.ndimage.measurements to speed up color.label2rgb in case it might be helpful to the project.

I have been experimenting with superpixel segmentations, but found the biggest bottleneck for larger images was computing superpixel statistics, e.g. color.label2rgb as seen in this demo.

A scipy module for this type of analysis can be found in scipy.ndimage.measurements. I found this module capable of supporting most analyses and to be fast on very large images. For example, the equivalent of the lines in labels2rgb can be replaced by labeled_comprehension or mean.

I created a gist to demonstrate the speedup, albeit on the small astronaut image.

If this not deemed useful for this project, I hope the record of this issue might be helpful for others doing similar experiments with scikits wonderful superpixel library.

@soupault
Copy link
Member

@cmarshak Thank you very much for performing the preliminary benchmark! I'd support your proposal as I find label2rgb very useful in many occasions. Would you like to go forward and submit a pull request with the proposed change?

@cmarshak
Copy link
Author

Sure - I created it using the gist code. Thank you, @soupault.

#3344

@soupault soupault modified the milestones: 0.15, 0.16 Apr 20, 2019
@sciunto sciunto modified the milestones: 0.16, 0.17 Jul 17, 2019
@scikit-image scikit-image locked and limited conversation to collaborators Oct 18, 2021
@scikit-image scikit-image unlocked this conversation Mar 27, 2022
@grlee77 grlee77 reopened this Mar 27, 2022
@jarrodmillman jarrodmillman modified the milestones: 0.17, 0.20 Jun 4, 2022
@lagru lagru removed this from the 0.20 milestone Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants