Path: news.mathworks.com!not-for-mail
From: "Dawn " <dawn_llc@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: How to Change the specified pixel value of an image?
Date: Tue, 6 May 2008 08:44:05 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 28
Message-ID: <fvp5ok$m4l$1@fred.mathworks.com>
Reply-To: "Dawn " <dawn_llc@hotmail.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1210063445 22677 172.30.248.38 (6 May 2008 08:44:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 6 May 2008 08:44:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1300642
Xref: news.mathworks.com comp.soft-sys.matlab:466855


Here are 2 images. Original and Processed.

Original:
http://bp2.blogger.com/_dY9PPdeLapU/SCAXQJWgxYI/AAAAAAAAAKI/
oA9Pewda5rA/s320/original.bmp

Processed:
http://bp0.blogger.com/_dY9PPdeLapU/SCAYApWgxZI/AAAAAAAAAKQ/
yrSxCKYLlIs/s320/processed.bmp

I want to check the white pixels on the Processed Image 
against the original. If they are white on the original, 
make it black. If not keep them white.

The code I tried is like this:

>> [row, col] = find(Processed == 1); %Obtain the 
coordinates of the white pixels
>> if Original(r,c) == 1 %If on the original the they are 
white
Processed(r,c) = 0;    %Make it black
end

Somehow the program doesn't work. It fails to remove any 
pixel on the Processed Image.

Can anyone tell me what is wrong with the code?