Sei sulla pagina 1di 4

Practical No.

: 01
AIM: To study histogram equalization and modification.
SOFTWARE REQUIRMENTS: Turbo C, Matlab.
OBJECTIVE: 1. Study histogram equalization.
2. Study histogram modification.

OUTCOME: Students understand the concept of histogram equalization and enhanced


and plot the histogram of an image by using histogram equalization.

QUESTION BANK:
a. Pre-Lab Requisite:
1. How histogram equalization is useful in histogram processing.
2. Explain Histogram processing.
3. Explain about

a. Histogram processing
b. Histogram Equalization
c. Histogram Matching

b. Post- Lab Requisite:


1. Define Histogram?
2. What is histogram Equalization (or) histogram Linearization?
3. What are drawbacks of histogram equalization?

THEORY:
HISTOGRAM EQUALIZATION:
It is an approach to enhance a given image. The approach is to design a transformation T(.)
such that the gray values in the output is uniformly distributed in [0,1].
Equalization is 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 pixel 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 image.
Procedure to perform Histogram Equalization
1. Find the running sum of the histogram values.
2. Normalize the values from step 1 by dividing by the total number of pixels.

2. Multiply the values from step 2 by the maximum gray-level values and round.
3. Map the gray level values to the results from step 3 using a one-to-one
correspondence.
Let us assume for the moment that the input image to be enhanced has continuous gray
values, with r=0 representing black & r=1 representing white. We need to design a gray
value transformation S = T(r) based on histogram of the input image which will enhance the
image.

Steps to implement the histogram equalization:


1. For the images with discrete gray values, compute
Pin( rk ) = nk/n } 0 rk 1
} 0 k L- 1
L : Total no. of gray values
nk : Number of pixels with gray value rk

n : Total number of pixels in image.


2. Based of CDF , compute the discrete version of the previous transformation

HISTOGRAM MODIFICATION:
Histogram manipulation basically modifies the histogram of an input image so as to improve
the visual quality of the image.
a) Histogram
The histogram of image is plot of the number of occurrences of gray levels in the image
against the gray-level values.
The histogram provides a convenient summary of the intensities in an image, but it is unable
to convey any information regarding spatial relationships between pixels.
The histogram provides more insight about image contrast and brightness.
1. The histogram of dark image will be clustered towards the lower gray level.
2. The histogram of bright image will be clustered towards higher gray level.
3. For a low contrast image, the histogram will not be spread equally, that is, the histogram
will be narrow.
4. For a high-contrast image, the histogram will have an equal spread in the gray level.
The input gray level u is first transformed nonlinearly by f( u ) & the output is uniformly
quantized.

APPLICATIONS:
a) Histogram can be used to segment object pixel from background pixel.
b) Histogram are basis for numerous spatial domain frequency techniques and used in
image enhancement to enhance brightness and contrast of an image.

c) It is also useful in image compression and segmentation.

LIMITATIONS:
1. When an image is condensed into a histogram, all spatial information is discarded.
2. The histogram does not give any idea about where images pixel are located within
the image.
3. So histogram is unique for any image but converse this statement is never true.

ALGORITHM:
1. Start
2. Enter the source file name whose histogram is to be calculated.
3. Copy the contents of source file to destination file.
4. Equalize the histogram using the formula
Pr ( rk ) =nk /n

; k = 0,1,2,3,..L-1

5. Plot the histogram before equalization.


6. Plot the histogram after equalization.
7. Stop.

CONCLUSION:

Potrebbero piacerti anche