E.G.M. PetrakisFiltering1 Linear Systems Many image processing (filtering) operations are modeled as a linear system Linear System δ(x,y) h(x,y)

Slides:



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

Spatial Filtering (Chapter 3)
Image Processing Lecture 4
Chapter 3 Image Enhancement in the Spatial Domain.
CS 4487/9587 Algorithms for Image Analysis
EE4H, M.Sc Computer Vision Dr. Mike Spann
Digital Image Processing
Digital Image Processing In The Name Of God Digital Image Processing Lecture3: Image enhancement M. Ghelich Oghli By: M. Ghelich Oghli
5. 1 Model of Image degradation and restoration
Lecture 4 Linear Filters and Convolution
6/9/2015Digital Image Processing1. 2 Example Histogram.
Image Filtering CS485/685 Computer Vision Prof. George Bebis.
2007Theo Schouten1 Enhancements Techniques for editing an image such that it is more suitable for a specific application than the original image. Spatial.
Digital Image Processing
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 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.
CS443: Digital Imaging and Multimedia Filters Spring 2008 Ahmed Elgammal Dept. of Computer Science Rutgers University Spring 2008 Ahmed Elgammal Dept.
1 Image filtering Images by Pawan SinhaPawan Sinha.
1 Images and Transformations Images by Pawan SinhaPawan Sinha.
Linear filtering.
1 Image filtering Hybrid Images, Oliva et al.,
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.
Linear Filtering About modifying pixels based on neighborhood. Local methods simplest. Linear means linear combination of neighbors. Linear methods simplest.
Most slides from Steve Seitz
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.
Machine Vision ENT 273 Image Filters Hema C.R. Lecture 5.
Spatial Filtering: Basics
Digital Image Processing
HCI/ComS 575X: Computational Perception Instructor: Alexander Stoytchev
Multimedia Data Introduction to Image Processing Dr Sandra I. Woolley Electronic, Electrical.
EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.
Lecture 03 Area Based Image Processing Lecture 03 Area Based Image Processing Mata kuliah: T Computer Vision Tahun: 2010.
Digital Image Processing Lecture 10: Image Restoration March 28, 2005 Prof. Charlene Tsai.
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.
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.
Digital Image Processing Lecture 10: Image Restoration
Image Subtraction Mask mode radiography h(x,y) is the mask.
Course 2 Image Filtering. Image filtering is often required prior any other vision processes to remove image noise, overcome image corruption and change.
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities Prof. Charlene Tsai.
Intelligent Vision Systems ENT 496 Image Filtering and Enhancement Hema C.R. Lecture 4.
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities May 2, 2005 Prof. Charlene Tsai.
Linear filtering. Motivation: Image denoising How can we reduce noise in a photograph?
Instructor: Mircea Nicolescu Lecture 5 CS 485 / 685 Computer Vision.
Grauman Today: Image Filters Smooth/Sharpen Images... Find edges... Find waldo…
Sliding Window Filters Longin Jan Latecki October 9, 2002.
Spatial Filtering (Chapter 3) CS474/674 - Prof. Bebis.
HCI/ComS 575X: Computational Perception Instructor: Alexander Stoytchev
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities Prof. Charlene Tsai.
Digital Image Processing Lecture 10: Image Restoration
Filtering – Part I Gokberk Cinbis Department of Computer Engineering
- photometric aspects of image formation gray level images
Image Enhancement in the Spatial Domain
Image filtering Images by Pawan Sinha.
HCI / CprE / ComS 575: Computational Perception
Image filtering Images by Pawan Sinha.
Image filtering Images by Pawan Sinha.
Basic Image Processing
Digital Image Processing Week IV
Most slides from Steve Seitz
Image filtering Images by Pawan Sinha.
Department of Computer Engineering
Intensity Transformation
Image Filtering Readings: Ch 5: 5. 4, 5. 5, 5. 6, , 5
Most slides from Steve Seitz
Lecture 7 Spatial filtering.
DIGITAL IMAGE PROCESSING Elective 3 (5th Sem.)
Presentation transcript:

E.G.M. PetrakisFiltering1 Linear Systems Many image processing (filtering) operations are modeled as a linear system Linear System δ(x,y) h(x,y)

E.G.M. PetrakisFiltering2 Impulse Response System’s output to an impulse δ(x,y) δ(x,y) t I 0

E.G.M. PetrakisFiltering3 Space Invariance g(x,y) remains the same irrespective of the position of the input pulse Linear Space Invariance (LSI) Space Inv. Syst. δ(x-x 0,y-y 0 )h(x-x 0,y-y 0 ) LSI System af 1 (x,y)+bf 2 (x,y)ah 1 (x,y)+bh 2 (x,y)

E.G.M. PetrakisFiltering4 Discrete Convolution The filtered image is described by a discrete convolution The filter is described by a n x m discrete convolution mask

E.G.M. PetrakisFiltering5 Computing Convolution Invert the mask g(i,j) by 180 o –not necessary for symmetric masks Put the mask over each pixel of f(i,j) For each (i,j) on image h(i,j)=Ap 1 +Bp 2 +Cp 3 +Dp 4 +Ep 5 +Fp 6 +Gp 7 +Hp 8 +Ip 9

E.G.M. PetrakisFiltering6 Image Filtering Images are often corrupted by random variations in intensity, illumination, or have poor contrast and can’t be used directly Filtering: transform pixel intensity values to reveal certain image characteristics –Enhancement: improves contrast –Smoothing: remove noises –Template matching: detects known patterns

E.G.M. PetrakisFiltering7 Template Matching Locate the template in the image

E.G.M. PetrakisFiltering8 Computing Template Matching Match template with image at every pixel –distance  0 : the template matches the image at the current location –t(x,y): template –M,N size of the template

E.G.M. PetrakisFiltering9 background constant correlation: convolution of f(x,y) with t(-x,-y)

E.G.M. PetrakisFiltering10 true best match template imagecorrelation false matchnoise

E.G.M. PetrakisFiltering11 Observations If the size of f(x,y) is n x n and the size of the template is m x m the result is accumulated in a (n-m-1) x (n+m-1) matrix Best match: maximum value in the correlation matrix but, –false matches due to noise

E.G.M. PetrakisFiltering12 Disadvantages of Correlation Sensitive to noise Sensitive to variations in orientation and scale Sensitive to non-uniform illumination Normalized Correlation (1:image, 2:template): –E : expected value

E.G.M. PetrakisFiltering13 Histogram Modification Images with poor contrast usually contain unevenly distributed gray values Histogram Equalization is a method for stretching the contrast by uniformly distributing the gray values –enhances the quality of an image –useful when the image is intended for viewing –not always useful for image processing

E.G.M. PetrakisFiltering14 Example The original image has very poor contrast –the gray values are in a very small range The histogram equalized image has better contrast

E.G.M. PetrakisFiltering15 Histogram Equalization Methods Background Subtraction: subtract the “background” if it hides useful information –f’(x,y) = f(x,y) – f b (x,y) Static & Dynamic histogram equalization methods –Histogram scaling (static) –Statistical scaling (dynamic)

E.G.M. PetrakisFiltering16 Static Histogram Scaling Scale uniformly entire histogram range: –[z 1,z k ]: available range of gray values: –[a,b]: range of intensity values in image: –scale [a,b] to cover the entire range [z 1,z k ] –for each z in [a,b] compute –the resulting histogram may have gaps

E.G.M. PetrakisFiltering17 Statistical Histogram Scaling Fills all histogram bins continuously –p i : number of pixels at level z i input histogram –q i : number of pixels at level z i output histogram –k 1 = k 2 =… : desired number of pixels in histogram bin Algorithm: 1.Scan the input histogram from left to right to find k 1 : –all pixels with values z 1,z 2,…,z k-1 become z 1

E.G.M. PetrakisFiltering18 Algorithm (conted) 2.Scan the input histogram from k 1 and to the right to find k 2 : –all pixels z k1, z k1+1,…,z k2 become z 2 Continue until the input histogram is exhausted –might also leave gaps in the histogram

E.G.M. PetrakisFiltering19 Noise Images are corrupted by random variations in intensity values called noise due to non- perfect camera acquisition or environmental conditions. Assumptions: –Additive noise: a random value is added at each pixel –White noise: The value at a point is independent on the value at any other point.

E.G.M. PetrakisFiltering20 Common Types of Noise  Salt and pepper noise: random occurrences of both black and white intensity values  Impulse noise: random occurrences of white intensity values  Gaussian noise: impulse noise but its intensity values are drawn from a Gaussian distribution  noise intensity value:  k: random value in [a,b]  σ : width of Gaussian  models sensor noise (due to camera electronics)

E.G.M. PetrakisFiltering21 Examples of Noisy Images a.Original image b.Original image c.Salt and pepper noise d.Impulse noise e.Gaussian noise

E.G.M. PetrakisFiltering22 Noise Filtering Basic Idea: replace each pixel intensity value with an new value taken over a neighborhood of fixed size –Mean filter –Median filter The size of the filter controls degree of smoothing –large filter  large neighborhood  intensive smoothing

E.G.M. PetrakisFiltering23 Mean Filter Take the average of intensity values in a m x n region of each pixel (usually m = n) –take the average as the new pixel value –the normalization factor mn preserves the range of values of the original image

E.G.M. PetrakisFiltering24 Mean Filtering as Convolution Compute the convolution of the original image with –simple filter, the same for all types of noise –disadvantage: blurs image, detail is lost

E.G.M. PetrakisFiltering25 Size of Filter The size of the filter controls the amount of filtering (and blurring). –5 x 5, 7 x 7 etc. –different weights might also be used –normalize by sum of weights in filter

E.G.M. PetrakisFiltering26 Examples of Smoothing From left to right: results of 3 x 3, 5 x 5 and 7 x 7 mean filters

E.G.M. PetrakisFiltering27 Median Filter Replace each pixel value with the median of the gray values in the region of the pixel: 1. take a 3 x 3 (or 5 x 5 etc.) region centered around pixel (i,j) 2. sort the intensity values of the pixels in the region into ascending order 3. select the middle value as the new value of pixel (i,j)

E.G.M. PetrakisFiltering28 Computation of Median Values Very effective in removing salt and pepper or impulsive noise while preserving image detail Disadvantages: computational complexity, non linear filter

E.G.M. PetrakisFiltering29 Examples of Median Filtering From left to right: the results of a 3 x 3, 5 x 5 and 7 x 7 median filter

E.G.M. PetrakisFiltering30 Gaussian Filter Filtering with a m x m mask –the weights are computed according to a Gaussian function: – σ is user defined Example: m = n = 7 σ 2 = 2

E.G.M. PetrakisFiltering31 Properties of Gaussian Filtering Gaussian smoothing is very effective for removing Gaussian noise The weights give higher significance to pixels near the edge (reduces edge blurring) They are linear low pass filters Computationally efficient (large filters are implemented using small 1D filters) Rotationally symmetric (perform the same in all directions) The degree of smoothing is controlled by σ (larger σ for more intensive smoothing)

E.G.M. PetrakisFiltering32 Gaussian Mask A 3-D plot of a 7 x & Gaussian mask: filter symmetric and isotropic

E.G.M. PetrakisFiltering33 Gaussian Smoothing The results of smoothing an image corrupted with Gaussian noise with a 7 x 7 Gaussian mask

E.G.M. PetrakisFiltering34 Computational Efficiency Filtering twice with g(x) is equivalent to filtering with a larger filter with Assumptions

E.G.M. PetrakisFiltering35

E.G.M. PetrakisFiltering36 Observations Filter an image with a large Gaussian –equivalently, filter the image twice with a Gaussian with small σ –filtering twice with a m x n Gaussian is equivalent to filtering with a (n + m - 1) x (n + m - 1) filter –this implies a significant reduction in computations

E.G.M. PetrakisFiltering37 Gaussian Separability

E.G.M. PetrakisFiltering38 1-D Gaussian horizontally 1-D Gaussian vertically The order of convolutions can be reversed

E.G.M. PetrakisFiltering39 An example of the separability of Gaussian convolution –left: convolution with vertical mask –right: convolution with horizontal mask

E.G.M. PetrakisFiltering40 Gaussian Separability Filtering with a 2D Gaussian can be implemented using two 1D Gaussian horizontal filters as follows: –first filter with an 1D Gaussian –take the transpose of the result –convolve again with the same filter –transpose the result Filtering with two 1D Gausians is faster !!

E.G.M. PetrakisFiltering41 a.Noisy image b.Convolution with 1D horizontal mask c.Transposition d.Convolution with same 1D mask e.Transposition  smoothed image