Digital Image Processing

Slides:



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

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
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 
Lecture 6 Sharpening Filters
CS 4487/9587 Algorithms for Image Analysis
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
6/9/2015Digital Image Processing1. 2 Example Histogram.
Low Pass Filtering Spatial frequency is a measure of how rapidly brightness or colour varies as we traverse an image. Figure 7.11a shows that an image.
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.
Image Enhancement.
2-D, 2nd Order Derivatives for Image Enhancement
Image Analysis Preprocessing Arithmetic and Logic Operations Spatial Filters Image Quantization.
Lecture 2. Intensity Transformation and Spatial Filtering
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.
ELE 488 F06 ELE 488 Fall 2006 Image Processing and Transmission Linear 2-D Image Filtering 1-D discrete convolution 2-D discrete convolution 2-D.
Image Filtering. Problem! Noise is a problem, even in images! Gaussian NoiseSalt and Pepper Noise.
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 Filtering: Basics
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
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.
Chapter 5: Neighborhood Processing
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.
Sharpening Filters To highlight fine detail or to enhance blurred detail. –smoothing ~ integration –sharpening ~ differentiation Categories of sharpening.
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.
Digital Image Processing Lecture 5: Neighborhood Processing: Spatial Filtering March 9, 2004 Prof. Charlene Tsai.
Image enhancement Last update Heejune Ahn, SeoulTech.
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.
Image Enhancement by Spatial Domain Filtering
Digital Image Processing CSC331
Sliding Window Filters Longin Jan Latecki October 9, 2002.
Spatial Filtering (Chapter 3) CS474/674 - Prof. Bebis.
Image Enhancement in the Spatial Domain.
Miguel Tavares Coimbra
Image Subtraction Mask mode radiography h(x,y) is the mask.
Fundamentals of Spatial Filtering:
Digital Image Processing CSC331
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
CIS 350 – 3 Image ENHANCEMENT SPATIAL DOMAIN
Image Enhancement in the Spatial Domain
Digital Image Processing
Digital Image Processing
Basic Image Processing
Digital Image Processing Week IV
Linear Operations Using Masks
Enhancement.
Department of Computer Engineering
Image Filtering Readings: Ch 5: 5. 4, 5. 5, 5. 6, , 5
Digital Filters.
Image Enhancement in the Spatial Domain
Presentation transcript:

Digital Image Processing Image Enhancement Spatial Filtering 10/13/2018 Duong Anh Duc - Digital Image Processing

Image Enhancement: Spatial Filtering Image enhancement in the spatial domain can be represented as: g(m,n) = T(f)(m,n) The transformation T maybe linear or nonlinear. We will mainly study linear operators T but will see one important nonlinear operation. Transformation Enhanced Image Given Image 10/13/2018 Duong Anh Duc - Digital Image Processing

Duong Anh Duc - Digital Image Processing How to specify T If the operator T is linear and shift invariant (LSI), characterized by the point-spread sequence (PSS) h(m,n) , then (recall convolution) 10/13/2018 Duong Anh Duc - Digital Image Processing

Duong Anh Duc - Digital Image Processing How to specify T In practice, to reduce computations, h(m,n) is of “finite extent: h(k,l) = 0 for (k,l)   where D is a small set (called neighborhood). D is also called as the support of h. In the frequency domain, this can be represented as: G(u,v) = He(u,v) Fe(u,v) where He(u,v) and Fe(u,v) are obtained after appropriate zeropadding. 10/13/2018 Duong Anh Duc - Digital Image Processing

Duong Anh Duc - Digital Image Processing How to specify T Many LSI operations can be interpreted in the frequency domain as a “filtering operation.” It has the effect of filtering frequency components (passing certain frequency components and stopping others). The term filtering is generally associated with such operations. 10/13/2018 Duong Anh Duc - Digital Image Processing

Duong Anh Duc - Digital Image Processing How to specify T Examples of some common filters (1-D case): Lowpass filter Highpass filter 10/13/2018 Duong Anh Duc - Digital Image Processing

Duong Anh Duc - Digital Image Processing If h(m, n) is a 3 by 3 mask given by then w1 w2 w3 h= w4 w5 w6 w7 w8 w9 10/13/2018 Duong Anh Duc - Digital Image Processing

Duong Anh Duc - Digital Image Processing The output g(m, n) is computed by sliding the mask over each pixel of the image f(m, n). This filtering procedure is sometimes referred to as moving average filter. Special care is required for the pixels at the border of image f(m, n). This depends on the so-called boundary condition. Common choices are: The mask is truncated at the border (free boundary) The image is extended by appending extra rows/columns at the boundaries. The extension is done by repeating the first/last row/column or by setting them to some constant (fixed boundary). The boundaries “wrap around” (periodic boundary). 10/13/2018 Duong Anh Duc - Digital Image Processing

Duong Anh Duc - Digital Image Processing In any case, the final output g(m, n) is restricted to the support of the original image f(m, n). The mask operation can be implemented in MATLAB using the filter2 command, which is based on the conv2 command. 10/13/2018 Duong Anh Duc - Digital Image Processing

Duong Anh Duc - Digital Image Processing Smoothing Filters Image smoothing refers to any image-to-image transformation designed to “smooth” or flatten the image by reducing the rapid pixel-to-pixel variation in grayvalues. Smoothing filters are used for: Blurring: This is usually a preprocessing step for removing small (unwanted) details before extracting the relevant (large) object, bridging gaps in lines/curves, Noise reduction: Mitigate the effect of noise by linear or nonlinear operations. 10/13/2018 Duong Anh Duc - Digital Image Processing

Image smoothing by averaging (lowpass spatial filtering) Smoothing is accomplished by applying an averaging mask. An averaging mask is a mask with positive weights, which sum to 1. It computes a weighted average of the pixel values in a neighborhood. This operation is sometimes called neighborhood averaging. Some 3 x 3 averaging masks: This operation is equivalent to lowpass filtering. 10/13/2018 Duong Anh Duc - Digital Image Processing

Example of Image Blurring Original Image Avg. Mask 10/13/2018 Duong Anh Duc - Digital Image Processing

Example of Image Blurring 10/13/2018 Duong Anh Duc - Digital Image Processing

Example of Image Blurring 10/13/2018 Duong Anh Duc - Digital Image Processing

Example of noise reduction Noise-free Image 10/13/2018 Duong Anh Duc - Digital Image Processing

Example of noise reduction Zero-mean Gaussian noise, Variance = 0.01 10/13/2018 Duong Anh Duc - Digital Image Processing

Example of noise reduction Zero-mean Gaussian noise, Variance = 0.05 10/13/2018 Duong Anh Duc - Digital Image Processing

Duong Anh Duc - Digital Image Processing Median Filtering The averaging filter is best suited for noise whose distribution is Gaussian: The averaging filter typically blurs edges and sharp details. The median filter usually does a better job of preserving edges. Median filter is particularly suited if the noise pattern exhibits strong (positive and negative) spikes. Example: salt and pepper noise. 10/13/2018 Duong Anh Duc - Digital Image Processing

Duong Anh Duc - Digital Image Processing Median Filtering Median filter is a nonlinear filter, that also uses a mask. Each pixel is replaced by the median of the pixel values in a neighborhood of the given pixel. Suppose A ={a1, a2, …, ak} are the pixel values in a neighborhood of a given pixel with a1  a2  … ak. Then Note: Median of a set of values is the “center value,” after sorting. For example: If A ={0,1,2,4,6,6,10,12,15} then median(A) = 6. 10/13/2018 Duong Anh Duc - Digital Image Processing

Example of noise reduction Gaussian noise: s = 0.2 Salt & Pepper noise: prob. = 0.2 MSE = 0.0337 MSE = 0.062 10/13/2018 Duong Anh Duc - Digital Image Processing

Example of noise reduction Output of 3x3 Averaging filter MSE = 0.0075 MSE = 0.0125 10/13/2018 Duong Anh Duc - Digital Image Processing

Example of noise reduction Output of 3x3 Median filter MSE = 0.0089 MSE = 0.0042 10/13/2018 Duong Anh Duc - Digital Image Processing

Duong Anh Duc - Digital Image Processing Image Sharpening This involves highlighting fine details or enhancing details that have been blurred. Before After Sharpening 10/13/2018 Duong Anh Duc - Digital Image Processing

Basic highpass spatial filtering This can be accomplished by a linear shift-invariant operator, implemented by means of a mask, with positive and negative coefficients. This is called a sharpening mask, since it tends to enhance abrupt graylevel changes in the image. The mask should have a positive coefficient at the center and negative coefficients at the periphery. The coefficients should sum to zero. 10/13/2018 Duong Anh Duc - Digital Image Processing

Basic highpass spatial filtering Example: This is equivalent to highpass filtering. A highpass filtered image g can be thought of as the difference between the original image f and a lowpass filtered version of f : g(m,n) = f(m,n) – lowpass(f(m,n)) 10/13/2018 Duong Anh Duc - Digital Image Processing

Duong Anh Duc - Digital Image Processing Example Original Image Highpass filtering 10/13/2018 Duong Anh Duc - Digital Image Processing

High-boost filtering This is a filter whose output g is produced by subtracting a lowpass (blurred) version of f from an amplified version of f g(m,n) = Af(m,n) – lowpass(f(m,n)) This is also referred to as unsharp masking. 10/13/2018 Duong Anh Duc - Digital Image Processing

Duong Anh Duc - Digital Image Processing High-boost filtering Observe that g(m,n) = Af(m,n) – lowpass(f(m,n)) = (A-1)f(m,n) + f(m,n) – lowpass(f(m,n)) = (A-1)f(m,n) + hipass(f(m,n)) For 1 > A , part of the original image is added back to the highpass filtered version of f. The result is the original image with the edges enhanced relative to the original image. 10/13/2018 Duong Anh Duc - Digital Image Processing

Duong Anh Duc - Digital Image Processing Example Original Image Highpass filtering High-boost filtering 10/13/2018 Duong Anh Duc - Digital Image Processing

Duong Anh Duc - Digital Image Processing Derivative filter Averaging tends to blur details in an image. Averaging involves summation or integration. Naturally, differentiation or “differencing” would tend to enhance abrupt changes, i.e., sharpen edges. Most common differentiation operator is the gradient: 10/13/2018 Duong Anh Duc - Digital Image Processing

Duong Anh Duc - Digital Image Processing Derivative filter The magnitude of the gradient is: Discrete approximations to the magnitude of the gradient is normally used. 10/13/2018 Duong Anh Duc - Digital Image Processing

Duong Anh Duc - Digital Image Processing Derivative filter Consider the following image region: We may use the approximation: z1 z2 z3 z4 z5 z6 z7 z8 z9 10/13/2018 Duong Anh Duc - Digital Image Processing

Duong Anh Duc - Digital Image Processing Derivative filter This can implemented using the masks: As follows: 10/13/2018 Duong Anh Duc - Digital Image Processing

Duong Anh Duc - Digital Image Processing Derivative filter Alternatively, we may use the approximation: This can implemented using the masks: As follows: 10/13/2018 Duong Anh Duc - Digital Image Processing

Duong Anh Duc - Digital Image Processing Derivative filter The resulting maks are called Roberts cross-gradient operators. The Roberts operators and the Prewitt/Sobel operators (described later) are used for edge detection and are sometimes called edge detectors. 10/13/2018 Duong Anh Duc - Digital Image Processing

Example: Roberts cross-gradient operator 10/13/2018 Duong Anh Duc - Digital Image Processing

Example: Roberts cross-gradient operator 10/13/2018 Duong Anh Duc - Digital Image Processing

Duong Anh Duc - Digital Image Processing Prewitt operators Better approximations to the gradient can be obtained by: This can be implemented using the masks: as follows: 10/13/2018 Duong Anh Duc - Digital Image Processing

Duong Anh Duc - Digital Image Processing Sobel operators Another approximation is given by the masks: The resulting masks are called Sobel operators. 10/13/2018 Duong Anh Duc - Digital Image Processing

Duong Anh Duc - Digital Image Processing Example Prewitt Sobel 10/13/2018 Duong Anh Duc - Digital Image Processing