Computer Vision: Image Enhancement in Spatial Domain

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

Computer Vision

Chapter 3
Image Enhancement in Spatial Domain
Speaker
Dr. Divya BS
Assistant Professor In CSE
Ramaiah University of Applied Sciences, Bengaluru
Email: divya.cs.et@msruas.ac.in Tel: +91-804-536-6666 Ext:2213 1
Faculty of Engineering & Technology © Ramaiah University of Applied Sciences
Recap
• Piecewise-Linear Transformation Functions
– Contrast Stretching
– Gray-level slicing
• Bit-plane slicing

2
Faculty of Engineering & Technology © Ramaiah University of Applied Sciences
Today’s Class
• What is Histogram
• Histogram Equalization

3
Faculty of Engineering & Technology © Ramaiah University of Applied Sciences
What is Histogram
• Histogram is a graphical representation of the
intensity distribution in a digital image.
• The histogram of a digital image with gray levels
in the range [0, L-1] is a discrete function
of pixels in the image having gray level rk.
• It is common practice to normalize a histogram
by dividing each of its values by the total
number of pixels in the image, denoted by n.
• Thus, a normalized histogram is given by,.
4
Faculty of Engineering & Technology © Ramaiah University of Applied Sciences
Cont…
• Loosely speaking, gives an estimate of the
probability of occurrence of gray level rk.
• Note that the sum of all components of a
normalized histogram is equal to 1.
• Histogram manipulation can be used effectively
for image enhancement.

5
Faculty of Engineering & Technology © Ramaiah University of Applied Sciences
Examples of Histogram

6
Faculty of Engineering & Technology © Ramaiah University of Applied Sciences
Cont…

7
Faculty of Engineering & Technology © Ramaiah University of Applied Sciences
Cont…

8
Faculty of Engineering & Technology © Ramaiah University of Applied Sciences
Cont…

9
Faculty of Engineering & Technology © Ramaiah University of Applied Sciences
Histogram Equalization
• For discrete values we deal with probabilities and
summations.
• The probability of occurrence of gray level rk in an
image is approximated by

where, as noted at the beginning of this section, n is


the total number of pixels in the image, nk is the
number of pixels that have gray level rk, and L is the
total number of possible gray levels in the image.
10
Faculty of Engineering & Technology © Ramaiah University of Applied Sciences
Cont…
• The discrete version of the transformation
function given

• Thus, a processed (output) image is obtained by


mapping each pixel with level rk in the input
image into a corresponding pixel with level sk in
the output image.

11
Faculty of Engineering & Technology © Ramaiah University of Applied Sciences
Problem on Histogram Equalization
Suppose that a 3-bit image (L = 8) of size 64X64
pixels (MN = 4096) has the intensity distribution in
Table 1, where the intensity levels are integers in the
range [0,L-1]. The histogram of this image is
sketched in Fig. 3.19(a).Find the Values of the
histogram equalization transformation function.

12
Faculty of Engineering & Technology © Ramaiah University of Applied Sciences
Table 1

13
Faculty of Engineering & Technology © Ramaiah University of Applied Sciences
Solution

14
Faculty of Engineering & Technology © Ramaiah University of Applied Sciences
Problem 2
Perform histogram equalization for the 8X8, eight
level image described in Table

rk 0 1 2 3 4 5 6 7
nk 8 10 10 2 12 16 4 2

15
Faculty of Engineering & Technology © Ramaiah University of Applied Sciences
Problem 3
Perform histogram equalization on the following
3X3, eight-level image.

1 3 5

4 4 3

5 2 2

16
Faculty of Engineering & Technology © Ramaiah University of Applied Sciences
Problem 4
• Perform histogram equalization technique to the
following image

1 2 3 4
5 5 6 6
f(x,y) = 6 7 6 6
6 7 2 3

17
Faculty of Engineering & Technology © Ramaiah University of Applied Sciences
Thank you

18
Faculty of Engineering & Technology © Ramaiah University of Applied Sciences

You might also like