% imagehist3D % usage: imagehist3D(pic) or % read a jpeg image and split into three RGB components % and show the 2-compoent histograms % pic is the name of a jpg file given in 'filename.jpg' format % typically the component images will be returned as matrices of byte-sized unsigned integers % allowing 256 levels for each colour, i.e., 24 bit colour % Rmap, Gmap and Bmap are colormaps for showing the R,G,B components function H = imagehist3D(pic,numbins); % load picture [R,G,B,Rmap,Gmap,Bmap] = jpg2rgb(pic,'nopic'); Z = zeros(size(R)); H = hist3D(double(R(:)),double(G(:)),double(B(:)),numbins,numbins,numbins);