Thread Subject: save binary labeled images

Subject: save binary labeled images

From: Vicky

Date: 8 Nov, 2008 18:44:16

Message: 1 of 2

Hallo there,

When I save with the command "imwrite" a binary labeled image then the
image is saved as a rgb image. That means that each pixel has an rgb
value like (0, 0, 0) for the black background and (255, 255, 255) for
the objects. But in the saved image there are not the labels for each
object.

This is my code:

image1 = imread('test_001.bmp');
thresh = graythresh(image1);
image = im2bw(image1, thresh);

E = bwlabel(image);

imwrite(E, 'ttt.bmp', 'bmp');

Is it possible to save a binary labeled image so that in each pixel is
the label that I give to it and NOT the rgb values?

Best regards,
Vicky

Subject: save binary labeled images

From: ImageAnalyst

Date: 12 Nov, 2008 01:15:05

Message: 2 of 2

On Nov 8, 1:44=A0pm, Vicky <bonsa...@gmx.de> wrote:
> Hallo there,
>
> When I save with the command "imwrite" a binary labeled image then the
> image is saved as a rgb image. That means that each pixel has an rgb
> value like (0, 0, 0) for the black background and (255, 255, 255) for
> the objects. But in the saved image there are not the labels for each
> object.
>
> This is my code:
>
> image1 =3D imread('test_001.bmp');
> thresh =3D graythresh(image1);
> image =3D im2bw(image1, thresh);
>
> E =3D bwlabel(image);
>
> imwrite(E, 'ttt.bmp', 'bmp');
>
> Is it possible to save a binary labeled image so that in each pixel is
> the label that I give to it and NOT the rgb values?
>
> Best regards,
> Vicky

--------------------------------------
BMP is 24 bit RGB. Try saving as TIFF format.

Tags for this Thread

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.

rssFeed for this Thread

Contact us at files@mathworks.com