Computer Vision: Chapter III: Image Filtering (PDF)

Summary

This document is a presentation detailing image filtering techniques in computer vision. It covers various concepts such as linear filtering, Gaussian filtering, and non-linear filtering. Key topics include applying filters, handling edges, and understanding noise types affecting image quality.

Full Transcript

Computer Vision Chapter III: Image Filtering Prepared by Miss. Vannkinh Nom Recall ❑ What are the differences between RGB and RGBA? ❑ Why does grayscale image intensity range from 0 to 255, and why can't it exceed this value?...

Computer Vision Chapter III: Image Filtering Prepared by Miss. Vannkinh Nom Recall ❑ What are the differences between RGB and RGBA? ❑ Why does grayscale image intensity range from 0 to 255, and why can't it exceed this value? 2 Recall: Data Collection 3 Outline ❑ What is Image Filtering? ❑ Linear Filtering ❑ Gaussian Filtering ❑ Nonlinear Filtering ❑ Fun Filtering Application: Hybrid Images 4 Outline ❑ What is Image Filtering? ❑ Linear Filtering ❑ Gaussian Filtering ❑ Nonlinear Filtering ❑ Fun Filtering Application: Hybrid Images 5 What is Image Filtering? ❑ Image filtering is a technique used to modify or enhance the visual appearance of an image. ❑ It is applied to achieve various effects, such as reducing noise, sharpening details, enhancing edges, and detecting features within the image. 6 What is Image Filtering? ❑ Image Filtering Techniques: The Gaussain Filter High-Pass Filters Medain Filter Low-Pass Filters Bilateral Filter Morphological Filters Sobel Operator Anisotropic Diffusion The Laplacian of Gaussian (LoG) Adaptive Filters 7 Discussion ❑ Group 1: ❑ Group 2: The Gaussain Filter Bilateral Filter Medain Filter Sobel Operator ❑ Group 5: Anisotropic Diffusion Adaptive Filters ❑ Group 3: ❑ Group 4: The Laplacian of Gaussian (LoG) Low-Pass Filters High-Pass Filters Morphological Filters 8 Outline ❑ What is Image Filtering? ❑ Linear Filtering ❑ Gaussian Filtering ❑ Nonlinear Filtering ❑ Fun Filtering Application: Hybrid Images 9 Linear Filtering ❑ Linear filtering is an image processing method that modifies an image by applying a filter or kernel to each pixel, considering the values of neighboring pixels. Input Filter Output ∗ = 10 Adapted from D. Fouhey and J. Johnson Linear Filtering ❑ Applying a linear filter Input Filter Output ∗ = 𝑂11 = 𝐼11 ∙ 𝑓11 + 𝐼12 ∙ 𝑓12 + 𝐼13 ∙ 𝑓13 + … + 𝐼33 ∙ 𝑓33 11 Adapted from D. Fouhey and J. Johnson Linear Filtering ❑ Applying a linear filter Input Filter Output ∗ = 𝑂12 = 𝐼12 ∙ 𝑓11 + 𝐼13 ∙ 𝑓12 + 𝐼14 ∙ 𝑓13 + … + 𝐼34 ∙ 𝑓33 12 Adapted from D. Fouhey and J. Johnson Linear Filtering ❑ Applying a linear filter Input Filter Output ∗ = 𝑂13 = 𝐼13 ∙ 𝑓11 + 𝐼14 ∙ 𝑓12 + 𝐼15 ∙ 𝑓13 + … + 𝐼35 ∙ 𝑓33 13 Adapted from D. Fouhey and J. Johnson Linear Filtering ❑ Applying a linear filter Input Filter Output ∗ = 𝑂14 = 𝐼14 ∙ 𝑓11 + 𝐼15 ∙ 𝑓12 + 𝐼16 ∙ 𝑓13 + … + 𝐼36 ∙ 𝑓33 14 Adapted from D. Fouhey and J. Johnson Linear Filtering ❑ Applying a linear filter Input Filter Output ∗ = 𝑂21 = 𝐼21 ∙ 𝑓11 + 𝐼22 ∙ 𝑓12 + 𝐼23 ∙ 𝑓13 + … + 𝐼43 ∙ 𝑓33 15 Adapted from D. Fouhey and J. Johnson Linear Filtering ❑ Applying a linear filter Input Filter Output ∗ = 16 Adapted from D. Fouhey and J. Johnson Linear Filtering ❑ Find the output of the matrix Input Filter Output 2 5 3 1 0 8 1 4 6 7 3 4 1 1 1 1 6 1 0 2 3 ∗ 1 1 1 = 5 3 2 5 5 7 1 1 1 7 2 1 2 3 4 17 Adapted from D. Fouhey and J. Johnson Linear Filtering ❑ Find the output of the matrix Input Filter Output 2 5 3 1 0 8 1 4 6 7 3 4 0 2 2 1 6 1 0 2 3 ∗ 1 1 0 = 5 3 2 5 5 7 0 1 2 7 2 1 2 3 4 18 Adapted from D. Fouhey and J. Johnson Dealing with edges To control the size of the output, we need to use padding Output is smaller Output is same size Output is larger than input as input than input 𝑓 𝑓 𝑓 𝑓 𝑓 𝑓 𝐼 𝐼 𝐼 𝑓 𝑓 𝑓 𝑓 𝑓 𝑓 19 Adapted from D. Fouhey and J. Johnson Dealing with edges ❑ To control the size of the output, we need to use padding ❑ What values should we pad the image with? Zero pad (or clip filter) Wrap around Copy edge Reflect across edge 20 Source: S. Marschner Note: Filtering vs. “convolution” ❑ In classical signal processing terminology, convolution is filtering with a flipped kernel, and filtering with an upright kernel is known as cross-correlation Check convention of filtering function you plan to use! Filtering or “cross-correlation” “Convolution” (Kernel in original orientation) (Kernel flipped in x and y) 21 Adapted from D. Fouhey and J. Johnson Practice with linear filters ? 0 0 0 0 1 0 0 0 0 Original 22 Source: D. Lowe Practice with linear filters 0 0 0 0 1 0 0 0 0 Original One surrounded Filtered by zeros is the (no change) identity filter 23 Source: D. Lowe Practice with linear filters 0 0 0 0 0 1 ? 0 0 0 Original 24 Source: D. Lowe Practice with linear filters 0 0 0 0 0 1 0 0 0 Original Shifted left By one pixel 25 Source: D. Lowe Practice with linear filters 1 1 1 1 1 1 ? 1 1 1 Original 26 Source: D. Lowe Practice with linear filters 1 1 1 1 1 1 1 1 1 Original Blur (with a box filter) 27 Source: D. Lowe Practice with linear filters - 0 0 0 1 1 1 0 2 0 0 0 0 1 1 1 1 1 1 ? Original 28 Source: D. Lowe Practice with linear filters - 0 0 0 1 1 1 0 2 0 1 1 1 0 0 0 1 1 1 Sharpening filter: Original Accentuates differences Sharpened with local average (Note that filter sums to 1) 29 Source: D. Lowe Sharpening 30 Source: D. Lowe Sharpening Original Smoothed Detail – = Original Detail Sharpened + = 31 Source: S. Gupta Outline ❑ What is Image Filtering? ❑ Linear Filtering ❑ Gaussian Filtering ❑ Nonlinear Filtering ❑ Fun Filtering Application: Hybrid Images 32 Smoothing with box filter 33 Source: D. Lowe Smoothing with Gaussian filter 34 Source: D. Lowe Gaussian filters ❑ Blob Size in Gaussian Filtering and Object Detection: High σ values are effective for detecting large-scale structures or blobs in the image. Low σ values are used to identify fine-scale features standard deviation and smaller objects. (determines size of “blob”) 𝜎 = 1 𝜎 = 2 𝜎 = 4 𝜎 = 8 35 Adapted from D. Fouhey and J. Johnson Applying Gaussian filters Input image (no filter) 36 Adapted from D. Fouhey and J. Johnson Applying Gaussian filters 𝜎 = 1 37 Applying Gaussian filters 𝜎 = 2 38 Applying Gaussian filters 𝜎 = 4 39 Applying Gaussian filters 𝜎 = 8 40 Outline ❑ What is Image Filtering? ❑ Linear Filtering ❑ Gaussian Filtering ❑ Nonlinear Filtering ❑ Fun Filtering Application: Hybrid Images 41 Different types of noise ❑ Gaussian filtering is appropriate for additive, zero-mean noise (assuming nearby pixels share the same value) 42 Different types of noise ❑ What about impulse or shot noise, i.e., when some pixels are arbitrarily replaced by spurious values? 43 Alternative idea: Median filtering ❑ A median filter operates over a window by selecting the median intensity in the window 10 15 20 10 15 20 23 90 27 10 15 20 23 27 30 31 33 90 23 27 27 33 31 30 33 31 30 Sort Replace 44 Median filtering ❑ What is the value of Median? 2 5 3 1 0 8 2 5 3 2 5 3 1 4 6 7 3 4 1 1 4 6 2 1 4 6 3 1 6 1 0 2 3 1 6 1 1 6 1 5 3 2 5 5 7 7 2 1 2 3 4 M= M= M= 45 Applying median filter Input image (no filter) 46 Applying median filter median filter (width = 3) 47 Applying median filter median filter (width = 3) 48 Applying median filter median filter (width = 7) 49 Outline ❑ What is Image Filtering? ❑ Linear Filtering ❑ Gaussian Filtering ❑ Nonlinear Filtering ❑ Fun Filtering Application: Hybrid Images 50 Application: Hybrid images A. Oliva, A. Torralba, P.G. Schyns, Hybrid Images, SIGGRAPH 2006 51 Application: Hybrid images Gaussian filter Laplacian filter 52 Application: Hybrid images 53 Question What are the differences between Linear Filters and Non-Linear Filters? 54

Use Quizgecko on...
Browser
Browser