Lecture 5 Mask/Filter Transformation 1.The concept of mask/filters 2.Mathematical model of filtering Correlation, convolution 3.Smoother filters 4.Filter.

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
CS & CS Multimedia Processing Lecture 2. Intensity Transformation and Spatial Filtering Spring 2009.
Spatial Filtering.
Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level.
Digital Image Processing
Image Enhancement in the Spatial Domain II Jen-Chang Liu, 2006.
1Ellen L. Walker ImageJ Java image processing tool from NIH Reads / writes a large variety of images Many image processing operations.
Image Enhancement Digital Image Processing Instructor: Dr. Cheng-Chien LiuCheng-Chien Liu Department of Earth Sciences National Cheng Kung University Last.
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
Chapter 3: Image Enhancement in the Spatial Domain
5. 1 Model of Image degradation and restoration
Lecture 4 Linear Filters and Convolution
6/9/2015Digital Image Processing1. 2 Example Histogram.
Image processing. Image operations Operations on an image –Linear filtering –Non-linear filtering –Transformations –Noise removal –Segmentation.
Median Filter If the objective is to achieve noise reduction rather than blurring, an alternative approach is to use median filters. That is, the gray.
Digital Image Processing Chapter 5: Image Restoration.
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 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB.
CS443: Digital Imaging and Multimedia Filters Spring 2008 Ahmed Elgammal Dept. of Computer Science Rutgers University Spring 2008 Ahmed Elgammal Dept.
Image Enhancement.
Lecture 2. Intensity Transformation and Spatial Filtering
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.
Chap2 Image enhancement (Spatial domain)
Presentation Image Filters
Machine Vision ENT 273 Image Filters Hema C.R. Lecture 5.
Spatial Filtering: Basics
Chapter 5 Image Restoration.
Digital Image Processing Image Enhancement Part IV.
Digital Image Processing
Linear Filtering – Part I Selim Aksoy Department of Computer Engineering Bilkent University
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.
Image processing Fourth lecture Image Restoration Image Restoration: Image restoration methods are used to improve the appearance of an image.
Image Restoration Chapter 5.
Digital Image Processing Lecture 10: Image Restoration March 28, 2005 Prof. Charlene Tsai.
Chapter 5: Neighborhood Processing
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.
Digital Image Processing Lecture 10: Image Restoration
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.
Course 2 Image Filtering. Image filtering is often required prior any other vision processes to remove image noise, overcome image corruption and change.
Intelligent Vision Systems ENT 496 Image Filtering and Enhancement Hema C.R. Lecture 4.
Digital Image Processing Lecture 5: Neighborhood Processing: Spatial Filtering March 9, 2004 Prof. Charlene Tsai.
Image enhancement Last update Heejune Ahn, SeoulTech.
Instructor: Mircea Nicolescu Lecture 5 CS 485 / 685 Computer Vision.
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 Subtraction Mask mode radiography h(x,y) is the mask.
Fundamentals of Spatial Filtering:
Digital Image Processing Lecture 10: Image Restoration
Linear Filters and Edges Chapters 7 and 8
ECE 692 – Advanced Topics in Computer Vision
Filtering – Part I Gokberk Cinbis Department of Computer Engineering
IMAGE PROCESSING INTENSITY TRANSFORMATION AND SPATIAL FILTERING
Spatial Filtering - Enhancement
Digital Image Processing
- photometric aspects of image formation gray level images
Digital Image Processing Week IV
Spatial filtering 3x3 kernel Definition Transformation or set of
Lecture 2: Image filtering
Image Filtering Readings: Ch 5: 5. 4, 5. 5, 5. 6, , 5
Image Enhancement in the Spatial Domain
Presentation transcript:

Lecture 5 Mask/Filter Transformation 1.The concept of mask/filters 2.Mathematical model of filtering Correlation, convolution 3.Smoother filters 4.Filter transformation with MatLab

Categories of Spatial filters Linear filters –Correlation –Convolution Nonlinear filters Smooth filters Sharpening filters

Mechanics of linear spatial filter Move the mask over the image, calculate the pixel value using correlation or convolution

Correlation of two functions Convolution of two functions (like rotate w for 180 degree) With image of size M and mask size m, a = (m-1)/2 x = 0, …, M-1 1-D Correlation and Convolution

5 Spatial Filtering Spatial filter: also called mask/kernel/template or window) –Consist of a neighbourhood with coefficients on pixels –Example: masks of odd sizes, e.g. 3x3, 5x5, … Apply a filter to an image: simply move the filter mask from point to point in an image. At each point (x, y), the response of the filter at that point is calculated using a predefined relationship. Example Linear filter

Correlation of two functions Convolution of two functions (like rotate w for 180 degree) Linear Filtering of an image f of size MxN filter mask of size mxn is given by the expression, a = (m-1)/2, b = (n-1)/2, x = 0, 1, 2, …, M-1 and y = 0, 1, 2, …, N-1 2-D Correlation and Convolution

Example of 2-D correlation and convolution

8 Smoothing Spatial Filters Used for blurring and for noise reduction Blurring is used in preprocessing steps, such as –removal of small details from an image prior to object extraction –bridging of small gaps in lines or curves Noise reduction can be accomplished by blurring with a linear filter and also by a nonlinear filter General form of smooth filter (size mxn, m and n are odd)

9 Smoothing Linear Filters Output is simply the average of the pixels contained in the neighborhood of the filter mask. Also called averaging filters or low pass filters Replacing the value of every pixel in an image by the average of the gray levels in the neighborhood will reduce the “ sharp ” transitions in gray levels. Sharp transitions –random noise in the image –edges of objects in the image –Smoothing can reduce noises (desirable) and blur edges (undesirable)

10 Example: 3x3 Smoothing Linear Filters box filterweighted average

Gauss function filter Use Gauss function to generate a mask of m x n matrix w E.g. m = 3

12 Example a). original image 500x500 pixel b). - f). results of smoothing with square averaging filter masks of size n = 3, 5, 9, 15 and 35, respectively. Note: –big mask is used to eliminate small objects from an image. –the size of the mask establishes the relative size of the objects that will be blended with the background. ab cd ef

13 Example original image result after smoothing with 15x15 averaging mask result of thresholding we can see that the result after smoothing and thresholding, the remains are the largest and brightest objects in the image.

14 Nonlinear Filters Order-Statistics Filters –The response is based on ordering (ranking) the pixels contained in the image area encompassed by the filter Examples –median filter : R = median{z k |k = 1,2, …,n x n} –max filter : R = max{z k |k = 1,2, …,n x n} –min filter : R = min{z k |k = 1,2, …,n x n} note: n x n is the size of the mask

15 Median Filters Median filters –replaces the value of a pixel by the median of the gray levels in the neighborhood of that pixel (the original value of the pixel is included in the computation of the median) impulse noise  salt and pepper noiseprovide excellent noise-reduction capabilities less blurring than linear smoothing filters of similar size. –quite popular because for certain types of random noise (impulse noise  salt and pepper noise), they provide excellent noise-reduction capabilities, with considering less blurring than linear smoothing filters of similar size. –forces the points with distinct gray levels to be more like their neighbors. –isolated clusters of pixels that are light or dark with respect to their neighbors, and whose area is less than n 2 /2 (one-half the filter area), are eliminated by an n x n median filter. –eliminated = forced to have the value equal the median intensity of the neighbors. larger clusters are affected considerably less

16 Example : Median Filters

The Modeling of intensity transformation Intensity Response to Shift-invariant Linear Superposition Convolution

Foundation of Image Acquisition Point light source => image acquisition (lens) => Point spread (sensor) y x Point light source unit energy y Lens (passive) x Point spread y x x y L Intensity distribution of the unit light energy

Foundation of Image Acquisition y x x y L Ideal unit energy point intensity function

Properties of Lens Transformation Lens transformation system Linear Shift-Invariant System (LSI): If the system L has the properties (a) Homogeneity: (b) Shift-invariant: (c) Superposition: x x y L x x y L

Signals in LSI By homogeneity and shift-invariant: Then by superposition x x y L

Convolution Definition: f(x) convoluted with h(x), or convolution of f(x) with h(x) In a LSI system, signal received g(x) the convolution of input f(x) with impulse response h(x). As long as we know f(x) and h(x), we can compute the output signal by their convolution

Example of Convolution Given Compute f(x)*h(x) Sol: See the next slide for the case analysis Case 1: x < -1/2, Case 2: |x|<1/2, Case 3. x> ½, x

Case analysis for convolution computing f(x) and h(x) s s xx s Case 1: x<-1/2 Case 2: |x|<1/2 Case 3: x>1/2