Path: news.mathworks.com!newsfeed-00.mathworks.com!kanaga.switch.ch!switch.ch!news.belwue.de!news.uni-stuttgart.de!news.k-dsl.de!aioe.org!not-for-mail
From: Vicky <bonsai19@gmx.de>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Can nobody help me???
Date: Thu, 13 Nov 2008 13:21:12 +0100
Organization: Aioe.org NNTP Server
Lines: 60
Message-ID: <gfh642$6gh$1@aioe.org>
References: <gfc8tj$4mb$1@aioe.org> <gfc9ou$33r$1@fred.mathworks.com> <2002cdb8-6508-4455-a065-825124e142c0@q26g2000prq.googlegroups.com>
NNTP-Posting-Host: v8qQW+Qi/5NerJ9vT8kuWw.user.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
NNTP-Posting-Date: Thu, 13 Nov 2008 12:21:23 +0000 (UTC)
X-Notice: Filtered by postfilter v. 0.7.4
User-Agent: Thunderbird 2.0.0.14 (Windows/20080421)
Xref: news.mathworks.com comp.soft-sys.matlab:500597


Hi ImageAnalyst,

Thank you for your answer.
I saved it in tiff format but I still get rgb-values.

This is my code:

image1 = imread('org_001.bmp');
image1 = im2bw(image1);
L1 = bwlabel(image1, 8);
imwrite(L1/255, 'image.tiff')

In each pixel is an rgb value like (8, 8, 8) or (12, 12, 12). But I want 
that in each pixel is the label like 1, 2,...8,...12,...
That means that in each pixel should be a single scalar value and not 
the color.

What I'm doing wrong when saving?

Then I have a question. In my original rgb images are more than 256 
colors. Is it still possible to create a monochrome image, so that each 
color get a seperate label?

Can you please help me again?

Best regards,
Vicky




ImageAnalyst schrieb:
> On Nov 11, 10:53 am, "David" <d...@bigcompany.com> wrote:
>> Vicky <bonsa...@gmx.de> wrote in message <gfc8tj$4m...@aioe.org>...
>>> Hallo there,
>>> this is my code:
>>> image1 = imread('image1.bmp');
>>> image1 = im2bw(image1);
>>> M = bwlabel(image1, 8);
>>> imwrite(M, 'myImage.bmp');
>>> How can I save an image (bmp), so that in each pixel is the element of
>>> the matrice M?
>>> If I save the matrice M with the command "imwrite" in each pixel of the
>>> myImage.bmp is an rgb-value. But I don't want a rgb-value, I want the
>>> label (element) of the matrice M.
>>> How can I realize it?
>>> Please I need help!!!
>>> Best regards,
>>> Vicky
>> well, a bmp file is normally a simple rgb format.  read the help for imwrite and 
>> see if one of the other formats may be better for what you want.  or you may just 
>> want to save M to something else, like a mat file instead of as an image.- Hide 
>>quoted text -
>>
>> - Show quoted text -
> 
> ---------------------------------------------
> Correct.  Save in Tiff format instead.  It can take monochrome.
> Regards,
> ImageAnalyst