Fundamentals of Spatial Filtering

Slides:



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

Spatial Filtering (Chapter 3)
CS & CS Multimedia Processing Lecture 2. Intensity Transformation and Spatial Filtering Spring 2009.
Spatial Filtering.
Chapter 3 Image Enhancement in the Spatial Domain.
Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department
Sliding Window Filters and Edge Detection Longin Jan Latecki Computer Graphics and Image Processing CIS 601 – Fall 2004.
Digital Image Processing
6/9/2015Digital Image Processing1. 2 Example Histogram.
Image Filtering CS485/685 Computer Vision Prof. George Bebis.
CHAPTER 4 Image Enhancement in Frequency Domain
7. Neighbourhood operations A single pixel considered in isolation conveys information on the intensity and colour at a single location in an image, but.
Image Enhancement in the Frequency Domain Part I Image Enhancement in the Frequency Domain Part I Dr. Samir H. Abdul-Jauwad Electrical Engineering Department.
Digital Image Processing, 2nd ed. www. imageprocessingbook.com © 2001 R. C. Gonzalez & R. E. Woods 1 Objective To provide background material in support.
CS443: Digital Imaging and Multimedia Filters Spring 2008 Ahmed Elgammal Dept. of Computer Science Rutgers University Spring 2008 Ahmed Elgammal Dept.
Lecture 2. Intensity Transformation and Spatial Filtering
Chapter 4 Image Enhancement in the Frequency Domain.
Digital Image Processing, 2nd ed. © 2002 R. C. Gonzalez & R. E. Woods Chapter 4 Image Enhancement in the Frequency Domain Chapter.
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
Image Processing © 2002 R. C. Gonzalez & R. E. Woods Lecture 4 Image Enhancement in the Frequency Domain Lecture 4 Image Enhancement.
Basis beeldverwerking (8D040) dr. Andrea Fuster Prof.dr. Bart ter Haar Romeny dr. Anna Vilanova Prof.dr.ir. Marcel Breeuwer Convolution.
Digital Image Processing Lecture12: Basics of Spatial Filtering.
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.
Digital Image Processing CSC331 Image Enhancement 1.
Chapter 5: Neighborhood Processing
Course Website: Digital Image Processing Image Enhancement (Spatial Filtering 1)
Lecture 5 Mask/Filter Transformation 1.The concept of mask/filters 2.Mathematical model of filtering Correlation, convolution 3.Smoother filters 4.Filter.
Spatial Filtering.
Ch5 Image Restoration CS446 Instructor: Nada ALZaben.
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.
CSC508 Convolution Operators. CSC508 Convolution Arguably the most fundamental operation of computer vision It’s a neighborhood operator –Similar to the.
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities Prof. Charlene Tsai.
Chapter 5: Neighborhood Processing 5.1 Introduction
Digital Image Processing Lecture 5: Neighborhood Processing: Spatial Filtering March 9, 2004 Prof. Charlene Tsai.
Sejong Univ. CH3. Area Processes Convolutions Blurring Sharpening Averaging vs. Median Filtering.
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities May 2, 2005 Prof. Charlene Tsai.
Digital Image Processing Part 3 Spatial Domain Processing.
Gholamreza Anbarjafari, PhD Video Lecturers on Digital Image Processing Digital Image Processing Spatial Domain Filtering: Part I.
Image Filtering with GLSL DI1.03 蔡依儒. Outline Convolution Convolution Convolution implementation using GLSL Convolution implementation using GLSL Commonly.
1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng.
CSE 185 Introduction to Computer Vision Image Filtering: Spatial Domain.
BYST Xform-1 DIP - WS2002: Fourier Transform Digital Image Processing Bundit Thipakorn, Ph.D. Computer Engineering Department Fourier Transform and Image.
Image Processing Lab Section 28/3/2016 Prepared by Mahmoud Abdelsatar Demonstrator at IT Dep. Faculty of computers and information Assuit University.
Spatial Filtering (Chapter 3) CS474/674 - Prof. Bebis.
Image Enhancement in the Spatial Domain.
Medical Image Analysis
Spatial Image Enhancement
Image Subtraction Mask mode radiography h(x,y) is the mask.
Basic Principles Photogrammetry V: Image Convolution & Moving Window:
Basis beeldverwerking (8D040) dr. Andrea Fuster dr. Anna Vilanova Prof
Fundamentals of Spatial Filtering:
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities Prof. Charlene Tsai.
Spatial & Frequency Domain
Image Enhancement in the
Filtering – Part I Gokberk Cinbis Department of Computer Engineering
Digital Image Processing
ENG4BF3 Medical Image Processing
Fundamentals of Spatial Filtering
9th Lecture - Image Filters
Intensity Transformation and Spatial Filtering
4. Image Enhancement in Frequency Domain
Digital Image Processing
Digital Image Processing
Lecture 5: Resampling, Compositing, and Filtering Li Zhang Spring 2008
Digital Image Processing Week IV
Interesting article in the March, 2006 issue of Wired magazine
Image Enhancement in Spatial Domain: Neighbourhood Processing
Presentation transcript:

Fundamentals of Spatial Filtering D. Veton Kepuska based on Digital Image processing by r.C. Gonzalez and R.W. Woods

Fundamentals of Spatial Filtering In this chapter we will discuss the use of spatial filters for image processing. Spatial filtering is used in a broad spectrum of image processing applications, so a solid understanding of filtering principles is important. The filtering examples in this section deal mostly with image enhancement. The name filter is borrowed from frequency domain processing and it refers to passing, modifying, or rejecting specified frequency components of an image. Example: Filter that passes low frequencies is called a lowpass filter. The effect of applying lowpass filter in the image is to smooth it and consequently blurring the image. We can accomplish this filtering effects similar to smoothing directly on the image itself by using spatial filters. Spatial filtering modifies an image by replacing the value of each pixels by function of the values of the pixels and its neighbors. If the operation performed on the image pixels is linear, then the filter is called a linear spatial filter. Otherwise the filter is a nonlinear spatial filter.

Linear Spatial Filtering A linear spatial filter performs a sum-of-products operation between an image 𝑓 and a filter kernel, 𝑤. The kernel is an array whose size defines the neighborhood of operation, and whose coefficients determine the nature of the filter. Other terms used to refer to a spatial filter kernel are mask, template, and window. Filter kernel or simply kernel will be used. Figure 3.24 illustrates the mechanics of linear spatial filtering using a 3x3 kenel. At any point (x,y) in the image, the response, 𝒈(𝒙,𝒚). Of the filter is the sum of products of the kernel coefficients and the image pixels encompassed by the kernel. 𝑔 𝑥,𝑦 = 𝑤 −1,−1 𝑓 𝑥−1,𝑦−1 +𝑤 −1,0 𝑓 𝑥−1,𝑦 +⋯ 𝑤 0,0 𝑓 𝑥,𝑦 +⋯ 𝑤 1,0 𝑓 𝑥+1,𝑦 +𝑤 1,1 𝑓(𝑥+1,𝑦+1) (3-40) As coordinates of 𝑥,𝑦 are varied, the center of the kernel moves from pixel to pixel, generating the filtered image, 𝑔, in the process

Linear Spatial Filtering Kernel coefficient 𝑤(0,0) align with the pixel at location (𝑥,𝑦). For kernel of size 𝑚x𝑛, we assume that 𝑚=2𝑎+1 and 𝑛=2𝑏+1, where a and b are nonnegative integers. Kernels are of odd sizes in both coordinate directions (why?). Filtering operation of an image of size 𝑴x𝑵 with a kernel of size 𝒎x𝒏 is given by the expression: 𝑔 𝑥,𝑦 = 𝑠=−𝑎 𝑎 𝑡=−𝑏 𝑏 𝑤 𝑠,𝑡 𝑓 𝑥+𝑠,𝑦+𝑡 (3-40) where 𝑥 and 𝑦 are varied so that the center (origin) of the center of the kernel visits every pixel in 𝑓 once. For a fixed value of (x,y), Eq.(3-40) implements the sum of products of the form shown in in Eq. (3-39) This equation representes a central tool in linear filtering operation.

Spatial Correlation and Convolution

Spatial Correlation and Convolution Spatial correlation is illustrated graphically in the Fig. 3.34, presented here for convenience. This process is described by the Eq. (3-40) algebraically. Correlation consist of moving the center of a kernel over an image, and computing the sum of products at each location. The mechanics of spatial convolution are the same, except that the correlation kernel is rotated by 1800 . If values of a kernel are symmetric about its center, correlation and convolution yield the same result.

Example of Correlation vs. Convolution 1-D example of correlation by applying the Eq. (3-40): 𝑔 𝑥 = 𝑠=−𝑎 +𝑎 𝑤 𝑠 𝑓(𝑥+𝑠) (3-41) Figure 3.35(a) shows a 1-D function, f, and a correlation kernel, w; {1,2,4,2,8} Figure 3.35(i) shows the same 1-D function, f, and a convolution kernel, w; {8,2,4,2,1} First thing to notice is edge effects where the kernel w lies outside f, so the summation is undefined in that area. Solution: Padding function f with enough 0’s on either side, or a first value of the data array, or reflected values of the actual data. For the kernel of size 1xm, we need (m-1)/2 zeros (depending of the approach we take) on either side of f in order to handle the beginning and ending configurations of w with respect to f. Figure 3.35(c) shows a properly padded function. In this starting configuration, all coefficients of the kernel overlap valid values.

Example of Correlation vs. Convolution Correlation computation Initial application of Eq. (3-41) with 𝑥=0: 𝑔 0 = 𝑠=−2 +2 𝑤 𝑠 𝑓 𝑠+0 =0 To obtain the second value 𝑔(1) we need to shift the relative position of 𝑤 and 𝑓 one pixel location to the right, i.e., 𝑥 = 1, and compute sum of product once again, etc. The result of this, as indicated in the right side, is: x=1 & 𝑔 1 =8, x=2 & 𝑔 2 =2, 𝑥= 3 & 𝑔 3 =4, etc.