0% found this document useful (0 votes)
3 views9 pages

Histogram

The document explains the concept of image histograms, which plot the frequency of gray levels in an image, providing insights into its contrast and brightness. It details the process of histogram equalization, which redistributes gray levels for improved visual quality, and outlines the steps to perform this technique. An example is provided to illustrate the procedure of histogram equalization using MATLAB.

Uploaded by

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

Histogram

The document explains the concept of image histograms, which plot the frequency of gray levels in an image, providing insights into its contrast and brightness. It details the process of histogram equalization, which redistributes gray levels for improved visual quality, and outlines the steps to perform this technique. An example is provided to illustrate the procedure of histogram equalization using MATLAB.

Uploaded by

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

Histogra

m
The histogram of an image is a plot of the number of occurrences of gray levels in
the image against the gray-level values.
The histogram provides more insight about image contrast and brightness.

Interpretation drawn from Histogram


a)The histogram of a dark image will be clustered towards the lower gray level.
b)The histogram of a bright image will be clustered towards higher gray level.
c)For a low-contrast image, the histogram will not be spread equally, that is, the
histogram will be narrow.
d)For a high-contrast image, the histogram will have an equal spread in the gray
level.
Histogram
Equalization
Equalization is a process that attempts to spread out the gray levels in an
image so that they are evenly distributed across their range.
Histogram equalization reassigns the brightness values of pixels based on the
image histogram.
Histogram equalization is a technique where the histogram of the resultant image
is as flat as possible.
Histogram equalization provides more visually pleasing results across a wider
range of images.
Histogram Equalization
Procedure to Perform Histogram Equalization

Histogram equalization is done by performing the following steps:


1)Find the running sum of the histogram values.
2)Normalize the values from Step (1) by dividing by the total number of pixels.
3)Multiply the values from Step (2) by the maximum gray-level value and round
4)Map the gray level values to the results from Step (3) using a one-to-one
correspondence.
Example
4 4 4 4 4
Perform histogram equalisation of the 3 4 5
image 4 3 

3 5 5 5 3
 
3 4 5 4 3
 4 4 4 4 4 
Example 4 4 4 4 4
The maximum value is found to be 5. 3 4 5 4 3 

it require minimum of 3 bits to represent the number.
3 5 5 5 3
There are eight possible gray levels from 0 to 37. 4 5 4 3

The histogram of the input image is given below:
 4 4 4 4 4 

Step 1 Compute the running sum of histogram values.


The running sum of histogram values is otherwise known
as cumulative frequency distribution
Example
Step 2 Divide the running sum obtained in Step 1 by the
total number of pixels. In this case, the total number
 4 4 4 of
4 4
pixels is 25.  3 4 5 4 3
 
 3 5 5 5 3
 
 3 4 5 4 3 
 4 4 4 4 4 
Step 3 Multiply the result obtained in Step 2 by the maximum
gray-level value, which is 7 in this case.
Example
The result is then rounded to the closest integer
to get the following table:
Step 4 Mapping of gray level by a one-to-one
correspondence:

The original image and the histogram equalized


image are shown side by side.
 4 4 4 4 4 6 6 6 6 6
 3 4 5 4 3 2 6 7 6 2 
  
Histogram
 3 5 5 5 3   Equalization
    2 7 7 7 2
   
 3 4 5 4 3 2 6 7 6 2
 4 4 4 4 4   6 6 6 6 6 
Original Histogram equalized
image
MATLAB Example 1: Histogram equalization Read
an image and perform histogram equalization of
the input image and analyze the result.
clc
clear all
close all
c=imread('jordan Hosseaa.png');
a=rgb2gray(c);
%perform histogram equalisation
b=histeq(a);
subplot(2,2,1),imshow(a),title('original image'),
subplot(2,2,2),imshow(b),title('After histogram
equalisation'),
subplot(2,2,3),imhist(a),title('original histogram')
subplot(2,2,4),imhist(b),title('After histogram
equalisation')

You might also like