Chapter3

advertisement
Lecture 3
Image enhancement
Dr. Mohsen NASRI
College of Computer and Information Sciences,
Majmaah University, Al Majmaah
m.nasri@mu.edu.sa
Introduction
 Image enhancement widely used computer graphics.
 It is the sub areas of image processing
 The principal objectives of image enhancement is to process an image so that
the result is more suitable than the original image for a specific application
Original image
Enhanced image
?
2
Methods for image enhancement
 Image enhancement techniques can be divided into two broad categories:
Spatial domain methods
Techniques are based on direct
manipulation of pixels in an image
Frequency domain methods
Techniques are based on modifying the
Fourier transform of the image.
3
Spatial Domain Methods
• As indicated previously, the term spatial domain refers to
the aggregate of pixels composing an image. Spatial
domain methods are procedures that operate directly on
these pixels. Spatial domain processes will be denoted
by the expression:
g(x,y) = T [f(x,y)]
Where;
f(x,y) in the input image, g(x,y) is the processed image and
T is as operator on f, defined over some neighborhood of
(x,y)
• In addition, T can operate on a set of input images.
Direct Image manipulation
4
Spatial Domain Methods cont…
T transforms the given image f(x,y) into another image g(x,y)
f(x,y)
T
g(x,y)
The operator T can be defined over
• The set of pixels (x,y) of the image
• The set of ‘neighborhoods’ N(x,y) of each pixel
• A set of images f1,f2,f3,…
5
Spatial Domain Methods cont…
Operation on the set of image-pixels
6
8
2
0
12 200 20 10
3
4
1
0
6
100 10 5
(Operator: Div. by 2)
6
Spatial Domain Methods cont…
Operation on the set of ‘neighborhoods’ N(x,y) of each
pixel
6
8
(Operator: sum)
12 200
6
8
2
0
226
12 200 20 10
7
Spatial Domain Methods cont…
Operation on a set of images f1,f2,…
6
8
2
0
12 200 20 10
(Operator: sum)
11 13 3
0
14 220 23 14
5
5
1
0
2
20 3
4
8
Spatial Domain Methods cont…
Operation on a set of images using logic operations
Logic operations
AND
OR
NOT
The operators AND,OR,NOT are functionally complete:
Any logic operator can be implemented using only these 3 operators
9
Spatial Domain Methods cont…
Operation on a set of images using logic operations
10
Spatial Domain Methods cont…
Operation on a set of images using logic operations
Image 1 AND Image 2
1
2
3
9
7
3
6
4
(Operator: AND)
1
1
1
1
2
2
2
2
AND : A  B  { p p  image1
and
1
0
1
1
2
2
2
0
p  image2}
11
Spatial Domain Methods cont…
Image 1 AND Image 2:Used for BitplaneSlicing and Masking
12
Spatial Domain Methods cont…
Arithmetic Operations on a set of images
Image 1 OR Image 2
1
2
3
9
7
3
6
4
(Operator: +)
1
1
1
1
2
2
2
2
OR : A  B  { p p  image1
or
2
3
4
10
9
5
8
6
p  image2}
13
Histogram equalization
14
Histogram equalization cont…
15
Histogram equalization cont…
Solution
16
Histogram equalization cont…
Solution cont...
17
Histogram equalization cont…
Solution cont...
18
Image Example
before
after
19
Histogram Comparison
3000
3000
2500
2500
2000
2000
1500
1500
1000
1000
500
0
500
0
50
100
150
200
before equalization
0
0
50
100
150
200
250
300
after equalization
20
Frequency Domain Methods
We compute the Fourier transform of an image to be
enhanced, multiply the result by a filter (rather than
convolve in the spatial domain), and take the inverse
transform to produce the enhanced image

Frequency domain techniques
 Unsharp masking
 Homomorphic filtering*
21
FrequencyDomain Methods
Unsharp Masking
f (i, j )  x(i, j )  g (i, j ),   0
g(i, j) is a high-pass filtered version of x(i, j)
• Example (Laplacian operator)
1
g (i, j )  x(i, j )  [ x( x  1, j )  x( x  1, j ) 
4
x(i, j  1)  x(i, j  1)]
22
FrequencyDomain Methods
Homomorphic filtering
Basic idea:
f ( x, y )  i ( x, y ) r ( x, y )
Illumination
(low freq.)
reflectance
(high freq.)
ln f ( x, y )  ln i ( x, y )  ln r ( x, y )
freq. domain enhancement
23
Image Example
before
after
24
Thank You
Have a Nice Day
Download