Matlab Code:
rgbImage = imread('C:\Documents and Settings\Admin\Desktop\c.jpg');
figure, imshow(rgbImage);
figure, imhist(rgbImage(:,:,2));
redChannel = rgbImage(:,:, 1);
greenChannel = rgbImage(:,:, 2);
blueChannel = rgbImage(:,:, 3);
redMean = mean(mean(redChannel))
greenMean = mean(mean(greenChannel))
blueMean = mean(mean(blueChannel))
message = sprintf('The red mean = %.2f\n The green mean = %.2f\n The blue mean = %.2f',redMean, greenMean, blueMean);
msgbox(message);
rgbImage = imread('C:\Documents and Settings\Admin\Desktop\c.jpg');
figure, imshow(rgbImage);
figure, imhist(rgbImage(:,:,2));
redChannel = rgbImage(:,:, 1);
greenChannel = rgbImage(:,:, 2);
blueChannel = rgbImage(:,:, 3);
redMean = mean(mean(redChannel))
greenMean = mean(mean(greenChannel))
blueMean = mean(mean(blueChannel))
message = sprintf('The red mean = %.2f\n The green mean = %.2f\n The blue mean = %.2f',redMean, greenMean, blueMean);
msgbox(message);