CHAPTER 7 Template Filters IMAGE ANALYSIS A. Dermanis
g ij = f i–1,j–1 h –1,–1 + f i–1,j h –1,0 + f i–1,j+1 h –1,1 + + f i,j–1 h 0,–1 + f i,j h 0,0 + f i,j+1 h 0,1 + + f i+1,j–1 h 1,–1 + f i+1,j h 1,0 + f i+1,j+1 h 1,1 g ij = f i–1,j–1 h –1,–1 + f i–1,j h –1,0 + f i–1,j+1 h –1,1 + + f i,j–1 h 0,–1 + f i,j h 0,0 + f i,j+1 h 0,1 + + f i+1,j–1 h 1,–1 + f i+1,j h 1,0 + f i+1,j+1 h 1,1 Moving templates for image filtering The discrete convolution process in template filtering A. Dermanis
Typical template dimensions Non-square templates viewed as special cases of square ones A. Dermanis
localized g ij = h i,j;k,m f km k=i–p m=j–p i+p j+p Template filters = Localized position-invariant linear transformations of an image Using a (p+1) (p+1) template linear g ij = h i,j;k,m f km k m position-invariant h i,j;k,m = h k–i,m – j g ij = h k–i,m – j f km k m A. Dermanis
Template filters = Localized position-invariant linear transformations of an image renamed (i = 0, j = 0, k = k, m = m) Combination of all properties g ij = h k–i,m–j f km k=i–p m=j–p i+p j+p k = k – i m = m – j g ij = h k,m f i+k,j+m k = –p m = –p p g 00 = h k,m f k,m k = –p m = –p p A. Dermanis
Template filters = Localized position-invariant linear transformations of an image renamed j–1j–1jj+1j+1 i+1i+1 i i–1i–1 h ij f ij g 00 = h –1,–1 f –1,–1 + h –1,0 f –1,+1 + h –1,1 f –1, h 0,–1 f 0,–1 + h 0,0 f 0,0 + h 0,+1 f 0, h +1,–1 f +1,–1 + h +1,0 f +1,0 + h +1,+1 f +1,+1 g 00 = h –1,–1 f –1,–1 + h –1,0 f –1,+1 + h –1,1 f –1, h 0,–1 f 0,–1 + h 0,0 f 0,0 + h 0,+1 f 0, h +1,–1 f +1,–1 + h +1,0 f +1,0 + h +1,+1 f +1,+1 g 00 = h k,m f k,m k = –p m = –p p A. Dermanis
Examples homogeneous areas are set to zero high values emphasize high frequencies f km = C g 00 = h k,m C = 0 k = –p m = –p p h k,m = 0 k = –p m = –p p Examples homogeneous (low frequency) areas preserve their value f km = C g 00 = h k,m C = C k = –p m = –p p 11 11 11 1 22 1 11 8 11 22 4 22 11 11 11 1 22 1 High-pass filters h k,m = 1 k = –p m = –p p Low-pass filters A. Dermanis
An example of low pass filters: The original band 3 of a TM image is undergoing low pass filtering by moving mean templates with dimensions 3 3 and 5 5 An example of low pass filters: The original band 3 of a TM image is undergoing low pass filtering by moving mean templates with dimensions 3 3 and 5 5 Original Moving mean 3 3Moving mean 5 5 A. Dermanis
An example of a high pass filter: The original image is undergoing high pass filtering with a 3 3 template, which enhances edges, best viewed as black lines in its negative An example of a high pass filter: The original image is undergoing high pass filtering with a 3 3 template, which enhances edges, best viewed as black lines in its negative Original high pass filtering 3 3high pass filtering 3 3 (negative) A. Dermanis
evaluation Local interpolation and template formulation interpolation Templates expressing linear operators f km f(x, y) A g(x, y) g(0, 0) g ij h km f km k, m A. Dermanis
Original (TM band 4) Laplacian 9 9Laplacian 13 13 Laplacian 17 17 Examples of Laplacian filters with varying template sizes The Laplacian operator 2 x 2 y 2 A = = + A. Dermanis
Original (TM band 4) Laplacian 5 5 Original + Laplacian 5 5 Examples of Laplacian filters with varying template sizes A. Dermanis
The Roberts and Sobel filters for edge detection Original (TM band 4) Roberts Sobel Roberts filter Sobel filter XY XY X 2+Y 2X 2+Y 2 X 2+Y 2X 2+Y 2 A. Dermanis