2 Write a Matlab code to calculate a histogram of an image o
2. Write a Matlab code to calculate a histogram of an image of 256 gray levels and size h w?
Solution
i=imread(\'pout.tiff\');
i=rgb2gray(i);
i=imresize(i,(256,256));
j=imhist(i);
imshow(j);
h=hist(reshape(j,[],size(i,3)),0:255);
figure,imshow(h);
