Beruflich Dokumente
Kultur Dokumente
output image
Spatial Filtering
The word filtering has been borrowed from the frequency domain. Filters can be classified as:
Low-pass (i.e., preserve low frequencies) High-pass (i.e., preserve high frequencies) Band-pass (i.e., preserve frequencies within a band) Band-reject (i.e., preserve frequencies outside a band)
output image
s 1 t 1
w(s, t ) f ( x s, y t )
for a K x K mask:
g ( x, y )
s K /2 t K /2
K /2
K /2
w( s, t ) f ( x s, y t )
output image
Mask Elements
The sum of weights in a mask affect the overall intensity of the resulting image. Typically, a mask is normalized such that the sum of weights is equal to one. When a mask contains negative values, it is normalized such that the sum of weights is equal to zero.
1/9
1/16
1/4
or
Correlation
g
Output Image
g ( x, y ) w( x, y ) f ( x, y )
s K /2 t K /2
K /2
K /2
w( s, t ) f ( x s, y t )
Correlation (contd)
It is often used in applications where it is necessary to measure the similarity between images or parts of images.
Convolution
Same as correlation except that the mask is flipped both horizontally and vertically.
g ( x, y ) w( x, y ) f ( x, y )
s K /2 t K /2
K /2
K /2
w( s, t ) f ( x s, y t )
Example
Correlation:
Convolution:
Gaussian
Filters
Smoothing (i.e., low-pass filters)
The elements of the mask must be positive
Gaussian
15x15
25x25
averaging
median filtering
(A-1)
A=1.4
A=1.9
f f || | or | x y
(cheaper approximation)
Magnitude: provides information about edge strength. Direction: perpendicular to the direction of the edge.
(x,y+1/2) *
We can implement
and
Other approximations
Sobel