Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: how can I label segmented images
Date: Fri, 31 Oct 2008 16:20:02 +0000 (UTC)
Organization: Atlantic Inertial Systems
Lines: 25
Message-ID: <gefb7i$1a1$1@fred.mathworks.com>
References: <gea0gi$nq2$1@aioe.org> <1d3ccafc-fd44-49cc-b289-f8c5f322f641@t42g2000hsg.googlegroups.com> <geephe$5m2$1@aioe.org> <45e80e7d-08ae-4b57-b846-e656ae560989@s9g2000prm.googlegroups.com> <geevn9$s8t$1@aioe.org> <gef3t8$r8s$1@fred.mathworks.com> <gef5ad$d9u$1@aioe.org>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1225470002 1345 172.30.248.37 (31 Oct 2008 16:20:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 31 Oct 2008 16:20:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1405925
Xref: news.mathworks.com comp.soft-sys.matlab:498302


Vicky <bonsai19@gmx.de> wrote in message 

> it's a good idea to copy each color out. 
Then every color get an label. 
.
> The background is 0 and the colored object get the label 1. 
.
It sounds like at this step you are capable of making an "image" which is the binary representation of a color.  In my example I'm going to assume there are 4 colors, {red, green, blue, black}.  You get 3 "images" that I'll call {iRed, iGreen, iBlue}
.
> The object get the label 1 in each seperated image. 
.
So each of these "images" is a matrix full of 1's and 0's
.
> If I bring the sepearted images together again 
>(with an image addition) all the objects have the label 1. 
>And so I can't distinguish the different colors.
.
So change the ones to something else.  The easy way is multiplying each "image".
iRed = iRed;  % leave as 1
iBlue = iBlue * 2;  % change to label 2
iGreen = iGreen * 3; % change to label 3
.
Now if you add them together they won't all be 1.
.
~Adam