1. Trang chủ
  2. » Công Nghệ Thông Tin

Digital Image Processing: Image Enhancement Spatial Filtering - Duong Anh Duc

40 122 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 40
Dung lượng 1,2 MB

Nội dung

Digital Image Processing: Image Enhancement Spatial Filtering - Duong Anh Duc includes Image Enhancement - Spatial Filtering; How to specify T; Smoothing Filters; Image smoothing by averaging (lowpass spatial filtering); Image Sharpening; High-boost filtering; Prewitt operators.

Digital Image Processing Image Enhancement Spatial Filtering 21/11/15 Duong Anh Duc - Digital Image Processing Image Enhancement: Spatial Filtering  Image enhancement in the spatial domain can be represented as: Transformation Enhanced Image g(m,n) = T(f)(m,n) Given Image  The transformation T maybe linear or nonlinear We will mainly study linear operators T but will see one important nonlinear operation 21/11/15 Duong Anh Duc - Digital Image Processing How to specify T  If the operator T is linear and shift invariant (LSI), characterized by the pointspread sequence (PSS) h(m,n) , then (recall convolution) 21/11/15 Duong Anh Duc - Digital Image Processing How to specify T  In practice, to reduce computations, h(m,n) is of “finite extent: h(k,l) = for (k,l) where is a small set (called neighborhood) is also called as the support of h  In the frequency domain, this can be represented as: G(u,v) = He(u,v) Fe(u,v)  where He(u,v) and Fe(u,v) are obtained after appropriate zeropadding 21/11/15 Duong Anh Duc - Digital Image Processing How to specify T  Many LSI operations can be interpreted in the frequency domain as a “filtering operation.” It has the effect of filtering frequency components (passing certain frequency components and stopping others)  The term filtering is generally associated with such operations 21/11/15 Duong Anh Duc - Digital Image Processing How to specify T  Examples of some common filters (1-D case): Lowpass filter 21/11/15 Highpass filter Duong Anh Duc - Digital Image Processing  If h(m, n) is a by mask given by w1 w2 w3 h= w4 w5 w6 w7 w8 w9 then 21/11/15 Duong Anh Duc - Digital Image Processing  The output g(m, n) is computed by sliding the mask over each pixel of the image f(m, n) This filtering procedure is sometimes referred to as moving average filter  Special care is required for the pixels at the border of image f(m, n) This depends on the so-called boundary condition Common choices are:    21/11/15 The mask is truncated at the border (free boundary) The image is extended by appending extra rows/columns at the boundaries The extension is done by repeating the first/last row/column or by setting them to some constant (fixed boundary) The boundaries “wrap around” (periodic boundary) Duong Anh Duc - Digital Image Processing  In any case, the final output g(m, n) is restricted to the support of the original image f(m, n)  The mask operation can be implemented in MATLAB using the filter2 command, which is based on the conv2 command 21/11/15 Duong Anh Duc - Digital Image Processing Smoothing Filters  Image smoothing refers to any image-to-image transformation designed to “smooth” or flatten the image by reducing the rapid pixel-to-pixel variation in grayvalues  Smoothing filters are used for: Blurring: This is usually a preprocessing step for removing small (unwanted) details before extracting the relevant (large) object, bridging gaps in lines/curves,  Noise reduction: Mitigate the effect of noise by linear or nonlinear operations  21/11/15 Duong Anh Duc - Digital Image Processing 10 Example Original Image 21/11/15 Highpass filtering Duong Anh Duc - Digital Image Processing 26 High-boost filtering  This is a filter whose output g is produced by subtracting a lowpass (blurred) version of f from an amplified version of f g(m,n) = Af(m,n) – lowpass(f(m,n)) This is also referred to as unsharp masking 21/11/15 Duong Anh Duc - Digital Image Processing 27 High-boost filtering  Observe that g(m,n) = Af(m,n) – lowpass(f(m,n)) = (A-1)f(m,n) + f(m,n) – lowpass(f(m,n)) = (A-1)f(m,n) + hipass(f(m,n))  For > A , part of the original image is added back to the highpass filtered version of f  The result is the original image with the edges enhanced relative to the original image 21/11/15 Duong Anh Duc - Digital Image Processing 28 Example Original Image 21/11/15 Highpass filtering Duong Anh Duc - Digital Image Processing High-boost filtering 29 Derivative filter  Averaging tends to blur details in an image Averaging involves summation or integration  Naturally, differentiation or “differencing” would tend to enhance abrupt changes, i.e., sharpen edges  Most common differentiation operator is the gradient: 21/11/15 Duong Anh Duc - Digital Image Processing 30 Derivative filter  The magnitude of the gradient is:  Discrete approximations to the magnitude of the gradient is normally used 21/11/15 Duong Anh Duc - Digital Image Processing 31 Derivative filter  Consider the following image region: z1 z2 z3 z4 z5 z6 z7 z8 z9  We may use the approximation: 21/11/15 Duong Anh Duc - Digital Image Processing 32 Derivative filter  This can implemented using the masks:  As follows: 21/11/15 Duong Anh Duc - Digital Image Processing 33 Derivative filter  Alternatively, we may use the approximation:  This can implemented using the masks:  As follows: 21/11/15 Duong Anh Duc - Digital Image Processing 34 Derivative filter  The resulting maks are called Roberts cross-gradient operators  The Roberts operators and the Prewitt/Sobel operators (described later) are used for edge detection and are sometimes called edge detectors 21/11/15 Duong Anh Duc - Digital Image Processing 35 Example: Roberts cross-gradient operator 21/11/15 Duong Anh Duc - Digital Image Processing 36 Example: Roberts cross-gradient operator 21/11/15 Duong Anh Duc - Digital Image Processing 37 Prewitt operators  Better approximations to the gradient can be obtained by:  This can be implemented using the masks: as follows: 21/11/15 Duong Anh Duc - Digital Image Processing 38 Sobel operators  Another approximation is given by the masks:  The resulting masks are called Sobel operators 21/11/15 Duong Anh Duc - Digital Image Processing 39 Example Prewitt 21/11/15 Sobel Duong Anh Duc - Digital Image Processing 40 ... Duong Anh Duc - Digital Image Processing 13 Example of Image Blurring N = 11 21/11/15 N = 21 Duong Anh Duc - Digital Image Processing 14 Example of noise reduction Noise-free Image 21/11/15 Duong. .. lowpass filtering 21/11/15 Duong Anh Duc - Digital Image Processing 11 Example of Image Blurring Original Image 21/11/15 Duong Anh Duc - Digital Image Processing Avg Mask 12 Example of Image Blurring... lowpass(f(m,n)) 21/11/15 Duong Anh Duc - Digital Image Processing 25 Example Original Image 21/11/15 Highpass filtering Duong Anh Duc - Digital Image Processing 26 High-boost filtering  This is a

Ngày đăng: 30/01/2020, 06:17

TỪ KHÓA LIÊN QUAN