Procuring digital preservation CAN be quick and painless with our new dynamic...
Digital Image Processing: Image Enhancement in the Spatial Domain
1. CSC447: Digital Image
Processing
Chapter 3: Image Enhancement in the
Spatial Domain
Prof. Dr. Mostafa Gadal-Haqq M. Mostafa
Computer Science Department
Faculty of Computer & Information Sciences
AIN SHAMS UNIVERSITY
2. Pixel (Point) Operations
The intensity transformation operations
always obey the equation:
s = T( r )
r: the input pixel intensity
s: the output pixel intensity
T: the operation
For example:
Image Thresholding
2CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
3. Some Point Transforms
Image Binarisation
Converting image to Black & White
Image Thresholding
S = ?
3CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
4. Some Point Transforms
Image Negatives
s = L - 1 - r
4CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
5. Some Point Transforms
Power-Law Transformations
s = c r
5CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
6. Some Point Transforms
Gamma Correction
s = c r
6CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
7. Some Point Transforms
Gamma Correction
s = c r
7CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
8. Some Point Transforms
Power-Law Transformations
8CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
9. Some Point Transforms
Piecewise-Linear Transformation Functions
9CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
10. Some Point Transforms
Transformation Functions for Intensity Range
10CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
11. Some Point Transforms
Transformation Functions for Intensity Range
11CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
12. Contrast Stretching
Contrast Stretching:
Contrast stretching is another way to
enhance the image contrast by stretching the
gray levels in the image over the dynamic
range of the gray scale.
12CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
15. Histogram-based Operations
What is image histogram?
The histogram of an image or a region, h(r ) is a
function whose domain is the gray levels and its
codomain is the frequency of occurrence of those
gray levels in the image or the region.
The histogram is computed by counting the
number of times that each brightness (gray level)
occurs in the image or the region.
That is: h(r ) = nr = no. of pixels with intensity g
The normalized histogram is h(r ) = nr /n; where
n is the total number of pixels in the image
15CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
19. Histogram-based Operations
1. Histogram Equalization:
Histogram equalization is a way to enhance
the image contrast by extending the image
intensity over the full dynamic range of the
gray scale.
19CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
21. Histogram-based Operations
1. (Discrete) Histogram Equalization.
r
g
gh
n
rPs
0
)(
1
)255()(
s
r
21CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
29. Arithmetic/Logic Operations
Image Averaging
Consider a noisy image g(x, y) formed by the addition
of noise (x, y) to an original image f(x, y); That is:
If the noise is uncorrelated, we can remove the noise
by averaging K noisy images
where
29CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
30. Arithmetic/Logic Operations
Image Averaging
where E{g(x, y)} is the expected value
of g(x, y) at coordinates (x, y).
The standard deviation at any
point in the average image is
As K increase the variability
(noise) in the pixel value decrease
30CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
31. Arithmetic/Logic Operations
Image Averaging
where E{g(x, y)} is the expected
value of g(x, y) at coordinates (x, y).
The standard deviation at any
point in the average image is
31CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
33. Spatial Filtering: Foundations
Linear Filtering:
Using convolution
Filter, mask, filter
Mask, kernel, window
a=(m-1)/2 and b=(n-1)/2
33CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
34. Spatial Filtering : Smoothing
Smoothing/Average Filtering:
Also called lowpass filter
Weighted averageAverage
34CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
35. Spatial Filtering: Smoothing
Smoothing/Average
Filtering:
35CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
36. Spatial Filtering: Smoothing
Smoothing/Average Filtering:
36CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
37. Spatial Filtering: Median
Order-Statistics Filtering:
Median (Nonlinear) filter
37CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
38. Spatial Filtering: Sharpening
Foundation: Image Derivative
38CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
39. Spatial Filtering: Sharpening
Foundation: Image Derivative
39CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
40. Spatial Filtering: Sharpening
Sharpening using the Laplacian filter
40CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.