1、Digital Image Processing,Prof. Dr.Chen HuiSchool of ISE, Shandong University email: ,Lecture 8,Spatial Filtering,Background Smoothing Filters Sharpening Filters,Spatial Filtering no. 1,linear filter: Spatial filter, mask, template, window. nonlinear filter:Median, minimal, or maximal value of a neig
2、hborhood.,Background of Spatial Filtering,Spatial Filtering no. 2,Odd size The border?,Background of Spatial Filtering(cont.),Linear filters: the transfer function and the point spread function of a linear system are inverse Fourier transforms of each other.,s1s9 intensities of pixels. k1k9 mask coe
3、fficients. .,Spatial Filtering no. 3,Convolution mask,Smoothing Filters,Smoothing filters are used for blurring and for noise reduction. Lowpass filtering (linear) : all the coefficients be positive.,Such as, sampled by a Gaussian function,Neighborhood averaging, weighted neighborhood averaging, sca
4、led not to out of the valid gray-level range(for mn mask normalized by 1/( mn).,Spatial Filtering no. 4,Examples of averaging Filter,a) Original image, b) noise corrupted , c)e) results of smoothing template by size of 77, 9 9, and 11 11.,Spatial Filtering no. 5,Examples of averaging Filter,Spatial
5、Filtering no. 6,Irrelevant details vs. Mask size,Example of averaging Filter,Spatial Filtering no. 7,Small objects blended with background,size of mask?,Median filter (nonlinear),The gray level of each pixel is replaced by the median of the graylevels in a neighborhood of that pixel, instead of aver
6、aging.To achieve noise reduction rather than blurring.,The 5th value of a 33 window , Minimal or maximal .,Spatial Filtering no. 8,Sharpening Filters,The objective is to highlight fine detail in an image or to enhancedetail that has been blurred. Basic high-pass spatial filtering High-boost filterin
7、g Derivative filters Laplacian filters,Printing, medical, inspection, target detection,A classic implementation of sharpening filter, Eliminates zero-frequency term,Indicate positive near center, negative in the outer periphery,Spatial Filtering no. 9,Example of High-pass Filter,Reducing the average
8、 value of image to zero implies that image must have some negative gray levels. Thus involve some form of scaling/clipping so final result span the range 0, L-1,Spatial Filtering no. 10,High-boost Filtering,A high-pass filtered image may be computed as, Highpass=Original Lowpass The definition of hi
9、gh-boost or High-frequency emphasis filter isHigh boost =(A) Original Lowpass=(A-1) Original + OriginalLowpass= (A-1) Original +Highpass,w=9A-1,A=1 standard highpass result A1 part of the original is added back to highpass result, restore low frequency component. Looks more like original with edge e
10、nhancement.,Spatial Filtering no. 11,Example of High-boost Filter,a) original, b) Highpass, c) Highboost a=2, d) extend gray-level of (c),Spatial Filtering no. 12,Derivative Filters (nonlinear),Averaging pixels over a region tends to blur detail in an image. As averaging is analogous to integration,
11、 differentiation can be expected to have the opposite effect and thus sharpen an image. The gradient of f at coordinate (x,y) is defined as the vector,The magnitude of this vector ,Spatial Filtering no. 13,Derivative Filter approximation,Roberts cross-gradient operators,Prewitt operators,Spatial Fil
12、tering no. 14,Derivative Filter approximation(cont),Sobel operators,Spatial Filtering no. 15,Example of Derivative Filter,Spatial Filtering no. 16,Laplacian Filters,Laplacian operator,Spatial Filtering no. 17,Example of Derivatives,Spatial Filtering no. 18,1D edge detection,Spatial Filtering no. 18,
13、1D edge detection,Spatial Filtering no. 18,Double thin edge or?,The zero-crossings of s(x) mark possible edges.,Laplacian enhancement,Spatial Filtering no. 19,Example of Laplacian Filters,Spatial Filtering no. 20,High-boost mask,Spatial Filtering no.21,Example of High-boost Filter,Spatial Filtering
14、no.22,Example of combined filtering,Spatial Filtering no.23,Example of combined filtering(cont.),Spatial Filtering no.24,Review Questions,Explain the idea of smoothing filter Explain the idea of sharpening filter Explain the idea of media filter,Recommended Reading,Gonzalez + Woods: Chapter 3,Image Enhancement no. 37,