Digital Image Processing Lecture 5: Neighborhood Processing: Spatial Filtering March 9, 2004 Prof. Charlene Tsai.

Slides:



Advertisements
Similar presentations
Basis beeldverwerking (8D040) dr. Andrea Fuster dr. Anna Vilanova Prof.dr.ir. Marcel Breeuwer Filtering.
Advertisements

Neighborhood Processing
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.
Image Filtering. Outline Outline Concept of image filter  Focus on spatial image filter Various types of image filter  Smoothing, noise reductions 
Chapter 3 Image Enhancement in the Spatial Domain.
Lecture 6 Sharpening Filters
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.
EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more.
Digital Image Processing
Image Enhancement in the Spatial Domain II Jen-Chang Liu, 2006.
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
6/9/2015Digital Image Processing1. 2 Example Histogram.
Digital Image Processing
Digital Image Processing
Image Enhancement.
Image Analysis Preprocessing Arithmetic and Logic Operations Spatial Filters Image Quantization.
Lecture 2. Intensity Transformation and Spatial Filtering
Digital Image Processing, 2nd ed. © 2002 R. C. Gonzalez & R. E. Woods Chapter 4 Image Enhancement in the Frequency Domain Chapter.
Computer Vision Spring ,-685 Instructor: S. Narasimhan Wean Hall 5409 T-R 10:30am – 11:50am.
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.
Presentation Image Filters
Spatial-based Enhancements Lecture 3 prepared by R. Lathrop 10/99 updated 10/03 ERDAS Field Guide 6th Ed. Ch 5: ;
Machine Vision ENT 273 Image Filters Hema C.R. Lecture 5.
Computer Vision – Enhancement(Part II) Hanyang University Jong-Il Park.
Spatial Filtering: Basics
Digital Image Processing
Image Processing © 2002 R. C. Gonzalez & R. E. Woods Lecture 4 Image Enhancement in the Frequency Domain Lecture 4 Image Enhancement.
Chapter 5 Neighborhood Processing
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.
Introduction to Image Processing
Image processing Fourth lecture Image Restoration Image Restoration: Image restoration methods are used to improve the appearance of an image.
Digital Image Processing Lecture 10: Image Restoration March 28, 2005 Prof. Charlene Tsai.
Chapter 5: Neighborhood Processing
Machine Vision ENT 273 Image Filters Hema C.R. Lecture 5.
Digital Image Processing Lecture 10: Image Restoration
Spatial Filtering.
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.
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities Prof. Charlene Tsai.
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.
Chapter 5: Neighborhood Processing 5.1 Introduction
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities May 2, 2005 Prof. Charlene Tsai.
EE 7730 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more.
Digital Filters. What are they?  Local operation (neighborhood operation in GIS terminology) by mask, window, or kernel (different words for the same.
1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng.
Digital Image Processing Lecture 9: Filtering in Frequency Domain Prof. Charlene Tsai.
Non-linear filtering Example: Median filter Replaces pixel value by median value over neighborhood Generates no new gray levels.
Filters– Chapter 6. Filter Difference between a Filter and a Point Operation is that a Filter utilizes a neighborhood of pixels from the input image to.
Lecture 10 Chapter 5: Image Restoration. Image restoration Image restoration is the process of recovering the original scene from the observed scene which.
Spatial Filtering (Chapter 3) CS474/674 - Prof. Bebis.
Miguel Tavares Coimbra
Image Subtraction Mask mode radiography h(x,y) is the mask.
Fundamentals of Spatial Filtering:
Digital Image Processing CSC331
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities Prof. Charlene Tsai.
Digital Image Processing Lecture 10: Image Restoration
ECE 692 – Advanced Topics in Computer Vision
Image Enhancement in the
Digital Image Processing
Digital Image Processing
Digital Filters.
Image Enhancement in the Spatial Domain
Presentation transcript:

Digital Image Processing Lecture 5: Neighborhood Processing: Spatial Filtering March 9, 2004 Prof. Charlene Tsai

Digital Image ProcessingLecture 5 2 Spatial Filtering  Definition: a process that moves a subimage from point to point in an image, with the response at each image point predefined.  The subimage: filter, mask, kernel, template or window.  The values in a filter subimage are called coefficients, not pixels.  The process is also named convolution.  Convolution of 2D function and is denoted or  Definition: a process that moves a subimage from point to point in an image, with the response at each image point predefined.  The subimage: filter, mask, kernel, template or window.  The values in a filter subimage are called coefficients, not pixels.  The process is also named convolution.  Convolution of 2D function and is denoted or

Digital Image ProcessingLecture 5 3 Illustration W(-1,-1) W(-1,0) W(-1,1) W(0,-1) W(0,0) W(0,1) W(1,-1)W(1,0)W(1,1) f(x-1,y-1)f(x-1,y)f(x-1,y+1) f(x,y-1) f(x,y) f(x,y+1) f(x+1,y-1)f(x+1,y)f(x+1,y+1) x y origin mask Mask coefficients Image section under mask

Digital Image ProcessingLecture 5 4 Example1: Averaging  One simple example is smoothing using a 3x3 mask. f(x-1,y-1)f(x-1,y)f(x-1,y+1) f(x,y-1) f(x,y) f(x,y+1) f(x+1,y-1)f(x+1,y)f(x+1,y+1) 1/9

Digital Image ProcessingLecture 5 5 Example2: Delta/Impulse Funciton  An ideal impulse is defined using the Dirac distribution  To visualize in 1D, picture a rectancular pulse from to with a height of. As, the width tends to 0 and the height tends to infinity as the total area remains constant at 1.  An ideal impulse is defined using the Dirac distribution  To visualize in 1D, picture a rectancular pulse from to with a height of. As, the width tends to 0 and the height tends to infinity as the total area remains constant at 1. 1

Digital Image ProcessingLecture 5 6 Example2: Delta/Impulse Function (con’d)  Sifting property: It provides the value of f(x,y) at the point (a,b)  Delta function as the mask.   When moving across an image, it “copies” the value of image intensity.  Sifting property: It provides the value of f(x,y) at the point (a,b)  Delta function as the mask.   When moving across an image, it “copies” the value of image intensity.

Digital Image ProcessingLecture 5 7 General Formulation  2D Continuous space:  2D discrete space:  In digital image processing, we only deal with discrete space with a mask effective locally.  Convolution is commutative, associative and distributive.  2D Continuous space:  2D discrete space:  In digital image processing, we only deal with discrete space with a mask effective locally.  Convolution is commutative, associative and distributive. Convolution kernel/mask

Digital Image ProcessingLecture 5 8 What happens at the borders?  The mask falls outside the edge.  Solutions?  Ignore the edges  The resultant image is smaller than the original  Pad with zeros  Introducing unwanted artifacts  The mask falls outside the edge.  Solutions?  Ignore the edges  The resultant image is smaller than the original  Pad with zeros  Introducing unwanted artifacts

Digital Image ProcessingLecture 5 9 Values Outside the Range  Linear filtering might bring the intensity outside the display range.  Solutions?  Clip values  Scaling transformation Transform values in [g L,g H ] to [0,255]  Linear filtering might bring the intensity outside the display range.  Solutions?  Clip values  Scaling transformation Transform values in [g L,g H ] to [0,255] New min New max

Digital Image ProcessingLecture 5 10 Separable Filters  Some filters can be implemented by successive application of two simpler filters.  Separability results in great time saving.  By how much?  For a mask of size nxn, for each image pixel  Originally, n 2 multiplications and n 2 -1 additions  After separation, 2n multiplications and 2n-2 additions  Some filters can be implemented by successive application of two simpler filters.  Separability results in great time saving.  By how much?  For a mask of size nxn, for each image pixel  Originally, n 2 multiplications and n 2 -1 additions  After separation, 2n multiplications and 2n-2 additions

Digital Image ProcessingLecture 5 11 Some terminology on Frequency…  Frequencies: a measure of the amount by which gray values change with distance.  High/low-frequency components: large/small changes in gray values over small distances.  High/low-pass filter: passing high/low components, and reducing or eliminating low/high-frequency filter.  Frequencies: a measure of the amount by which gray values change with distance.  High/low-frequency components: large/small changes in gray values over small distances.  High/low-pass filter: passing high/low components, and reducing or eliminating low/high-frequency filter.

Digital Image ProcessingLecture 5 12 Low-Pass Filter  Mostly for noise reduction/removal and smoothing  3x3 averaging filter to blur edges  Gaussian filter,  based on Gaussian probability distribution function  a popular filter for smoothing  more later when we discuss image restoration  Mostly for noise reduction/removal and smoothing  3x3 averaging filter to blur edges  Gaussian filter,  based on Gaussian probability distribution function  a popular filter for smoothing  more later when we discuss image restoration In 1D:

Digital Image ProcessingLecture 5 13 High-Pass Filter  The Laplacian,, is a high-pass filter,  Sum of coefficients is zero  Insight: in areas where the gray values are similar (low-frequency), application of the filter makes the gray values close to zero.  The Laplacian,, is a high-pass filter,  Sum of coefficients is zero  Insight: in areas where the gray values are similar (low-frequency), application of the filter makes the gray values close to zero. or

Digital Image ProcessingLecture 5 14 Laplacian Operator  Laplacian is a derivative operator – 2 nd order derivative  Highlighting graylevel discontinuities.  An edge detector  isotropic in x- and y-direction.  Laplacian is a derivative operator – 2 nd order derivative  Highlighting graylevel discontinuities.  An edge detector  isotropic in x- and y-direction.

Digital Image ProcessingLecture 5 15 Laplacian Operator (con’d)  We may add the diagonal terms too => isotropic results for increments of  There are other variations/approximations:  We may add the diagonal terms too => isotropic results for increments of  There are other variations/approximations: or Separable filter

Digital Image ProcessingLecture 5 16 Laplacian Filter: Demo Original Laplacian-filtered

Digital Image ProcessingLecture 5 17 Laplacian: Application  Laplacian highlights discontinuities, and turn featureless regions into dark background.  How can we make good use of the property?  One example is edge enhancement  Laplacian highlights discontinuities, and turn featureless regions into dark background.  How can we make good use of the property?  One example is edge enhancement original Laplacian enhanced

Digital Image ProcessingLecture 5 18 Edge Sharping  To make edges slightly sharper and crisper.  This operation is referred to as edge enhancement, edge crispening or unsharp masking.  A very popular practice in industry.  Subtracting a blurred version of an image from the image itself.  To make edges slightly sharper and crisper.  This operation is referred to as edge enhancement, edge crispening or unsharp masking.  A very popular practice in industry.  Subtracting a blurred version of an image from the image itself. Sharpened image Blurred image Original image

Digital Image ProcessingLecture 5 19 Unsharp Masking: Why it works f(x,y) blurred imageSharpened

Digital Image ProcessingLecture 5 20 Filter for Unsharp Masking  Combining filtering and subtracting in one filter.  Schematically,  Combining filtering and subtracting in one filter.  Schematically, Original Blur with low-pass filter Scale with A<1 Subtract Scale for display

Digital Image ProcessingLecture 5 21 High-Boost Filtering  Generalization of unsharp masking  Here A is called boost coefficient, and  We rewrite the equation as  Applicable to any sharpening operation  can be  The filter for f hb becomes  Generalization of unsharp masking  Here A is called boost coefficient, and  We rewrite the equation as  Applicable to any sharpening operation  can be  The filter for f hb becomes

Digital Image ProcessingLecture 5 22 High-Boost Filtering: Demo  By varying A, better overall brightness can be improved. original A=0 A=1 A=1.7, much brighter

Digital Image ProcessingLecture 5 23 Nonlinear Filters  Will discuss some of them in more detail later for the purpose of image restoration.  Maximum filter: the output the maximum value under the mask  Minimum filter: the output the minimum value under the mask  Rank-order filter:  Elements under the mask are ordered, and a particular value is returned.  Both maximum and minimum filter are instances of rank-order  Another popular instance is median filter  Will discuss some of them in more detail later for the purpose of image restoration.  Maximum filter: the output the maximum value under the mask  Minimum filter: the output the minimum value under the mask  Rank-order filter:  Elements under the mask are ordered, and a particular value is returned.  Both maximum and minimum filter are instances of rank-order  Another popular instance is median filter

Digital Image ProcessingLecture 5 24 More Nonlinear Filters  Alpha-trimmed mean filter:  Order the values under the mask  Trim off elements at either end of the ordered list  Take the mean of the remainder  E.g. assuming a 3x3 mask and the ordered list  Trimming of two elements at either end, the result of the filter is  Alpha-trimmed mean filter:  Order the values under the mask  Trim off elements at either end of the ordered list  Take the mean of the remainder  E.g. assuming a 3x3 mask and the ordered list  Trimming of two elements at either end, the result of the filter is

Digital Image ProcessingLecture 5 25 Summary  We introduced the concept of convolution  We briefly discussed spatial filters of  Low-pass filter for smoothing  High-pass filter for edge sharpening  Nonlinear  We’ll come back to most of the filters under the appropriate topics.  We introduced the concept of convolution  We briefly discussed spatial filters of  Low-pass filter for smoothing  High-pass filter for edge sharpening  Nonlinear  We’ll come back to most of the filters under the appropriate topics.