Sponsors

Tuesday, May 06, 2008

[MATLAB] How to Change the specified pixel value?

Here are 2 images. Original and Processed.



Original Image



Processed Image

















I want to check the white pixels on the Processed Image with 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.

No comments:

Post a Comment

Search

Google