0% found this document useful (0 votes)
65 views4 pages

Image Hisotgram Assignment

The document discusses image histograms. It defines an image histogram as a chart that shows the distribution of pixel intensities in an image. Histograms plot the number of pixels for each tonal value, allowing viewers to judge the tonal distribution at a glance and determine threshold values for image processing. To create a histogram, the code counts the number of pixels at each intensity level from 0 to 255 and plots the results as a bar graph. Sample histograms are shown for an original x-ray image and a synthetic image.

Uploaded by

Faiz Shakhih
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views4 pages

Image Hisotgram Assignment

The document discusses image histograms. It defines an image histogram as a chart that shows the distribution of pixel intensities in an image. Histograms plot the number of pixels for each tonal value, allowing viewers to judge the tonal distribution at a glance and determine threshold values for image processing. To create a histogram, the code counts the number of pixels at each intensity level from 0 to 255 and plots the results as a bar graph. Sample histograms are shown for an original x-ray image and a synthetic image.

Uploaded by

Faiz Shakhih
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

NAME: MUHAMMAD FAIZ B MD SHAKHIH

MATRIC NO: MMB 161004

IMAGE HISOTGRAM ASSIGNMENT

1. What is image histogram?

An image histogram is a chart that shows the distribution of intensities in an indexed


or grayscale image. It acts as a graphical representation of the tonal distribution in a
digital image.

2. What is the purpose of image histogram?

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.

3. How to understand image histogram?

Image histogram is a graph plotting the frequency of occurrence of different colour


intensities in the image. Simply put, it shows how many pixels of every possible
colour there are in the image. Every bar on the image histogram represents one
intensity level. 0 (black) is usually shown on the left, and 255 (white) on the right.
The height of the bar form correspond to the number of pixel exist on that particular
pixel value.
4. Code used to create image histogram?

%Read in grayscale image


openImage = lspine2_2; -> Image name
rows,cols] = size(openImage);

%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');

(a) Original image

Figure 4.1: Original x-ray image (lspine2_2)


Figure 4.2: Histogram bar of original x-ray image

(b) Synthetic image

Figure 4.3: Synthetic x-ray image


Figure 4.4: Histogram bar of synthetic x-ray image

You might also like