Review Smoothing Spatial Filters Sharpening Spatial Filters. Spatial Filtering. Dr. Praveen Sankaran. Department of ECE NIT Calicut.

Similar documents
ECE Digital Image Processing and Introduction to Computer Vision. Outline

Filtering in Frequency Domain

Digital Image Processing. Lecture 6 (Enhancement) Bu-Ali Sina University Computer Engineering Dep. Fall 2009

Local enhancement. Local Enhancement. Local histogram equalized. Histogram equalized. Local Contrast Enhancement. Fig 3.23: Another example

Local Enhancement. Local enhancement

Digital Image Processing COSC 6380/4393

Lecture Outline. Basics of Spatial Filtering Smoothing Spatial Filters. Sharpening Spatial Filters

Reading. 3. Image processing. Pixel movement. Image processing Y R I G Q

Image Enhancement: Methods. Digital Image Processing. No Explicit definition. Spatial Domain: Frequency Domain:

Colorado School of Mines Image and Multidimensional Signal Processing

Filtering in the Frequency Domain

Image preprocessing in spatial domain

Lecture 7: Edge Detection

Machine vision. Summary # 4. The mask for Laplacian is given

Digital Image Processing COSC 6380/4393

Machine vision, spring 2018 Summary 4

Fourier Transforms 1D

Today s lecture. Local neighbourhood processing. The convolution. Removing uncorrelated noise from an image The Fourier transform

Gaussian derivatives

Enhancement Using Local Histogram

Histogram Processing

Edge Detection. Introduction to Computer Vision. Useful Mathematics Funcs. The bad news

Empirical Mean and Variance!

IMAGE ENHANCEMENT II (CONVOLUTION)

Spatial Enhancement Region operations: k'(x,y) = F( k(x-m, y-n), k(x,y), k(x+m,y+n) ]

Computer Vision Lecture 3

Image Processing. Waleed A. Yousef Faculty of Computers and Information, Helwan University. April 3, 2010

Lecture 04 Image Filtering

Filtering and Edge Detection

Computational Photography

TRACKING and DETECTION in COMPUTER VISION Filtering and edge detection

Intensity Transformations and Spatial Filtering: WHICH ONE LOOKS BETTER? Intensity Transformations and Spatial Filtering: WHICH ONE LOOKS BETTER?

Roadmap. Introduction to image analysis (computer vision) Theory of edge detection. Applications

Medical Image Analysis

Laplacian Filters. Sobel Filters. Laplacian Filters. Laplacian Filters. Laplacian Filters. Laplacian Filters

Digital Image Processing. Filtering in the Frequency Domain

Announcements. Filtering. Image Filtering. Linear Filters. Example: Smoothing by Averaging. Homework 2 is due Apr 26, 11:59 PM Reading:

Image Gradients and Gradient Filtering Computer Vision

Image Enhancement (Spatial Filtering 2)

3.8 Combining Spatial Enhancement Methods 137

Templates, Image Pyramids, and Filter Banks

Introduction to Computer Vision. 2D Linear Systems

Introduction to Computer Vision

Image Filtering. Slides, adapted from. Steve Seitz and Rick Szeliski, U.Washington

Digital Image Processing. Chapter 4: Image Enhancement in the Frequency Domain

Medical Image Analysis

Taking derivative by convolution

Linear Diffusion. E9 242 STIP- R. Venkatesh Babu IISc

Chapter 16. Local Operations

CITS 4402 Computer Vision

The Frequency Domain, without tears. Many slides borrowed from Steve Seitz

18/10/2017. Image Enhancement in the Spatial Domain: Gray-level transforms. Image Enhancement in the Spatial Domain: Gray-level transforms

Edge Detection. Image Processing - Computer Vision

CS 3710: Visual Recognition Describing Images with Features. Adriana Kovashka Department of Computer Science January 8, 2015

Vlad Estivill-Castro (2016) Robots for People --- A project for intelligent integrated systems

Prof. Mohd Zaid Abdullah Room No:

COMP344 Digital Image Processing Fall 2007 Final Examination

Edge Detection in Computer Vision Systems

Image Filtering, Edges and Image Representation

SURF Features. Jacky Baltes Dept. of Computer Science University of Manitoba WWW:

Edge Detection. CS 650: Computer Vision

Linear Operators and Fourier Transform

Lecture 3: Linear Filters

Digital Image Processing: Sharpening Filtering in Spatial Domain CSC Biomedical Imaging and Analysis Dr. Kazunori Okada

ECE Digital Image Processing and Introduction to Computer Vision. Outline

Computer Vision & Digital Image Processing

Lecture 6: Edge Detection. CAP 5415: Computer Vision Fall 2008

CS 179: LECTURE 16 MODEL COMPLEXITY, REGULARIZATION, AND CONVOLUTIONAL NETS

Lecture 3: Linear Filters

Boxlets: a Fast Convolution Algorithm for. Signal Processing and Neural Networks. Patrice Y. Simard, Leon Bottou, Patrick Haner and Yann LeCun

Basics on 2-D 2 D Random Signal

Case Studies of Logical Computation on Stochastic Bit Streams

Lifting Detail from Darkness

Slide a window along the input arc sequence S. Least-squares estimate. σ 2. σ Estimate 1. Statistically test the difference between θ 1 and θ 2

Edge Detection PSY 5018H: Math Models Hum Behavior, Prof. Paul Schrater, Spring 2005

Midterm Summary Fall 08. Yao Wang Polytechnic University, Brooklyn, NY 11201

Examples. 2-input, 1-output discrete-time systems: 1-input, 1-output discrete-time systems:

ITK Filters. Thresholding Edge Detection Gradients Second Order Derivatives Neighborhood Filters Smoothing Filters Distance Map Image Transforms

Rational Distance Problem for the Unit Square

HeNLM-LA: A LOCALLY ADAPTIVE HERMITE FUNCTIONS EXPANSION BASED NON-LOCAL MEANS DENOISING

Computer Vision Lecture 3

Fast Local Laplacian Filters: Theory and Applications

Some Interesting Problems in Pattern Recognition and Image Processing

SIFT: SCALE INVARIANT FEATURE TRANSFORM BY DAVID LOWE

CSE 473/573 Computer Vision and Image Processing (CVIP)

Lecture 8: Interest Point Detection. Saad J Bedros

Image Noise: Detection, Measurement and Removal Techniques. Zhifei Zhang

size within a local area. Using the image as a matched lter, a nite number of scales are searched within a local window to nd the wavelet coecients th

Edges and Scale. Image Features. Detecting edges. Origin of Edges. Solution: smooth first. Effects of noise

CS5540: Computational Techniques for Analyzing Clinical Data. Prof. Ramin Zabih (CS) Prof. Ashish Raj (Radiology)

Time-Delay Estimation *

CAP 5415 Computer Vision Fall 2011

6-3 Solving Systems by Elimination

Outline. Convolution. Filtering

CAP 5415 Computer Vision

Edge Detection. Computer Vision P. Schrater Spring 2003

16. Deblurring Gaussian blur

(z) UN-1(z) PN-1(z) Pn-1(z) - z k. 30(z) 30(z) (a) (b) (c) x y n ...

ECE 468: Digital Image Processing. Lecture 8

Mean-Shift Tracker Computer Vision (Kris Kitani) Carnegie Mellon University

Transcription:

Spatial Filtering Dr. Praveen Sankaran Department of ECE NIT Calicut January 7, 203

Outline 2 Linear Nonlinear 3

Spatial Domain Refers to the image plane itself. Direct manipulation of image pixels. Figure: Spatial Filtering with a 3 3 mask (kernel, template or window)

Spatial Filter

Correlation and Convolution - Representations Correlation w (m, n) g (m, n) = a b s= a t= b w (s, t) g (m + s, y + t) Convolution w (m, n) g (m, n) = a b s= a t= b w (s, t) g (m s, y t)

Generating a Gaussian Mask Creating a lter essentially boils down to specifying the values of mask coecients. Basic form h (x, y) = e x2 +y 2 2σ 2 sample, quantize h (m, n) = e m2 +n 2 2σ 2 Sample the continuous function about its center. w w 2 w 3 h (, ) h (0, ) h (, ) w 4 w 5 w 6 = h (,0) h (0,0) h (,0) w 7 w 8 w 9 h (,) h(0,) h (,)

Outline Linear Nonlinear 2 Linear Nonlinear 3

Averaging Filters Linear Nonlinear Objective Noise reduction by reducing sharp transitions in intensities. We have seen an averaging lter before. These are also referred to as low pass lters. Creating an averaging lter - replace pixel with average intensity in neighborhood Average = 9 9 i= g i = 9 i= 9 g i, 9 9 9 9 9 9 9 9 9 averaging mask Note that we are giving equal weight to the pixel under consideration and the pixel values around it.

Averaging Filters - Weighted Linear Nonlinear Idea replace pixel value under consideration with a weighted average of values in mask region. Multiply pixel values with dierent mask coecients. Done to reduce blurring. 6 2 2 4 2 2 a s= a b t= b w (s, t) g (m ± s, y ± t) i (m, n) = a s= a b t= b w (s, t), m = 0,, M, n = 0,,2, N. Note that we need not worry about our operation being convolution or correlation with these masks.

Filter Size Matters Linear Nonlinear Figure: Eect of varying lter sizes on an Image. Original image with size 500 500. Filter sizes with m = 3, 5, 9, 5, 35

Outline Linear Nonlinear 2 Linear Nonlinear 3

Linear Nonlinear Order-Statistic (Nonlinear) Filters - Median Filter Replace value of a pixel by the median of the pixel values in the mask region or region-of-interest (ROI). Typical application remove salt-&-pepper (?) noise.

Outline 2 Linear Nonlinear 3

First Derivative Must be zero in areas of constant intensity; 2 Must be non-zero at the onset of an intensity step or ramp; 3 Must be non-zero along ramps. = f (x +, y) f (x, y), remember the problem we talked about earlier? 4 f x From Taylor's theorem, f (x ± ξ, y) = f (x, y) + f (x,y) (±ξ ) + 2 f (x,y) x 2! x 2 ξ 2 + Ignoring higher order terms we end up with three dierent scenarios.

Diering Approximations f (x,y) x f (x+ξ,y) f (x,y) ξ 2 f (x,y) x f (x,y) f (x ξ,y) ξ 3 f (x,y) x f (x+ξ,y) f (x ξ,y) 2ξ Substituting ξ =, three separate, corresponding operators can be formed for a digital image. Which one do we choose? g [m +, n] g [m, n] g [m, n] g [m, n] g[m+,n] g[m,n] 2

Second Derivative Must be zero in areas of constant intensity; 2 Must be non-zero at the onset and end of an intensity step or ramp; 3 Must be zero along ramps of constant slope.

The Laplacian Laplacian 2 f (x, y) = 2 f (x,y) x 2 + 2 f (x,y) y 2 From Taylor's theorem, f (x ± ξ, y) = f (x, y) + f (x,y) x (±ξ ) + 2! f (x,y) x f (x+ξ,y) f (x ξ,y) 2ξ, ξ = 2 f x 2 f (x +, y) + f (x, y) 2f (x, y) and, 2 f y 2 f (x, y + ) + f (x, y ) 2f (x, y) 2 f (x,y) x 2 ξ 2 +, and take

The Laplacian Laplacian 2 f (x, y) = 2 f (x,y) x 2 + 2 f (x,y) y 2 From Taylor's theorem, f (x ± ξ, y) = f (x, y) + f (x,y) x (±ξ ) + 2! f (x,y) x f (x+ξ,y) f (x ξ,y) 2ξ, ξ = 2 f x 2 f (x +, y) + f (x, y) 2f (x, y) and, 2 f y 2 f (x, y + ) + f (x, y ) 2f (x, y) 2 f (x,y) x 2 ξ 2 +, and take

The Laplacian (Final Approximated Form) Laplacian Form in digital image 2 g g [m +, n] + g [m, n] + g [m, n + ] + g [m, n ] 4g [m, n]. Mask Values 0 0 4 0 0 Note that any dierent approximation of the Taylor series expansion could have given a dierent form for the Laplacian.

Using Laplacian to Sharpen an Image i (m, n) = g [m, n] + c [ 2 g [m, n] ] Add Laplacian image to the original.

Unsharp Masking and Highboost Filtering Blur the original image; 2 Subtract the blurred image from the original (this forms the mask); 3 Add mask to the original. i mask [m, n] = g [m, n] g avg [m, n], g [m, n] = g [m, n] + k i mask [m, n] If k =, process = unsharp masking. If k >, process = highboost ltering.

First Gradients - Robert's We dene an image j [m, n] = image. ( ) Roberts [965] g = (w m 9 w 5 ), ( ) g = n (w 8 w 6 ) gradient image = [ ] i [m, n] = (w 9 w 5 ) 2 + (w 8 w 6 ) 2 ( )2 ( ) g + g 2 m n gradient w w 2 w 3 w 4 w 5 w 6 w 7 w 8 w 9 [ ] [ ] 0 0 0 0

Sobel Operator Roberts had a mask of even size no center of symmetry. Approximate ( g m ) = (w 7 + 2w 8 + w 9 ) (w + 2w 2 + w 3 ), ( g n ) = (w 3 + 2w 6 + w 9 ) (w + 2w 4 + w 7 ) w w 2 w 3 w 4 w 5 w 6 w 7 w 8 w 9 2 0 0 0 0 2 0 2 2 0

Application of Spatial approach to: Low pass ltering. Sharpening. First gradient, Roberts, Sobel. Second gradient, Laplacian Application of gradient to sharpening.

Questions 3., 3.2, 3.3, 3.4, 3.5 3.6, 3.7, 3. 3.3, 3.4 3.5, 3.6, 3.7,3.8, 3.26, 3.27, 3.28