Digital Image Processing
Digital Image Processing
Chapter 3
Image Enhancement
Part III
Enhancement using
Arithmetic/Logic Operations
Arithmetic/Logic operations operate on a pixel-
by-pixel basis
NOT operator performs as the negative
transformation
AND and OR operators are used for masking
Masking sometimes is referred to as region of
interest (ROI) processing
Mask is used primary to isolate an area for
processing
-/+ are the most useful for image enhancement
Arithmetic/Logic Operations
Image Subtraction
Subtraction is the enhancement of differences between images
g(x,y) = f(x,y) – h(x,y)
mask mode radiography
h(x,y) : mask → X-ray image of a region of a patient’s body captured
by an intensified TV camera located opposite an X-ray source
f(x,y) : the series of incoming images after injection of the
contrast medium
This procedure gives a movie showing how the contrast medium
propagates through the various arteries
Image Subtraction
adjustment [-255, 255]
Method 1 : adds 255 to every pixel and then
divides the result by 2
Full range of the display may not be utilized
Method 2 : adds minus minimum value and
then multiplies each pixel by 255/maximum
value
Max is the max pixel value in the modified difference
Method 3 : calculates the absolute value of
each pixel
Image Averaging
Consider a noisy image
Noise is uncorrelated at every pixel
Zero average value
Image Averaging
Image Averaging
input output
image LSI System image
From [Gonzalez
& Woods]
choices of
neighborhood:
……
Basics of Spatial Filtering
mask x
f ( x − 1, y − 1) f ( x, y − 1) f ( x + 1, y − 1)
mask coefficient
• “Filter”
“Mask”
“Window”
”Impulse
Response”
often used
interchangeably for LSI
• Image Smoothing
• Image Enhancement
• Image Restoration
– Image denoising
– Image deblurring
• Edge Detection
• Filter Bank
– Image transformation
– Frequency analysis
• ……
Image Smoothing: Average Filters
• Effects
– Smoothing noise
– Blurring edges
1
• Gaussian Filter h(m, n) = exp − m 2
+ n 2
Z 2 σ 2
− N ≤ m, n ≤ N
noisy smoothed smoothed
0 1 0
• Filter 1 1 8 6 6
1 2 1
6
0 1 0 6 3 11 8
8 8 9 10
• Input image: A 4x4, 4 bits/pixel
9 10 10 7
• Preprocessing: Zero-padding 0 0 0 0 0 0
1 8 6 6 0 1 8 6 6 0
6 3 11 8 0 6 3 11 8 0
8 8 9 10 0 8 8 9 10 0
9 10 10 7 0 9 10 10 7 0
0 0 0 0 0 0
Image Smoothing Filter Example
• Result:
2.6 4.3 6.2 4.3 3 4 6 4
4.0 6.5 8.0 7.2
round 4 7 8 7
6.5 7.7 9.5 7.3 7 8 10 7
6.0 7.8 7.7 5.7 6 8 8 6
Sharpening Linear Filters
• Laplacian ∂ 2
f ∂ 2
f - Zero at smooth regions
∇ f = 2 + 2
2
- Sensitive to image details
∂x ∂y
• Discrete approximation of Laplacian:
0 -1 0 -1 -1 -1
-1 4 -1 -1 8 -1
0 -1 0 -1 -1 -1
0 1 0 1 1 1
1 -4 1 1 -8 1
0 1 0 1 1 1
Sharpening Linear Filters
0 -1 0 -1 -1 -1
g ( x, y ) = f ( x, y ) + ∇ 2 f ( x, y ) -1 4 -1 -1 8 -1
0 -1 0 -1 -1 -1
0 1 0 1 1 1
g ( x, y ) = f ( x, y ) − ∇ 2 f ( x, y ) 1 -4 1 1 -8 1
0 1 0 1 1 1
Sharpening Linear Filters
0 -1 0
= -1 5 -1 ⊗ f ( x, y )
0 -1 0
0 0 0 -1 -1 -1
g ( x, y ) = 0 1 0 ⊗ f ( x, y ) + -1 8 -1 ⊗ f ( x, y )
0 0 0 -1 -1 -1
-1 -1 -1
= -1 9 -1 ⊗ f ( x, y )
-1 -1 -1
Sharpening Linear Filters