Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
removal of branches from skeleton

Subject: removal of branches from skeleton

From: GEORGE

Date: 20 Jan, 2005 07:02:48

Message: 1 of 3

Hi,

has anyone come up with a problem of the following type:

I have an image and by using the 'bwmorph' command I managed to
create the skeleton of it.

I want to be able to remove the smallest branches of the skeleton and
keep the biggest ones. I know that somehow I have to label them and
differentiate them from the rest. Is there any command that I could
use to do it?

Thanks

George

Subject: removal of branches from skeleton

From: Joe Sababa

Date: 21 Jan, 2005 11:58:43

Message: 2 of 3

GEORGE wrote:
>
>
> Hi,
>
> has anyone come up with a problem of the following type:
>
> I have an image and by using the 'bwmorph' command I managed to
> create the skeleton of it.
>
> I want to be able to remove the smallest branches of the skeleton
> and
> keep the biggest ones. I know that somehow I have to label them and
> differentiate them from the rest. Is there any command that I could
> use to do it?
>
> Thanks
>
> George

Hi,
1)remove all tails from your skelton , S, to get a new matrix, K.
This can be done by 'shrink' or 'spur', I can't recall.
2) Subtract K from S to get a matrix of tails, T.
3) Spur (bwmorph( ,'spur') T [n/2] times and clean once to get ride
of tails shorter than n pixels.
4)Dilate the result matrix [n/2] times and add the result to the
matrix K (created at step (1)) to get S1.
5) Skelton S1.

Joe Sababa

BSTeX - Equation viewer for Matlab
 <http://www.geocities.com/bstex2001/>

Subject: removal of branches from skeleton

From: xiaoan

Date: 5 Nov, 2012 01:14:11

Message: 3 of 3

GEORGE <g.hayes@yahoo.com> wrote in message <eef9252.-1@webx.raydaftYaTP>...
> Hi,
>
> has anyone come up with a problem of the following type:
>
> I have an image and by using the 'bwmorph' command I managed to
> create the skeleton of it.
>
> I want to be able to remove the smallest branches of the skeleton and
> keep the biggest ones. I know that somehow I have to label them and
> differentiate them from the rest. Is there any command that I could
> use to do it?
>
> Thanks
>
> George

Hi:
I also have the same problem. I just figured out a better way.
Try the following sample codes
BW = imread('test.png');
imshow(BW);
BW1 = bwmorph(BW,'skel',inf);
figure, imshow(BW1);

You will definitely find the line is shorter than expected to be.
So what you need you is just apply interpolation to reconstruct the line.
Let me know if you have any other question.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us