For 1:
i = imread('fabric.png');
r = sum(sum(i(:,:,1)))
g = sum(sum(i(:,:,2)))
b = sum(sum(i(:,:,3)))
bar([r g b])
MatlabDoug
2010-10-18 19:16:13
For 1:
i = imread('fabric.png');
r = sum(sum(i(:,:,1)))
g = sum(sum(i(:,:,2)))
b = sum(sum(i(:,:,3)))
bar([r g b])
Here is my version of IMHIST:
I = imread('pic.jpg');
II = double(I);
clr = 'rgb'; clrTxt = {'Red' 'Green' 'Blue'};
for i=1:3
h = subplot(3,1,i);
c = histc(reshape(II(:,:,i),[],1), 0:255);
bar(0:255, c./max(c), 'histc')
set(gca, 'XLim', [0 255], 'YLim',[0 1])
set(findobj(h,'Type','patch'), 'FaceColor',clr(i), 'EdgeColor','none')
ylabel(clrTxt{i})
end
xlabel('Intensity')