Below is my code
im = imread('test.png');imshow(im);[rows columns] = size(im);numberOfPixels = rows*columns;r_t = 0;Red = im(:,:,1);pixel = 0;for i=1:rows for j=1:columns red = impixel(Red,i,j); if red == 255 r_t = r_t + 0; else r_t = r_t + red; end endend
when i type impixel(Red,1,1)
I think the answer should be just 255, but command window display 255 255 255
Best Answer