I've implemented MATLABs bwmorph('thin',...): any interest?

240 views
Skip to first unread message

Joe Futrelle

unread,
Jan 5, 2016, 12:20:35 PM1/5/16
to scikit-image
Hello,

I have developed an efficient Python implementation of the algorithm used by MATLAB's bwmorph('thin', ...). I believe this differs from the skeletonization algorithm provided by skimage and could be useful for people porting MATLAB code.

https://gist.github.com/joefutrelle/562f25bbcf20691217b8

is this of interest? If so I could take the time to bring the coding style up to PEP8 and make a proper PR out of it.

- JF

Stéfan van der Walt

unread,
Jan 6, 2016, 6:14:56 AM1/6/16
to scikit-image
Hi Joe

On Tue, Jan 5, 2016 at 9:20 AM, Joe Futrelle <joefu...@gmail.com> wrote:
> I have developed an efficient Python implementation of the algorithm used by
> MATLAB's bwmorph('thin', ...). I believe this differs from the
> skeletonization algorithm provided by skimage and could be useful for people
> porting MATLAB code.

Have you also had a look at medial_axis? If it is different from
both, then it may be useful, especially if there is a clearly
specified paper on its implementation.

Stéfan

Joe Futrelle

unread,
Jan 6, 2016, 10:32:51 AM1/6/16
to scikit-image
Reading the code for medial_axis, that looks like a very different algorithm. MATLAB's docs reference the following paper section:

Lam, L., Seong-Whan Lee, and Ching Y. Suen, "Thinning Methodologies-A Comprehensive Survey," IEEE Transactions on Pattern Analysis and Machine Intelligence, Vol 14, No. 9, September 1992, page 879, bottom of first column through top of second column

Another open source implementation of this algorithm that I'm aware of is Octave's, which is here:

http://sourceforge.net/p/octave/image/ci/default/tree/inst/bwmorph.m#l499


same impl strategy as my version.

Joe Futrelle

unread,
Jan 7, 2016, 1:45:58 PM1/7/16
to scikit-image
I made a PR:

https://github.com/scikit-image/scikit-image/pull/1858

Travis builds for Python >2.7 are failing because of a warning about a duplicate citation in my inline docs--how can I fix this?

WARNING: duplicate citation R311, other instance in /home/travis/build/scikit-image/scikit-image/doc/source/api/skimage.restoration.txt

Reply all
Reply to author
Forward
0 new messages