Filtering – Part I Gokberk Cinbis Department of Computer Engineering

Slides:



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

Linear Filtering – Part I Selim Aksoy Department of Computer Engineering Bilkent University
Linear Filtering – Part I Selim Aksoy Department of Computer Engineering Bilkent University
Spatial Filtering (Chapter 3)
Topic 6 - Image Filtering - I DIGITAL IMAGE PROCESSING Course 3624 Department of Physics and Astronomy Professor Bob Warwick.
CS & CS Multimedia Processing Lecture 2. Intensity Transformation and Spatial Filtering Spring 2009.
Spatial Filtering.
Chapter 3 Image Enhancement in the Spatial Domain.
Lecture 6 Sharpening Filters
CS 4487/9587 Algorithms for Image Analysis
Linear Filtering – Part II Selim Aksoy Department of Computer Engineering Bilkent University
Digital Image Processing
Digital Image Processing In The Name Of God Digital Image Processing Lecture3: Image enhancement M. Ghelich Oghli By: M. Ghelich Oghli
Lecture 4 Linear Filters and Convolution
6/9/2015Digital Image Processing1. 2 Example Histogram.
Image Filtering CS485/685 Computer Vision Prof. George Bebis.
Computer Vision Introduction to Image formats, reading and writing images, and image environments Image filtering.
Lecture 1: Images and image filtering
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.
1 Linear image transforms Let’s start with a 1-D image (a “signal”): A very general and useful class of transforms are the linear transforms of f, defined.
1 Image filtering Images by Pawan SinhaPawan Sinha.
1 Images and Transformations Images by Pawan SinhaPawan Sinha.
1 Image filtering Hybrid Images, Oliva et al.,
Chapter 3 (cont).  In this section several basic concepts are introduced underlying the use of spatial filters for image processing.  Mainly spatial.
CS 376b Introduction to Computer Vision 02 / 26 / 2008 Instructor: Michael Eckmann.
Presentation Image Filters
Machine Vision ENT 273 Image Filters Hema C.R. Lecture 5.
Spatial Filtering: Basics
Digital Image Processing Image Enhancement Part IV.
University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell Image processing.
Linear Filtering – Part I Selim Aksoy Department of Computer Engineering Bilkent University
Lecture 03 Area Based Image Processing Lecture 03 Area Based Image Processing Mata kuliah: T Computer Vision Tahun: 2010.
Image Processing Edge detection Filtering: Noise suppresion.
Image processing Fourth lecture Image Restoration Image Restoration: Image restoration methods are used to improve the appearance of an image.
Linear filtering. Motivation: Noise reduction Given a camera and a still scene, how can you reduce noise? Take lots of images and average them! What’s.
Machine Vision ENT 273 Image Filters Hema C.R. Lecture 5.
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.
Intelligent Vision Systems ENT 496 Image Filtering and Enhancement Hema C.R. Lecture 4.
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.
Image Enhancement by Spatial Domain Filtering
CSE 185 Introduction to Computer Vision Image Filtering: Spatial Domain.
Grauman Today: Image Filters Smooth/Sharpen Images... Find edges... Find waldo…
Images and Filters CSEP 576 Ali Farhadi Many slides from Steve Seitz and Larry Zitnick.
Lecture 1: Images and image filtering CS4670/5670: Intro to Computer Vision Noah Snavely Hybrid Images, Oliva et al.,
Spatial Filtering (Chapter 3) CS474/674 - Prof. Bebis.
Miguel Tavares Coimbra
Linear Filtering – Part II
Fundamentals of Spatial Filtering:
Linear Filters T-11 Computer Vision University of Houston
Image Pre-Processing in the Spatial and Frequent Domain
ECE 692 – Advanced Topics in Computer Vision
Department of Computer Engineering
Spatial Filtering - Enhancement
Digital Image Processing
Image filtering Hybrid Images, Oliva et al.,
Image filtering Images by Pawan Sinha.
Image filtering Images by Pawan Sinha.
Image filtering Images by Pawan Sinha.
Digital Image Processing Week IV
Image filtering Images by Pawan Sinha.
Image filtering
Image filtering
Department of Computer Engineering
Lecture 1: Images and image filtering
Image Filtering Readings: Ch 5: 5. 4, 5. 5, 5. 6, , 5
Lecture 7 Spatial filtering.
Image Enhancement in the Spatial Domain
Presentation transcript:

Filtering – Part I Gokberk Cinbis Department of Computer Engineering Bilkent University gcinbis@cs.bilkent.edu.tr Slides courtesy of Selim Aksoy

Importance of neighborhood Both zebras and dalmatians have black and white pixels in similar numbers. The difference between the two is the characteristic appearance of small group of pixels rather than individual pixel values. Adapted from Pinar Duygulu, Bilkent University CS 484, Spring 2017 ©2017, Bilkent University

Outline We will discuss neighborhood operations that work with the values of the image pixels in the neighborhood. Spatial domain filtering Frequency domain filtering Image enhancement Finding patterns CS 484, Spring 2017 ©2017, Bilkent University

Spatial domain filtering What is the value of the center pixel? What assumptions are you making to infer the center value? 3 ? 3 3 4 2 ? 3 CS 484, Spring 2017 ©2017, Bilkent University

Spatial domain filtering Some neighborhood operations work with the values of the image pixels in the neighborhood, and the corresponding values of a subimage that has the same dimensions as the neighborhood. The subimage is called a filter (or mask, kernel, template, window). The values in a filter subimage are referred to as coefficients, rather than pixels. CS 484, Spring 2017 ©2017, Bilkent University

Spatial domain filtering Operation: modify the pixels in an image based on some function of the pixels in their neighborhood. Simplest: linear filtering (replace each pixel by a linear combination of its neighbors). Linear spatial filtering is often referred to as “convolving an image with a filter”. CS 484, Spring 2017 ©2017, Bilkent University

Linear filtering g [m,n] f [m,n] For a linear spatially invariant system m=0 1 2 … 111 115 113 112 135 138 137 139 145 146 149 147 163 168 188 196 206 202 207 180 184 219 200 195 193 189 214 216 104 79 83 77 191 201 217 220 103 59 60 68 205 222 69 199 203 223 228 108 71 ? -5 9 -9 21 -12 10 -29 18 24 4 -7 5 -50 40 142 -88 -34 -41 41 264 -175 -71 -24 37 349 -224 -120 -10 -23 33 360 -217 -134 -1 2 = h[m,n] g[m,n] f[m,n] CS 484, Spring 2017 ©2017, Bilkent University

Convolution vs correlation Reference: http://www.cs.umd.edu/~djacobs/CMSC426/Convolution.pdf CS 484, Spring 2017 ©2017, Bilkent University

Spatial domain filtering Be careful about indices, image borders and padding during implementation. zero fixed/clamp periodic/wrap reflected/mirror Border padding examples. Adapted from CSE 455, U of Washington CS 484, Spring 2017 ©2017, Bilkent University

Smoothing spatial filters Often, an image is composed of some underlying ideal structure, which we want to detect and describe, together with some random noise or artifact, which we would like to remove. Smoothing filters are used for blurring and for noise reduction. Linear smoothing filters are also called averaging filters. CS 484, Spring 2017 ©2017, Bilkent University

Smoothing spatial filters 10 11 9 1 2 99 X 10 I O F 1 1/9 1/9.(10x1 + 11x1 + 10x1 + 9x1 + 10x1 + 11x1 + 10x1 + 9x1 + 10x1) = 1/9.( 90) = 10 Adapted from Octavia Camps, Penn State CS 484, Spring 2017 ©2017, Bilkent University

Smoothing spatial filters 10 11 9 1 2 99 X 20 I O F 1 1/9 1/9.(10x1 + 9x1 + 11x1 + 9x1 + 99x1 + 11x1 + 11x1 + 10x1 + 10x1) = 1/9.( 180) = 20 Adapted from Octavia Camps, Penn State CS 484, Spring 2017 ©2017, Bilkent University

Smoothing spatial filters Common types of noise: Salt-and-pepper noise: contains random occurrences of black and white pixels. Impulse noise: contains random occurrences of white pixels. Gaussian noise: variations in intensity drawn from a Gaussian normal distribution. Adapted from Linda Shapiro, U of Washington CS 484, Spring 2017 ©2017, Bilkent University

Adapted from Linda Shapiro, U of Washington CS 484, Spring 2017 ©2017, Bilkent University

Smoothing spatial filters Adapted from Gonzales and Woods CS 484, Spring 2017 ©2017, Bilkent University

Smoothing spatial filters A weighted average that weighs pixels at its center much more strongly than its boundaries. 2D Gaussian filter Adapted from Martial Hebert, CMU CS 484, Spring 2017 ©2017, Bilkent University

Smoothing spatial filters If σ is small: smoothing will have little effect. If σ is larger: neighboring pixels will have larger weights resulting in consensus of the neighbors. If σ is very large: details will disappear along with the noise. Adapted from Martial Hebert, CMU CS 484, Spring 2017 ©2017, Bilkent University

Smoothing spatial filters Adapted from Martial Hebert, CMU CS 484, Spring 2017 ©2017, Bilkent University

Smoothing spatial filters … Width of the Gaussian kernel controls the amount of smoothing. Adapted from K. Grauman CS 484, Spring 2017 ©2017, Bilkent University

Smoothing spatial filters Result of blurring using a uniform local model. Produces a set of narrow horizontal and vertical bars – ringing effect. Result of blurring using a Gaussian filter. Adapted from David Forsyth, UC Berkeley CS 484, Spring 2017 ©2017, Bilkent University

Ringing artifact We will revisit this discussion later in the Fourier transform topic Result of blurring using a uniform local model. Produces a set of narrow horizontal and vertical bars – ringing effect. Result of blurring using a Gaussian filter. Adapted from David Forsyth, UC Berkeley CS 484, Spring 2017 ©2017, Bilkent University

Smoothing spatial filters Gaussian versus mean filters Adapted from CSE 455, U of Washington CS 484, Spring 2017 ©2017, Bilkent University

Order-statistic filters Order-statistic filters are nonlinear spatial filters whose response is based on ordering (ranking) the pixels contained in the image area encompassed by the filter, and then replacing the value of the center pixel with the value determined by the ranking result. The best-known example is the median filter. It is particularly effective in the presence of impulse or salt-and-pepper noise, with considerably less blurring than linear smoothing filters. CS 484, Spring 2017 ©2017, Bilkent University

Order-statistic filters 10 11 9 1 2 99 X 10 I O median sort 10,11,10,9,10,11,10,9,10 9,9,10,10,10,10,10,11,11 Adapted from Octavia Camps, Penn State CS 484, Spring 2017 ©2017, Bilkent University

Order-statistic filters 10 11 9 1 2 99 X 10 I O median sort 10,9,11,9,99,11,11,10,10 9,9,10,10,10,11,11,11,99 Adapted from Octavia Camps, Penn State CS 484, Spring 2017 ©2017, Bilkent University

Salt-and-pepper noise Adapted from Linda Shapiro, U of Washington CS 484, Spring 2017 ©2017, Bilkent University

Gaussian noise Adapted from Linda Shapiro, U of Washington CS 484, Spring 2017 ©2017, Bilkent University

Order-statistic filters Adapted from Martial Hebert, CMU CS 484, Spring 2017 ©2017, Bilkent University

Spatially varying filters * input output Bilateral filter: kernel depends on the local image content. See the Szeliski book for the math. Adapted from Sylvian Paris CS 484, Spring 2017 ©2017, Bilkent University

Spatially varying filters * input output Compare to the result of using the same Gaussian kernel everywhere Adapted from Sylvian Paris CS 484, Spring 2017 ©2017, Bilkent University

Sharpening spatial filters Objective of sharpening is to highlight or enhance fine detail in an image. Since smoothing (averaging) is analogous to integration, sharpening can be accomplished by spatial differentiation. First-order derivative of 1D function f(x) f(x+1) – f(x). Second-order derivative of 1D function f(x) f(x+1) – 2f(x) + f(x-1). CS 484, Spring 2017 ©2017, Bilkent University

Sharpening spatial filters Robert’s cross-gradient operators Sobel gradient operators CS 484, Spring 2017 ©2017, Bilkent University

Sharpening spatial filters CS 484, Spring 2017 ©2017, Bilkent University

Sharpening spatial filters Adapted from Gonzales and Woods CS 484, Spring 2017 ©2017, Bilkent University

Sharpening spatial filters Image Filter High-boost filtering Adapted from Darrell and Freeman, MIT CS 484, Spring 2017 ©2017, Bilkent University

Sharpening spatial filters Adapted from Darrell and Freeman, MIT CS 484, Spring 2017 ©2017, Bilkent University

Combining spatial enhancement methods CS 484, Spring 2017 ©2017, Bilkent University