Image Hisotgram Assignment
Image Hisotgram Assignment
Image histogram plots the number of pixels for each tonal value. By looking at the
histogram for a specific image a viewer will be able to judge the entire tonal
distribution at a glance. This help us is determining the threshold value for
thresholding an image and also enhancing the contrast of an image.
%form histogram
histogram_values = zeros(256,1);
for i = 1:rows
for j = 1:cols
p = double(openImage(i,j)) + 1;
histogram_values(p) = histogram_values(p) + 1;
end
end
%Show histogram
bar(0:255, histogram_values, 'histc');