Spatial Filtering (Chapter 3)

Slides:



Advertisements
Similar presentations
Linear Filtering – Part I Selim Aksoy Department of Computer Engineering Bilkent University
Advertisements

Topic 6 - Image Filtering - I DIGITAL IMAGE PROCESSING Course 3624 Department of Physics and Astronomy Professor Bob Warwick.
Image Processing Lecture 4
Spatial Filtering.
Image Filtering. Outline Outline Concept of image filter  Focus on spatial image filter Various types of image filter  Smoothing, noise reductions 
Chapter 3 Image Enhancement in the Spatial Domain.
Lecture 6 Sharpening Filters
Frequency Domain Filtering (Chapter 4)
Sliding Window Filters and Edge Detection Longin Jan Latecki Computer Graphics and Image Processing CIS 601 – Fall 2004.
CS 4487/9587 Algorithms for Image Analysis
Digital Image Processing
Digital Image Processing In The Name Of God Digital Image Processing Lecture3: Image enhancement M. Ghelich Oghli By: M. Ghelich Oghli
Image Filtering CS485/685 Computer Vision Prof. George Bebis.
1 Image filtering Hybrid Images, Oliva et al.,
MSU CSE 803 Stockman Linear Operations Using Masks Masks are patterns used to define the weights used in averaging the neighbors of a pixel to compute.
1 Image Filtering Readings: Ch 5: 5.4, 5.5, 5.6,5.7.3, 5.8 (This lecture does not follow the book.) Images by Pawan SinhaPawan Sinha formal terminology.
Segmentation (Section 10.2)
1 Image filtering Images by Pawan SinhaPawan Sinha.
2-D, 2nd Order Derivatives for Image Enhancement
1 Images and Transformations Images by Pawan SinhaPawan Sinha.
MSU CSE 803 Linear Operations Using Masks Masks are patterns used to define the weights used in averaging the neighbors of a pixel to compute some result.
ECE 472/572 - Digital Image Processing Lecture 4 - Image Enhancement - Spatial Filter 09/06/11.
Chapter 3 (cont).  In this section several basic concepts are introduced underlying the use of spatial filters for image processing.  Mainly spatial.
Presentation Image Filters
Computer Vision – Enhancement(Part II) Hanyang University Jong-Il Park.
Spatial Filtering: Basics
Digital Image Processing
Introduction to Image Processing Grass Sky Tree ? ? Sharpening Spatial Filters.
Digital Image Processing Lecture 5: Neighborhood Processing: Spatial Filtering Prof. Charlene Tsai.
Lecture 03 Area Based Image Processing Lecture 03 Area Based Image Processing Mata kuliah: T Computer Vision Tahun: 2010.
Introduction to Image Processing
Digital Image Processing CSC331 Image Enhancement 1.
Image processing Fourth lecture Image Restoration Image Restoration: Image restoration methods are used to improve the appearance of an image.
Chapter 5: Neighborhood Processing
Spatial Filtering.
Digital Image Processing, 3rd ed. © 1992–2008 R. C. Gonzalez & R. E. Woods Gonzalez & Woods Chapter 3 Intensity Transformations.
Image Subtraction Mask mode radiography h(x,y) is the mask.
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities Prof. Charlene Tsai.
Mestrado em Ciência de Computadores Mestrado Integrado em Engenharia de Redes e Sistemas Informáticos VC 15/16 – TP7 Spatial Filters Miguel Tavares Coimbra.
Digital Image Processing Lecture 5: Neighborhood Processing: Spatial Filtering March 9, 2004 Prof. Charlene Tsai.
CSE 6367 Computer Vision Image Operations and Filtering “You cannot teach a man anything, you can only help him find it within himself.” ― Galileo GalileiGalileo.
Image enhancement Last update Heejune Ahn, SeoulTech.
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities May 2, 2005 Prof. Charlene Tsai.
Machine Vision Edge Detection Techniques ENT 273 Lecture 6 Hema C.R.
Filtering the Images.  Filtering images using low-pass filters  Filtering images using a median filter  Applying directional filters to detect edges.
Instructor: Mircea Nicolescu Lecture 7
Instructor: Mircea Nicolescu Lecture 5 CS 485 / 685 Computer Vision.
Sharpening Spatial Filters ( high pass)  Previously we have looked at smoothing filters which remove fine detail  Sharpening spatial filters seek to.
CSE 185 Introduction to Computer Vision Image Filtering: Spatial Domain.
Digital Image Processing Week V Thurdsak LEAUHATONG.
Digital Image Processing CSC331
Sliding Window Filters Longin Jan Latecki October 9, 2002.
Non-linear filtering Example: Median filter Replaces pixel value by median value over neighborhood Generates no new gray levels.
Spatial Filtering (Chapter 3) CS474/674 - Prof. Bebis.
Miguel Tavares Coimbra
Image Subtraction Mask mode radiography h(x,y) is the mask.
Fundamentals of Spatial Filtering:
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities Prof. Charlene Tsai.
Image Pre-Processing in the Spatial and Frequent Domain
ECE 692 – Advanced Topics in Computer Vision
Filtering – Part I Gokberk Cinbis Department of Computer Engineering
CS-565 Computer Vision Nazar Khan Lecture 4.
Spatial Filtering - Enhancement
Digital Image Processing
Digital Image Processing Week IV
Linear Operations Using Masks
Department of Computer Engineering
Image Filtering Readings: Ch 5: 5. 4, 5. 5, 5. 6, , 5
Image Enhancement in the Spatial Domain
DIGITAL IMAGE PROCESSING Elective 3 (5th Sem.)
Presentation transcript:

Spatial Filtering (Chapter 3) CS474/674 - Prof. Bebis

Spatial Filtering Methods (or Mask Processing Methods) output image

Spatial Filtering The word “filtering” has been borrowed from the frequency domain. Filters are classified as: Low-pass (i.e., preserve low frequencies) High-pass (i.e., preserve high frequencies) Band-pass (i.e., preserve frequencies within a band) Band-reject (i.e., reject frequencies within a band)

Spatial Filtering (cont’d) Spatial filtering is defined by: (1) A neighborhood (2) An operation that is performed on the pixels inside the neighborhood output image

Spatial Filtering - Neighborhood Typically, the neighborhood is rectangular and its size is much smaller than that of f(x,y) - e.g., 3x3 or 5x5

Spatial filtering - Operation Assume the origin of the mask is the center of the mask. for a 3 x 3 mask: for a K x K mask:

Spatial filtering - Operation A filtered image is generated as the center of the mask moves to every pixel in the input image. output image

Handling Pixels Close to Boundaries pad with zeroes 0 0 0 ……………………….0 or 0 0 0 ……………………….0

Linear vs Non-Linear Spatial Filtering Methods A filtering method is linear when the output is a weighted sum of the input pixels. Methods that do not satisfy the above property are called non-linear. e.g.,

Linear Spatial Filtering Methods Two main linear spatial filtering methods: Correlation Convolution

Correlation Output Image w(i,j) f(i,j) g(i,j)

Correlation (cont’d) Often used in applications where we need to measure the similarity between images or parts of images (e.g., pattern matching).

Convolution Similar to correlation except that the mask is first flipped both horizontally and vertically. Note: if w(x,y) is symmetric, that is w(x,y)=w(-x,-y), then convolution is equivalent to correlation!

Example Correlation: Convolution:

How do we choose the elements of a mask? Typically, by sampling certain functions. Gaussian 1st derivative of Gaussian 2nd derivative

Filters Smoothing (i.e., low-pass filters) Reduce noise and eliminate small details. The elements of the mask must be positive. Sum of mask elements is 1 (after normalization) Gaussian

Filters (cont’d) Sharpening (i.e., high-pass filters) Highlight fine detail or enhance detail that has been blurred. The elements of the mask contain both positive and negative weights. Sum of the mask weights is 0 (after normalization) 1st derivative of Gaussian 2nd derivative

Smoothing Filters: Averaging (Low-pass filtering)

Smoothing Filters: Averaging (cont’d) Mask size determines the degree of smoothing and loss of detail. original 3x3 5x5 7x7 15x15 25x25

Smoothing Filters: Averaging (cont’d) Example: extract, largest, brightest objects 15 x 15 averaging image thresholding

Smoothing filters: Gaussian The weights are samples of the Gaussian function σ = 1.4 mask size is a function of σ :

Smoothing filters: Gaussian (cont’d) σ controls the amount of smoothing As σ increases, more samples must be obtained to represent the Gaussian function accurately. σ = 3

Smoothing filters: Gaussian (cont’d)

Averaging vs Gaussian Smoothing

Smoothing Filters: Median Filtering (non-linear) Very effective for removing “salt and pepper” noise (i.e., random occurrences of black and white pixels). median filtering averaging

Smoothing Filters: Median Filtering (cont’d) Replace each pixel by the median in a neighborhood around the pixel.

Sharpening Filters (High Pass filtering) Useful for emphasizing transitions in image intensity (e.g., edges).

Sharpening Filters (cont’d) Note that the response of high-pass filtering might be negative. Values must be re-mapped to [0, 255] sharpened images original image

Sharpening Filters: Unsharp Masking Obtain a sharp image by subtracting a lowpass filtered (i.e., smoothed) image from the original image: - =

Sharpening Filters: High Boost Image sharpening emphasizes edges but details (i.e., low frequency components) might be lost. High boost filter: amplify input image, then subtract a lowpass image. (A-1) + =

Sharpening Filters: High Boost (cont’d) If A=1, we get a high pass filter If A>1, part of the original image is added back to the high pass filtered image.

Sharpening Filters: High Boost (cont’d)

Sharpening Filters: Derivatives Taking the derivative of an image results in sharpening the image. The derivative of an image can be computed using the gradient.  

Sharpening Filters: Derivatives (cont’d) The gradient is a vector which has magnitude and direction: or (approximation)

Sharpening Filters: Derivatives (cont’d) Magnitude: provides information about edge strength. Direction: perpendicular to the direction of the edge.  

Sharpening Filters: Gradient Computation Approximate gradient using finite differences: sensitive to vertical edges Δx sensitive to horizontal edges

Sharpening Filters: Gradient Computation (cont’d)

Example

Sharpening Filters: Gradient Computation (cont’d) We can implement and using masks: (x+1/2,y) good approximation at (x+1/2,y) (x,y+1/2) * * good approximation at (x,y+1/2) Example: approximate gradient at z5

Sharpening Filters: Gradient Computation (cont’d) A different approximation of the gradient: good approximation (x+1/2,y+1/2) * We can implement and using the following masks:

Sharpening Filters: Gradient Computation (cont’d) Example: approximate gradient at z5 Other approximations Sobel

Example

Sharpening Filters: Laplacian The Laplacian (2nd derivative) is defined as: (dot product) Approximate derivatives:

Sharpening Filters: Laplacian (cont’d) Laplacian Mask detect zero-crossings

Sharpening Filters: Laplacian (cont’d) Sobel Laplacian