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

add alternative thinning method (skeletonize) #263

Merged
merged 1 commit into from
Sep 13, 2019

Conversation

armadillu
Copy link
Contributor

This adds alternative thin (skeletonize) implementation to the library.

The provided thin() doesn't always result the results I was expecting. For example, given this input:

Screen Shot 2019-04-17 at 17 17 07

The original thin() gets you this:

Screen Shot 2019-04-17 at 17 16 37

This new alternative implementation thin2() gets you this:

Screen Shot 2019-04-17 at 17 16 49

The implementation comes from here http://felix.abecassis.me/2011/09/opencv-morphological-skeleton/.

@roymacdonald
Copy link
Contributor

Hi Oriol!
did you test your PR against #256?

The thinning algorithm has been broken for a long while. I will try to benchmark these two different implementations later.
all the best

@armadillu
Copy link
Contributor Author

hmm no I never saw it, I wish I did bc it seems to be a better (althogh slower) algorythm.

@armadillu
Copy link
Contributor Author

mine should not conflict with anything, so Im pretty sure they can live side by side. I think it may be handy to have different implementations that perform to better/worse results at slower/faster speeds, maybe gather them all into a single thin() method with an enum argument with the algorythm name?

@roymacdonald
Copy link
Contributor

Hi. +1 for

maybe gather them all into a single thin() method with an enum argument with the algorythm name?

@roymacdonald
Copy link
Contributor

what do you mean by better results? shouldn't these be the same, just slower or faster algos?

@armadillu
Copy link
Contributor Author

there are different implementations of thining, I think its considered not deterministic. For example, the one I'm sending here ends up with lines that are not always 1-pixel thin as you can see in the 'i's and 't's.

@roymacdonald
Copy link
Contributor

I see. I had the idea that it had to always finish with a one pixel line.

@kylemcdonald
Copy link
Owner

thanks, i like the idea of these all living side-by-side, since they are all useful in slightly different situations. i might change the names a little in the future.

@kylemcdonald kylemcdonald merged commit 61616e9 into kylemcdonald:master Sep 13, 2019
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

Successfully merging this pull request may close these issues.

3 participants