lec_7 DSP ( image) (1)
lec_7 DSP ( image) (1)
Lec.7
Dr. Abdallah gad
Communication & electronics
October high institute for engineering & technology
➢Image enhancement
Before After
Spatial Domain : (image plane)
◦ Techniques are based on direct manipulation of
pixels in an image
Frequency Domain :
Two domains ◦ Techniques are based on modifying the Fourier
transform of an image
There are some enhancement techniques
based on various combinations of methods
from these two categories.
For human visual
◦ The visual evaluation of image quality is a highly
subjective process.
◦ It is hard to standardize the definition of a good
image.
f(x,y) g(x,y)
Operation on the set
of image-pixels 6 8 2 0 3 4 1 0
12 200 20 10 6 100 10 5
(Operator: Div. by 2)
6 8 (Operator: sum)
5 5 1 0
2 20 3 4
1 1 1 1
1 1
1 1 1 1 1
Linear Image smoothing h= 2 = 1 1 1*
techniques L 1 L L
Box filters. Arithmetic mean
1 1 1 1
LxL operator
(Averaging filter)
8 5 8 5 8 5 1 1 1 6 7 6 7 6 7
1
8 5 8 5 8 5 1 1 1 = 6 7 6 7 6 7
9
8 5 8 5 8 5 1 1 1 6 7 6 7 6 7
Example
2 3 7 6
4 6 7
Noise reduction
Low-pass Median
▪ Averaging pixels corrupted by noise cancels
out the noise.
x
L
L=255: for grayscale images
y=x
y
L
y = L−x
x
0 L
Digital negative
Y
x 0 xa
yb
y = ( x − a ) + ya a xb
( x − b) + y bxL
ya
b
a b x
0 L
Contrast Stretching
a = 50, b = 150, = 2
Y
y = c log10 (1 + x)
x
0 L
Range Compression
c=100
▪ mapping function f(x) that leads to
different enhancement results
▪ MATLAB function > imadjust
▪ The natural question is: How to select
an appropriate f(x) for an arbitrary
Summary of image?
Point Operation ▪ One systematic solution is based on the
histogram information of an image
▪ Histogram equalization and
specification
▪ Histogram is called normal or Gaussian
▪ Mean(noise) = 0
▪ Standard deviation
2000
1500
1i−
2
f (i ) =
1 1000
exp −
2 2
2 500
4 2 4 3 4
3
3 2 3 5
2
2 4 2 4
1
Gray level
4x4 image
0 1 2 3 4 5 6 7 8 9
Gray scale = [0,9]
histogram
• dividing each of histogram at gray
level rk by the total number of pixels
in the image, n
p(rk) = nk / n
Normalized Histogram • For k = 0,1,…,L-1
• p(rk) gives an estimate of the
probability of occurrence of gray level
rk
• The sum of all components of a
normalized histogram is equal to 1
• Basic for numerous spatial domain
processing techniques
Histogram Processing • Used effectively for image
enhancement
• Information inherent in histograms also
is useful in image compression and
segmentation
Dark image
Components of histogram
are concentrated on the low
side of the gray scale.
Components of histogram
are concentrated on the high
side of the gray scale.
Low-contrast image
histogram is narrow and
centered toward the
middle of the gray scale
High-contrast image
histogram covers broad range of
the gray scale and the
distribution of pixels is not too
far from uniform, with very few
vertical lines being much higher
than the others
▪ As the low-contrast image’s histogram is narrow
and centered toward the middle of the gray
scale, if we distribute the histogram to a wider
range the quality of the image will be improved.
Histogram
Equalization ▪ We can do it by adjusting the probability density
function of the original histogram of the image
so that the probability spread equally
before after Histogram
equalization
before after Histogram
equalization
4 2 4 3 4
3
3 2 3 5
2
2 4 2 4 1
Gray level
4x4 image
0 1 2 3 4 5 6 7 8 9
Gray scale = [0,9]
histogram
Gray
0 1 2 3 4 5 6 7 8 9
Level(j)
No. of 0 0 6 5 4 1 0 0 0 0
pixels
k
n
j =0
j
0 0 6 11 15 16 16 16 16 16
6 11 15 16 16 16 16 16
k nj
s= 0 0 / / / / / / / /
j =0 n
16 16 16 16 16 16 16 16
3.3 6.1 8.4
sx9 0 0 9 9 9 9 9
3 6 8
No. of pixels
6
3 6 6 3 5
8 3 8 6 4
6 3 6 9 3
2
3 8 3 8
1
Output image
0 1 2 3 4 5 6 7 8 9
Gray scale = [0,9] Gray level
Histogram equalization
Any questions?