Thread Subject: Thinning a binary image

Subject: Thinning a binary image

From: Volker K

Date: 11 Dec, 2007 19:19:36

Message: 1 of 3

Hi all!

I have a binary image with coastlines as white pixels. The
coast line is very "thick" and I would like to thinnen it to
a minimum of pixels.

The image matrix could look like this:

0 0 0 0 0 0 1 0
0 0 0 0 1 1 1 0
0 0 0 1 1 1 0 0
0 1 1 1 1 0 0 0
1 1 0 0 0 0 0 0

but should look like this:

0 0 0 0 0 0 1 0
0 0 0 0 0 0 1 0
0 0 0 0 0 1 0 0
0 0 1 1 1 0 0 0
1 1 0 0 0 0 0 0

I have already tried bwtraceboundary but that doesn't work.

anyone has an idea?

Subject: Thinning a binary image

From: Steve Eddins

Date: 11 Dec, 2007 19:33:10

Message: 2 of 3

Volker K wrote:
> Hi all!
>
> I have a binary image with coastlines as white pixels. The
> coast line is very "thick" and I would like to thinnen it to
> a minimum of pixels.
>
> The image matrix could look like this:
>
> 0 0 0 0 0 0 1 0
> 0 0 0 0 1 1 1 0
> 0 0 0 1 1 1 0 0
> 0 1 1 1 1 0 0 0
> 1 1 0 0 0 0 0 0
>
> but should look like this:
>
> 0 0 0 0 0 0 1 0
> 0 0 0 0 0 0 1 0
> 0 0 0 0 0 1 0 0
> 0 0 1 1 1 0 0 0
> 1 1 0 0 0 0 0 0
>
> I have already tried bwtraceboundary but that doesn't work.
>
> anyone has an idea?

Use bwmorph with the 'thin' option.

Subject: Thinning a binary image

From: Volker K

Date: 11 Dec, 2007 19:48:38

Message: 3 of 3


>
> Use bwmorph with the 'thin' option.

Thanks! That was EXACTLY what I was looking for!

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
image Volker Klink 11 Dec, 2007 14:20:01
thinning Volker Klink 11 Dec, 2007 14:20:01
binary Volker Klink 11 Dec, 2007 14:20:01
rssFeed for this Thread

Contact us at files@mathworks.com