Professional Documents
Culture Documents
Chapter 3. Intensity Transformations and Spatial Filtering
Chapter 3. Intensity Transformations and Spatial Filtering
Hà Nội, 2021 1
Chapter 3. Intensity Transformations and Spatial Filtering
1. Background
2. Some Basic Intensity Transformation Functions
3. Histogram Processing
4. Fundamentals of Spatial Filtering
5. Smoothing (Lowpass) Spatial Filters
6. Sharpening (Highpass) Spatial Filters
7. Highpass, Bandreject, and Bandpass Filters from Lowpass Filters
8. Combining Spatial Enhancement Methods
1. Background
2. Some Basic Intensity Transformation Functions
3. Histogram Processing
4. Fundamentals of Spatial Filtering
5. Smoothing (Lowpass) Spatial Filters
6. Sharpening (Highpass) Spatial Filters
7. Highpass, Bandreject, and Bandpass Filters from Lowpass Filters
8. Combining Spatial Enhancement Methods
❖Image Negatives
(a) A digital mammogram. (b) Negative image obtained using Eq. (3-3) .
(Image (a) Courtesy of General Electric Medical Systems.)
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 8
2. Some Basic Intensity Transformation Functions
❖Log Transformations
where c is a constant and it is assumed that r 0
(a) Fourier spectrum displayed as a grayscale image. (b) Result of applying the log
transformation in Eq. (3-4) with c = 1. Both images are scaled to the range [0, 255].
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 9
2. Some Basic Intensity Transformation Functions
a) Magnetic resonance image (MRI) of a fractured human spine (the region of the fracture is enclosed by the circle). (b)–(d)
Results of applying the transformation in Eq. (3-5) with and and 0.3, respectively. (Original image courtesy of Dr. David R. Pickens,
Department of Radiology and Radiological Sciences, Vanderbilt University Medical Center.)
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 12
2. Some Basic Intensity Transformation Functions
(a) Aerial image. (b)–(d) Results of applying the transformation in Eq. (3-5) with = 3.0, 4.0 and 5.0, respectively.
(c = 1 in all cases.) (Original image courtesy of NASA.)
Image reconstructed from bit planes: (a) 8 and 7; (b) 8, 7, and 6; (c) 8, 7, 6, and 5.
1. Background
2. Some Basic Intensity Transformation Functions
3. Histogram Processing
4. Fundamentals of Spatial Filtering
5. Smoothing (Lowpass) Spatial Filters
6. Sharpening (Highpass) Spatial Filters
7. Highpass, Bandreject, and Bandpass Filters from Lowpass Filters
8. Combining Spatial Enhancement Methods
❖Histogram
➢ The unnormalized histogram:
❖Histogram
➢ The normalized histogram:
𝐿−1
𝑝 𝑟𝑘 = 1
𝑘=1
where M and N are the number of image rows and columns, respectively.
❖Histogram
Four image types and their corresponding histograms. (a) dark; (b) light; (c) low contrast; (d) high contrast.
The horizontal axis of the histograms are values of rk and the vertical axis are values of p(rk) .
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 22
3. Histogram Processing
❖Histogram Equalization
➢ The probability of occurrence of intensity level in a digital image is approximated
by
where MN is the total number of pixels in the image, and nk denotes the number of pixels that have
intensity rk.
❖Histogram Equalization
➢ Example: Illustration of the mechanics of histogram equalization.
• Suppose that a 3-bit image (L = 3) of size 64x64 pixels (MN = 4096) has the intensity distribution
in Table
31
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
3. Histogram Processing
❖Histogram Equalization
➢ Example: Illustration of the mechanics of histogram equalization.
We round them to their nearest integer values in the range [0, 7]:
❖Histogram Equalization
➢ Example: Illustration of the mechanics of histogram equalization.
Histogram equalization. (a) Original histogram. (b) Transformation function. (c) Equalized histogram.
33
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
3. Histogram Processing
❖Histogram Equalization
➢ Algorithm for Histogram Equalization
34
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
3. Histogram Processing
❖Histogram Equalization
❖Histogram Equalization
37
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
Chapter 3. Intensity Transformations and Spatial Filtering
1. Background
2. Some Basic Intensity Transformation Functions
3. Histogram Processing
4. Fundamentals of Spatial Filtering
5. Smoothing (Lowpass) Spatial Filters
6. Sharpening (Highpass) Spatial Filters
7. Highpass, Bandreject, and Bandpass Filters from Lowpass Filters
8. Combining Spatial Enhancement Methods
40
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
4. Fundamentals of Spatial Filtering
❖Spatial Correlation
and Convolution
➢ 1-D illustration
41
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
4. Fundamentals of Spatial Filtering
➢ Correlation
➢ Convolution
42
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
4. Fundamentals of Spatial Filtering
43
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
Chapter 3. Intensity Transformations and Spatial Filtering
1. Background
2. Some Basic Intensity Transformation Functions
3. Histogram Processing
4. Fundamentals of Spatial Filtering
5. Smoothing (Lowpass) Spatial Filters
6. Sharpening (Highpass) Spatial Filters
7. Highpass, Bandreject, and Bandpass Filters from Lowpass Filters
8. Combining Spatial Enhancement Methods
➢ Smoothing (also called averaging) spatial filters are used to reduce sharp
transitions in intensity.
➢ Application: noise reduction, reduce aliasing, reduce irrelevant detail in an image,
smoothing the false contours, …
➢ Linear spatial filtering
➢ Nonlinear smoothing filters
45
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
5. Smoothing (Lowpass) Spatial Filters
46
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
5. Smoothing (Lowpass) Spatial Filters
47
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
5. Smoothing (Lowpass) Spatial Filters
(a)A test pattern of size 1024x1024. (b) Result of lowpass filtering the pattern with a Gaussian kernel of
size 21x21, with standard deviations = 3.5. (c) Result of using a kernel of size 43x43, with = 7. We
used K = 1 in all cases.
50
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
5. Smoothing (Lowpass) Spatial Filters
(a) Result of filtering using a Gaussian kernels of size43x43, with = 7. (b) Result of using
a kernel of 85x85, with the same value of . (c) Difference image.
51
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
5. Smoothing (Lowpass) Spatial Filters
52
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
5. Smoothing (Lowpass) Spatial Filters
53
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
5. Smoothing (Lowpass) Spatial Filters
54
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
5. Smoothing (Lowpass) Spatial Filters
55
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
5. Smoothing (Lowpass) Spatial Filters
56
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
Chapter 3. Intensity Transformations and Spatial Filtering
1. Background
2. Some Basic Intensity Transformation Functions
3. Histogram Processing
4. Fundamentals of Spatial Filtering
5. Smoothing (Lowpass) Spatial Filters
6. Sharpening (Highpass) Spatial Filters
7. Highpass, Bandreject, and Bandpass Filters from Lowpass Filters
8. Combining Spatial Enhancement Methods
❖Foundation
➢ First-order derivative
➢ Second-order derivative
58
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
6. Sharpening (Highpass) Spatial Filters
59
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
6. Sharpening (Highpass) Spatial Filters
60
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
6. Sharpening (Highpass) Spatial Filters
61
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
6. Sharpening (Highpass) Spatial Filters
a) Blurred image of the North Pole of the moon. (b) Laplacian image obtained using the kernel in Fig.
3.51(a). (c) Image sharpened using Eq. (3-63) with c = -1. (d) Image sharpened using the same procedure,
but with the kernel in Fig. 3.51(b). (Original image courtesy of NASA.)
62
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
6. Sharpening (Highpass) Spatial Filters
▪ Subtract the blurred image from the original (the resulting difference is called the mask)
1-D illustration of the mechanics of unsharp masking. (a) Original signal. (b) Blurred signal with original
shown dashed for reference. (c) Unsharp mask. (d) Sharpened signal, obtained by adding (c) to (a).
64
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
6. Sharpening (Highpass) Spatial Filters
(a) Unretouched “soft-tone” digital image of size 469x600 pixels. (b) Image blurred using a 31x31 Gaussian lowpass
filter with = 5. (c) Mask. (d) Result of unsharp masking using Eq. (3-65) with k = 1. (e) and (f) Results of highboost
filtering with k = 2 and k = 3 respectively.
65
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
6. Sharpening (Highpass) Spatial Filters
66
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
6. Sharpening (Highpass) Spatial Filters
67
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
6. Sharpening (Highpass) Spatial Filters
68
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
6. Sharpening (Highpass) Spatial Filters
(a) A 3x3 region of an image, where the zs are intensity values. (b)–(c) Roberts cross-gradient operators.
(d)–(e) Sobel operators. All the kernel coefficients sum to zero, as expected of a derivative operator.
69
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
6. Sharpening (Highpass) Spatial Filters
(a) Image of a contact lens (note defects on the boundary at 4 and 5 o’clock).
(b) Sobel gradient. (Original image courtesy of Perceptics Corporation.)
70
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
Chapter 3. Intensity Transformations and Spatial Filtering
1. Background
2. Some Basic Intensity Transformation Functions
3. Histogram Processing
4. Fundamentals of Spatial Filtering
5. Smoothing (Lowpass) Spatial Filters
6. Sharpening (Highpass) Spatial Filters
7. Highpass, Bandreject, and Bandpass Filters from Lowpass Filters
8. Combining Spatial Enhancement Methods
72
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
7. Highpass, Bandreject, and Bandpass Filters from Lowpass Filters
73
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
7. Highpass, Bandreject, and Bandpass Filters from Lowpass Filters
74
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
7. Highpass, Bandreject, and Bandpass Filters from Lowpass Filters
(a) Zone plate image filtered with a separable lowpass kernel. (b) Image
filtered with the isotropic lowpass kernel in Fig. 3.60(b).
75
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
7. Highpass, Bandreject, and Bandpass Filters from Lowpass Filters
76
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
Chapter 3. Intensity Transformations and Spatial Filtering
1. Background
2. Some Basic Intensity Transformation Functions
3. Histogram Processing
4. Fundamentals of Spatial Filtering
5. Smoothing (Lowpass) Spatial Filters
6. Sharpening (Highpass) Spatial Filters
7. Highpass, Bandreject, and Bandpass Filters from Lowpass Filters
8. Combining Spatial Enhancement Methods
➢ The gradient has a stronger response in areas of significant intensity transitions (ramps and steps).
(a) Image of whole body bone scan. (b) Laplacian of (a). (c) Sharpened image obtained by adding (a) and (b).
(d) Sobel gradient of image (a). (Original image courtesy of G.E. Medical Systems.)
78
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).
8. Combining Spatial Enhancement Methods
(e) Sobel image smoothed with a 3x3 box filter. (f) Mask image formed by the product of (b) and (e). (g) Sharpened image
obtained by the adding images (a) and (f). (h) Final result obtained by applying a power-law transformation to (g). Compare
images (g) and (h) with (a). (Original image courtesy of G.E. Medical Systems.)
79
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018).