How can i find a medial axis without using bwmorph?

1 view (last 30 days)
gshs
gshs on 18 Jul 2014
Answered: DGM on 1 May 2023
Hi,
How can i find a medial axis without using bwmorph?
Thanks.

Answers (2)

Image Analyst
Image Analyst on 18 Jul 2014
You can probably find skeletonization code somewhere on the net. Just do a search.

DGM
DGM on 1 May 2023
If you're trying to avoid bwmorph() specifically for some arbitrary reason, you can use bwskel().
On the other hand, if you're trying to avoid things which require Image Processing Toolbox, then you can use MIMT morphnhood(). It has similar options and syntax as bwmorph(), and for this specific usage, is a drop-in replacement.
% a grayscale image
inpict = imread('threads.png');
% converted to logical
mask = inpict < 150;
%outpict = bwmorph(mask,'skel',Inf); % IPT bwmorph()
outpict = morphnhood(mask,'skel',Inf); % MIMT morphnhood()
imshow(outpict)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!