Path: news.mathworks.com!not-for-mail
From: "John D'Errico" <woodchips@rochester.rr.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: locating colored pixels in an image
Date: Sat, 18 Aug 2007 19:51:07 +0000 (UTC)
Organization: John D'Errico (1-3LEW5R)
Lines: 22
Message-ID: <fa7ijb$aht$1@fred.mathworks.com>
References: <fa4tcl$69q$1@fred.mathworks.com>
Reply-To: "John D'Errico" <woodchips@rochester.rr.com>
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 1187466667 10813 172.30.248.37 (18 Aug 2007 19:51:07 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 18 Aug 2007 19:51:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869215
Xref: news.mathworks.com comp.soft-sys.matlab:424426


"Craig " <hillx154@umn.edu> wrote in message 
<fa4tcl$69q$1@fred.mathworks.com>...
> I have an image (3000x2000 pixels).  I want to scan each 
> column at a time and look for the red pixels (R>200).  Most 
> pixels are just black.  When it finds a red pixel, I want 
> it to search forward and find how many consecutive red 
> pixels (R>200) there are.  Any ideas?  

Except that R >= 200 is not a good criterion for a color
being red.

patch(rand(3,1),rand(3,1),[201 0 0]/255)
patch(rand(3,1),rand(3,1),[201 255 255]/255)
patch(rand(3,1),rand(3,1),[150 0 0]/255)
patch(rand(3,1),rand(3,1),[201 150 0]/255)
patch(rand(3,1),rand(3,1),[201 0 150]/255)

http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?
objectId=12326&objectType=FILE

John