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

Slides:



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

Content-Based Image Retrieval Selim Aksoy Department of Computer Engineering Bilkent University
Binary Image Analysis Selim Aksoy Department of Computer Engineering Bilkent University
Department of Computer Engineering
Linear Filtering – Part II Selim Aksoy Department of Computer Engineering Bilkent University
Binary Image Analysis Selim Aksoy Department of Computer Engineering Bilkent University
Content-Based Image Retrieval Selim Aksoy Department of Computer Engineering Bilkent University
Linear Filtering – Part II Selim Aksoy Department of Computer Engineering Bilkent University
Edge Detection Selim Aksoy Department of Computer Engineering Bilkent University
Linear Filtering – Part II Selim Aksoy Department of Computer Engineering Bilkent University
Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University
Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University
Linear Filtering – Part II Selim Aksoy Department of Computer Engineering Bilkent University
Edge Detection Selim Aksoy Department of Computer Engineering Bilkent University
Edge Detection Selim Aksoy Department of Computer Engineering Bilkent University
Binary Image Analysis 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.
Image Processing Lecture 4
Spatial Filtering.
CS 4487/9587 Algorithms for Image Analysis
Linear Filtering – Part II Selim Aksoy Department of Computer Engineering Bilkent University
Digital Image Processing
E.G.M. PetrakisFiltering1 Linear Systems Many image processing (filtering) operations are modeled as a linear system Linear System δ(x,y) h(x,y)
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.
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.
1 Image filtering Images by Pawan SinhaPawan Sinha.
Image Analysis Preprocessing Arithmetic and Logic Operations Spatial Filters Image Quantization.
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.
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 Fourth lecture Image Restoration Image Restoration: Image restoration methods are used to improve the appearance of an image.
Lecture 5 Mask/Filter Transformation 1.The concept of mask/filters 2.Mathematical model of filtering Correlation, convolution 3.Smoother filters 4.Filter.
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.
Image Subtraction Mask mode radiography h(x,y) is the mask.
Sharpening Filters To highlight fine detail or to enhance blurred detail. –smoothing ~ integration –sharpening ~ differentiation Categories of sharpening.
Intelligent Vision Systems ENT 496 Image Filtering and Enhancement Hema C.R. Lecture 4.
Digital Filters. What are they?  Local operation (neighborhood operation in GIS terminology) by mask, window, or kernel (different words for the same.
Sharpening Spatial Filters ( high pass)  Previously we have looked at smoothing filters which remove fine detail  Sharpening spatial filters seek to.
Grauman Today: Image Filters Smooth/Sharpen Images... Find edges... Find waldo…
Spatial Filtering (Chapter 3) CS474/674 - Prof. Bebis.
Miguel Tavares Coimbra
Fundamentals of Spatial Filtering:
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
Spatial Filtering - Enhancement
Digital Image Processing
Image Enhancement in the Spatial Domain
Image filtering Images by Pawan Sinha.
Image filtering Images by Pawan Sinha.
Digital Image Processing Week IV
Department of Computer Engineering
Image Filtering Readings: Ch 5: 5. 4, 5. 5, 5. 6, , 5
Lecture 7 Spatial filtering.
Digital Filters.
Image Enhancement in the Spatial Domain
Presentation transcript:

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

CS 484, Spring 2007©2007, Selim Aksoy2 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 2007©2007, Selim Aksoy3 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 2007©2007, Selim Aksoy4 Spatial domain filtering What is the value of the center pixel? What assumptions are you making to infer the center value? 333 3? ?

CS 484, Spring 2007©2007, Selim Aksoy5 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 2007©2007, Selim Aksoy6 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 a mask with an image”. Filter masks are sometimes called convolution masks (or convolution kernels).

CS 484, Spring 2007©2007, Selim Aksoy7 Spatial domain filtering Filtering process: Masks operate on a neighborhood of pixels. The filter mask is centered on a pixel. The mask coefficients are multiplied by the pixel values in its neighborhood and the products are summed. The result goes into the corresponding pixel position in the output image. This process is repeated by moving the filter mask from pixel to pixel in the image.

CS 484, Spring 2007©2007, Selim Aksoy8 Spatial domain filtering This is called the cross-correlation operation and is denoted by Be careful about indices, image borders and padding during implementation. Input image F[r,c] Mask overlaid with image at [r,c] Output image G[r,c] H[-1,-1]H[-1,0]H[-1,1] H[0,-1]H[0,0]H[0,1] H[1,-1]H[1,0]H[1,1] Filter

CS 484, Spring 2007©2007, Selim Aksoy9 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 2007©2007, Selim Aksoy10 Smoothing spatial filters Averaging (mean) filterWeighted average

CS 484, Spring 2007©2007, Selim Aksoy11 Smoothing spatial filters 1/9.(10x1 + 11x1 + 10x1 + 9x1 + 10x1 + 11x1 + 10x1 + 9x1 + 10x1) = 1/9.( 90) = 10 1/9.( 90) = I F X XX X 10 X X X X X X X X X X X X X X XX 1/9 O Adapted from Octavia Camps, Penn State

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

CS 484, Spring 2007©2007, Selim Aksoy13 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 2007©2007, Selim Aksoy14 Adapted from Linda Shapiro, U of Washington

CS 484, Spring 2007©2007, Selim Aksoy15 Smoothing spatial filters Adapted from Gonzales and Woods

CS 484, Spring 2007©2007, Selim Aksoy16 Smoothing spatial filters Adapted from Gonzales and Woods

CS 484, Spring 2007©2007, Selim Aksoy17 Smoothing spatial filters Adapted from Shapiro and Stockman

CS 484, Spring 2007©2007, Selim Aksoy18 Smoothing spatial filters Adapted from Darrell and Freeman, MIT

CS 484, Spring 2007©2007, Selim Aksoy19 Smoothing spatial filters Adapted from Darrell and Freeman, MIT

CS 484, Spring 2007©2007, Selim Aksoy20 Smoothing spatial filters Adapted from Darrell and Freeman, MIT

CS 484, Spring 2007©2007, Selim Aksoy21 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 2007©2007, Selim Aksoy22 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 2007©2007, Selim Aksoy23 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 2007©2007, Selim Aksoy24 Smoothing spatial filters Adapted from Martial Hebert, CMU

CS 484, Spring 2007©2007, Selim Aksoy25 Smoothing spatial filters Adapted from Martial Hebert, CMU

CS 484, Spring 2007©2007, Selim Aksoy26 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 2007©2007, Selim Aksoy27 Order-statistic filters I X XX X 10 X X X X X X X X X X X X X X XX O 10,11,10,9,10,11,10,9,109,9,10,10,10,10,10,11,11 sort median Adapted from Octavia Camps, Penn State

CS 484, Spring 2007©2007, Selim Aksoy28 Order-statistic filters I X XX X 10 X X X X X X X X X X X X X X XX O 10,9,11,9,99,11,11,10,109,9,10,10,10,11,11,11,99 sort median Adapted from Octavia Camps, Penn State

CS 484, Spring 2007©2007, Selim Aksoy29 Salt-and-pepper noise Adapted from Linda Shapiro, U of Washington

CS 484, Spring 2007©2007, Selim Aksoy30 Gaussian noise Adapted from Linda Shapiro, U of Washington

CS 484, Spring 2007©2007, Selim Aksoy31 Order-statistic filters Adapted from Gonzales and Woods

CS 484, Spring 2007©2007, Selim Aksoy32 Order-statistic filters Adapted from Shapiro and Stockman

CS 484, Spring 2007©2007, Selim Aksoy33 Order-statistic filters Adapted from Martial Hebert, CMU

CS 484, Spring 2007©2007, Selim Aksoy34 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 2007©2007, Selim Aksoy35 Sharpening spatial filters Adapted from Gonzales and Woods

CS 484, Spring 2007©2007, Selim Aksoy36 Sharpening spatial filters Observations: First-order derivatives generally produce thicker edges in an image. Second-order derivatives have a stronger response to fine detail (such as thin lines or isolated points). First-order derivatives generally have a stronger response to a gray level step. Second-order derivatives produce a double response at step changes in gray level.

CS 484, Spring 2007©2007, Selim Aksoy37 Sharpening spatial filters

CS 484, Spring 2007©2007, Selim Aksoy38 Sharpening spatial filters Adapted from Gonzales and Woods

CS 484, Spring 2007©2007, Selim Aksoy39 Sharpening spatial filters Robert’s cross-gradient operators Sobel gradient operators

CS 484, Spring 2007©2007, Selim Aksoy40 Sharpening spatial filters High-boost filtering Adapted from Darrell and Freeman, MIT

CS 484, Spring 2007©2007, Selim Aksoy41 Sharpening spatial filters Adapted from Darrell and Freeman, MIT

CS 484, Spring 2007©2007, Selim Aksoy42 Sharpening spatial filters Adapted from Darrell and Freeman, MIT

CS 484, Spring 2007©2007, Selim Aksoy43 Combining spatial enhancement methods