Mpa 5
Mpa 5
Mpa 5
Image Enhancement-III
Aloke Datta
Enhancement Using Arithmetic/Logic Op.
Arithmetic/logic operations involving images are performed on a
pixel-by-pixel basis between two or more images.
Arithmetic Operations
Addition, Subtraction, Multiplication, and Division
Logic Operations
AND, OR, NOT
H.R. Pourreza
Logic Operation
• Any logical operations can be implemented using only
AND, OR and NOT logic operators.
• When dealing with gray-scale images, pixel values are
processed as strings of binary numbers.
• The NOT logic operator does the same function as the
negative transformation does.
• The AND and OR operations are used for masking; that
is, for selecting subimages in an image.
• Masking is also called as region of interest (ROI)
processing.
Enhancement Using AND and OR Logic Op.
AND
OR
• Commercial applications
– Mask mode radiography in medical imaging
– Change detection via image subtraction
– tracking moving objects or vehicles
Enhancement Using Arithmetic Op. _ SUB
Original
4
Upper-order
Bit
HE of
Error Error
H.R. Pourreza
Image Averaging
• A noisy image:
g ( x, y ) f ( x, y ) n ( x, y )
• Assume that at every pair of coordinates (x,y) the noise is
uncorrelated and has zero average value.
– This means that g(x,y) approaches f(x,y) as the number of noisy images used
in the averaging process increases.
Enhancement Using Arithmetic Op. Averaging
Original image Noise with zero mean
g ( x, y ) f ( x, y ) ( x, y )
1 k
g ( x, y ) g i ( x, y )
k i 1
E g ( x, y ) f ( x, y )
1 2
g ( x, y ) ( x, y )
2
k
Enhancement Using Averaging
Gaussian Noise
f(x,y) g(x,y) mean = 0
variance = 64
K=8 K = 16
x
- +
K = 128
K = 32
H.R. Pourreza
Basics of Spatial Filtering - Linear
Spatial filtering are filtering
operations performed on the
pixel intensities of an image
and not on the frequency
components of the image.
a b
g ( x, y ) w(s, t ) f ( x s, y t )
s a t b
a = (m - 1) / 2 b = (n - 1) / 2
Smoothing Spatial Filtering - Linear
Averaging (low-pass) Filters
Smoothing filters are used
- Noise reduction
- Smoothing of false contours
- Reduction of irrelevant detail
Box Weighted
filter average
Smoothing Spatial Filtering _ Linear
Averaging (low-pass) Filters
n = filter size
n=3
n=5 n=9
n = 35
n = 15
H.R. Pourreza
Smoothing Spatial Filtering
Averaging & Threshold
filter size Threshold Image
n = 15
Order Statistic Filters
3 3 Median filter [10 125 125 135 141 141 144 230 240] = 141
3 3 Max filter [10 125 125 135 141 141 144 230 240] = 240
3 3 Min filter [10 125 125 135 141 141 144 230 240] = 10
1 9
9 1
zi
Image Blurred Image
1 9
9 1
z
H.R. Pourreza
Sharpening Spatial Filters
In general the second derivative is better than the first derivative for image
enhancement. The principle use of first derivative is for edge extraction.
Use of First Derivative for Edge Extraction
Gradient
First derivatives in image processing are implemented
using the magnitude of the gradient.
t
f f
f z1 z2 z3
x y
z4 z5 z6
2 0.5
f f
2
z7 z8 z9
f mag (f ) Gx G y
x y
Roberts operator
Gx = (z9-z5) and Gy = (z8 - z6)
Sobel operator
Gy = (z3+2z6 +z9) - (z1+2z4+z7) and
Gx = (z7+2z8+z9) - (z1+2z2+z3)
Use of First Derivative for Edge Extraction
Gradient
Robert operator
Sobel operators
Use of First Derivative for Edge Extraction
Gradient
2nd Derivative _ Laplacian
f f 2 2
f 2 2
2
x y
2 f
f ( x 1, y ) f ( x 1, y ) 2 f ( x, y )
x 2
2 f
f ( x, y 1) f ( x, y 1) 2 f ( x, y )
y 2
2 f [ f ( x 1, y ) f ( x 1, y ) f ( x, y 1) f ( x, y 1) 4 f ( y, y )]
Use of 2nd Derivative for Enhancement
Laplacian
2
f 2
f
f 2 2
2
x y
Use of 2nd Derivative for Enhancement
Laplacian
1 1 1
1 -8 1
1 1 1
f ( x, y ) 2 f ( x, y )
g ( x, y )
f ( x , y ) 2
f ( x, yH.R.) Pourreza
Use of 2nd Derivative for Enhancement
Laplacian
2 f [ f ( x 1, y ) f ( x 1, y ) f ( x, y 1) f ( x, y 1) 4 f ( x, y )]
0 1 0
g(x,y) = f(x,y) - 1 -4 1 =
0 1 0
f ( x, y )
2
H.R. Pourreza
Un-sharp Masking and High-boost Filtering
f hb Af ( x, y ) 2 f ( x, y ) A>1
Un-sharp Masking and High-boost Filtering
(b)
H.R. Pourreza
Combining Spatial
Enhancement Methods
Combining Spatial
Enhancement Methods
Thank You