03-3 - Spatial filtering fundamentals

03-3 - Spatial filtering fundamentals - Spatial filtering...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
4/28/2008 1 Spatial filtering fundamentals Spring 2008 ELEN 4304/5365 DIP 1 by Gleb V. Tcheslavski: [email protected] http://ee.lamar.edu/gleb/dip/index.htm Mechanics of spatial filtering Considering frequency domain filtering, the effect of LPF applied to an image is to blur (smooth) it. Similar smoothing effect can be achieved by using spatial filters ( spatial masks, kernels, templates, or windows ). We discussed that a spatial filter consists of a neighborhood and a pre-defined operation performed on the image pixels defining the neighborhood. The result of filtering – a new pixel with coordinated of the neighborhood’s center and the value defined by the operation. Spring 2008 ELEN 4304/5365 DIP 2 If the operation is linear, the filter is said to be a linear spatial filter .
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
4/28/2008 2 Mechanics of spatial filtering Assuming a 3 x 3 neighborhood, at any point ( x,y ) in the image, the response of the spatial filter is ( , ) ( 1 , 1 ) (1 , 1 ) ( 1 , 0 ) , ) . . . ( 0 , 0 )(,). . . ( 1 , 1 )( 1 , 1 ) gxy w f x y w y wf x y w f x y =− +− + ++ + + + Filter coefficient Pixel intensity In general: ab Spring 2008 ELEN 4304/5365 DIP 3 (, ) (,) ( , ) sa tb wstf x sy t = ∑ ∑ Mechanics of spatial filtering Here a mask size is m x n . 21 ma nb =+ Where a and b are some integers. Spring 2008 ELEN 4304/5365 DIP 4 For a 3 x 3 mask
Background image of page 2
4/28/2008 3 Spatial correlation and convolution Correlation is a process of moving the filter mask over the image and computing the the image and computing the sum of products at each location as previously described. Convolution is the same except that the filter is first rotated by 180 0 Spring 2008 ELEN 4304/5365 DIP 5 . For a 1D case, we first zero- pad f by m -1 zeros on each size. We compute a sum of products in both cases… Spatial correlation and convolution Correlation is a function of displacement of the filter. A function containing a single 1 with the rest being zeros is called a discrete unit impulse . Correlation of a function with a discrete unit impulse yields a rotated version of a function at the location of the impulse. To perform a convolution, we need to pre-rotate the filter by 180 0 and perform the same operation as in correlation. Spring 2008 ELEN 4304/5365 DIP 6
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
4/28/2008 4 Spatial correlation and convolution In a 2D case, for a filter of size m x n , we pad the image with m -1 rows of zeros at the top and bottom and n -1 columns of zeros on the left and right. For convolution, we pre-rotate the mask and perform the Spring 2008 ELEN 4304/5365 DIP 7 sliding sum of products. Spatial correlation and convolution Correlation of a filter w ( x,y ) of size m x n with an image f ( x,y ) is ab (, ) (,) ( , ) sa tb wxy f xy wst f x sy t =− = + + ∑∑ : , ) = −= = Convolution of a filter w ( x,y ) of size m x n with an image f ( x,y ) is Spring 2008 ELEN 4304/5365 DIP 8
Background image of page 4
4/28/2008 5 Vector representation of linear filtering It is convenient sometimes to represent a sum of products as 1 mn kk k Rw z = = = T wz Filter coeffs Image intensities For example, for a 3 x 3 filter: Spring 2008 ELEN 4304/5365 DIP 9 9 1 k z = = = T Generating spatial filter masks Generating an m x n linear spatial filter requires specification of mn mask coefficients. These coefficients are selected
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 16

03-3 - Spatial filtering fundamentals - Spatial filtering...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online