You are on page 1of 1

dominantRedValue = mean2(rgbImage(:, :, 1)); dominantGreenValue = mean2(rgbImage(:, :, 2)); dominantBlueValue = mean2(rgbImage(:, :, 3)); colors = 'RGB'; I = imread('peppers.

png'); [~,idx] = max(sum(sum(I,1),2),[],3); dominant = colors(idx) imageArray = ca{k}; % Find histograms for each color channel [pixelCountsR grayLevelsR] = imhist(imageArray(:,:,1)); [pixelCountsG grayLevelsG] = imhist(imageArray(:,:,2)); [pixelCountsB grayLevelsB] = imhist(imageArray(:,:,3)); % Find "dominant" color meanRed = mean2(imageArray(:,:, 1)); meanGreen = mean2(imageArray(:,:, 2)); meanBlue = mean2(imageArray(:,:, 3));

You might also like