Reputation: 1
in matlab I change the color of some pixels of an image to black but the color changes to blue. I can't understand the problem.My code is below. could any one help me?
img = imread('test.png');
for i = 1 : 200
for j = 1: 640
img(i,j) = 0;
end
end
Upvotes: 0
Views: 4753
Reputation: 124563
perhaps you have an RGB image, so you have to write:
img(i,j,:) = 0
you should also check the output of the following: class(img)
and size(img)
Upvotes: 1