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

proposal: add SLIC superpixel algorithm #53

Open
Cuda-Chen opened this issue Jul 27, 2020 · 9 comments
Open

proposal: add SLIC superpixel algorithm #53

Cuda-Chen opened this issue Jul 27, 2020 · 9 comments

Comments

@Cuda-Chen
Copy link

Recently, I wrote a SLIC superpixel algorithm in pure Julia.
For watching this repo almost a year, I found there was no one add SLIC into ImageSegmentation.jl.
Therefore, I would like to add my implementation, though it needs a lot of reworking to fit into.

@johnnychen94
Copy link
Member

johnnychen94 commented Jul 27, 2020

There's a WIP PR johnnychen94/SuperPixels.jl#2 that I failed to continue because I'm unsure how to enforce pixel connectivity when I wrote that. If you're interested, could you help finish that part?

I've introduced a SuperPixel struct to make post-processing easier there.

@Cuda-Chen
Copy link
Author

@johnnychen94 I think I can give it a try :)

By the way, will prune_segments be a good start of enforce connectivity?

@johnnychen94
Copy link
Member

By the way, will prune_segments be a good start of enforce connectivity?

Probably! TBH I'm don't have much knowledge of image segmentation, I suggest we follow the original implementation unless we know what's actually happening there.

Ha, I just saw your note that "Current I do not implement enforce connectivity part." 😄

@Cuda-Chen
Copy link
Author

OK, I will realize how the original implementation does on enforce connectivity.
And we can watch how PSMM does on enforce connectivity, too.

@johnnychen94
Copy link
Member

johnnychen94 commented Jul 27, 2020

And we can watch how PSMM does on enforce connectivity, too.

Yes, it could be a good recourse, the only issue is that PSMM doesn't have a license file. We may need to list it as a reference if you find it useful.

On the other hand, scikit-image is a better resource as it has a clear license (Modified BSD).

Cref: JuliaImages/ImageFiltering.jl#81 (comment)

@Cuda-Chen
Copy link
Author

Cuda-Chen commented Jul 27, 2020

After reading your comment, I have to admit my SLIC implementation in Julia have reference laixintao's work.

I have added the reference in my Julia SLIC repo as a good practice.

@jsundram
Copy link
Contributor

jsundram commented Feb 9, 2021

Is this work still in progress? Or do folks just use https://github.com/johnnychen94/SuperPixels.jl for SLIC?

@johnnychen94
Copy link
Member

johnnychen94 commented Feb 10, 2021

Still in WIP, I need to work through johnnychen94/SuperPixels.jl#6 first to find out what the best type design is in Julia. Hopefully, we could work on ImageSegmentation.jl to merge everything in SuperPixels.jl.

FYI, with @Cuda-Chen's help, a working SLIC version is available in the analyze branch (https://github.com/johnnychen94/SuperPixels.jl/blob/analyze/src/analyze.jl), it's usable but I'm not satisfied with the internal type design in SuperPixels and I plan to rework it entirely so I haven't make a release yet.

@jsundram
Copy link
Contributor

jsundram commented Feb 18, 2021

Thanks @johnnychen94! This code works for me -- I wonder if you are open to just having _slic return a SegmentedImage type (which is what the rest of ImageSegmentation.jl returns)? I've reworked the code in analyze branch to do that . . . it looks as follows (see the SegmentedImage function at the bottom of the file)

https://gist.github.com/jsundram/e78bc63cb131fb66cb7c811bdd9a3e0e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants