f



Thinning a binary image

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?
0
12/11/2007 7:19:36 PM
comp.soft-sys.matlab 211264 articles. 26 followers. lunamoonmoon (257) is leader. Post Follow

2 Replies
847 Views

Similar Articles

[PageSpeed] 15

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.
0
steve.eddins (785)
12/11/2007 7:33:10 PM
> 
> Use bwmorph with the 'thin' option.

Thanks! That was EXACTLY what I was looking for!
0
12/11/2007 7:48:38 PM
Reply: