Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Can nobody help me???
Date: Tue, 11 Nov 2008 15:53:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 25
Message-ID: <gfc9ou$33r$1@fred.mathworks.com>
References: <gfc8tj$4mb$1@aioe.org>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1226418782 3195 172.30.248.35 (11 Nov 2008 15:53:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 11 Nov 2008 15:53:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 791003
Xref: news.mathworks.com comp.soft-sys.matlab:500239


Vicky <bonsai19@gmx.de> wrote in message <gfc8tj$4mb$1@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.