Digital Image Processing COSC 6380/4393

Similar documents
Digital Image Processing COSC 6380/4393

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

Digital Image Processing. Filtering in the Frequency Domain

Image Enhancement in the frequency domain. GZ Chapter 4

Fourier Transforms 1D

Convolution Spatial Aliasing Frequency domain filtering fundamentals Applications Image smoothing Image sharpening

Introduction to Computer Vision. 2D Linear Systems

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

Local Enhancement. Local enhancement

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

Empirical Mean and Variance!

ECE Digital Image Processing and Introduction to Computer Vision. Outline

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

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

Digital Image Processing COSC 6380/4393

Image Filtering, Edges and Image Representation

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

ECG782: Multidimensional Digital Signal Processing

ECE Digital Image Processing and Introduction to Computer Vision. Outline

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

Filtering in the Frequency Domain

Image preprocessing in spatial domain

Chapter 4 Image Enhancement in the Frequency Domain

Computer Vision & Digital Image Processing

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

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

Filtering in Frequency Domain

Chapter 16. Local Operations

Colorado School of Mines Image and Multidimensional Signal Processing

Computer Vision. Filtering in the Frequency Domain

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

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

Computer Vision & Digital Image Processing. Periodicity of the Fourier transform

Lecture 4 Filtering in the Frequency Domain. Lin ZHANG, PhD School of Software Engineering Tongji University Spring 2016

IMAGE ENHANCEMENT II (CONVOLUTION)

Machine vision, spring 2018 Summary 4

Image Enhancement in the frequency domain. Inel 5046 Prof. Vidya Manian

CITS 4402 Computer Vision

Filtering, Frequency, and Edges

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

Lecture 7: Edge Detection

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

Lecture # 06. Image Processing in Frequency Domain

The Frequency Domain : Computational Photography Alexei Efros, CMU, Fall Many slides borrowed from Steve Seitz

EECS490: Digital Image Processing. Lecture #11

Chapter 4: Filtering in the Frequency Domain. Fourier Analysis R. C. Gonzalez & R. E. Woods

Multiscale Image Transforms

Lecture 3: Linear Filters

Histogram Processing

3. Lecture. Fourier Transformation Sampling

Lecture 3: Linear Filters

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

Fourier Analysis of Signals Using the DFT

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

The Frequency Domain. Many slides borrowed from Steve Seitz

Multidimensional Signal Processing

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

6.869 Advances in Computer Vision. Bill Freeman, Antonio Torralba and Phillip Isola MIT Oct. 3, 2018

Digital Image Processing

Digital Image Processing ERRATA. Wilhelm Burger Mark J. Burge. An algorithmic introduction using Java. Second Edition. Springer

Image Enhancement (Spatial Filtering 2)

Image Processing 1 (IP1) Bildverarbeitung 1

Lecture 04 Image Filtering

Image Acquisition and Sampling Theory

Enhancement Using Local Histogram

Gaussian derivatives

Fourier transform. Stefano Ferrari. Università degli Studi di Milano Methods for Image Processing. academic year

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

Introduction to Image Processing #5/7

EE482: Digital Signal Processing Applications

Filtering and Edge Detection

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

Digital Signal Processing Prof. T. K. Basu Department of Electrical Engineering Indian Institute of Technology, Kharagpur

Computer Vision Lecture 3

I Chen Lin, Assistant Professor Dept. of CS, National Chiao Tung University. Computer Vision: 4. Filtering

Distortion Analysis T

Module 3. Convolution. Aim

Sound & Vibration Magazine March, Fundamentals of the Discrete Fourier Transform

Image enhancement. Why image enhancement? Why image enhancement? Why image enhancement? Example of artifacts caused by image encoding

Aspects of Continuous- and Discrete-Time Signals and Systems

9. Image filtering in the spatial and frequency domains

Continuous-Time Fourier Transform

6 The SVD Applied to Signal and Image Deblurring

E2.5 Signals & Linear Systems. Tutorial Sheet 1 Introduction to Signals & Systems (Lectures 1 & 2)

Outline. Convolution. Filtering

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

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

8 The SVD Applied to Signal and Image Deblurring

Basics on 2-D 2 D Random Signal

ECG782: Multidimensional Digital Signal Processing

8 The SVD Applied to Signal and Image Deblurring

EXAMINATION QUESTION PAPER

Fourier series: Any periodic signals can be viewed as weighted sum. different frequencies. view frequency as an

Sampling in 1D ( ) Continuous time signal f(t) Discrete time signal. f(t) comb

Screen-space processing Further Graphics

8.1 Circuit Parameters

3.8 Combining Spatial Enhancement Methods 137

EE123 Digital Signal Processing

Some Interesting Problems in Pattern Recognition and Image Processing

Today s lecture. The Fourier transform. Sampling, aliasing, interpolation The Fast Fourier Transform (FFT) algorithm

Transcription:

Digital Image Processing COSC 6380/4393 Lecture 11 Oct 3 rd, 2017 Pranav Mantini Slides from Dr. Shishir K Shah, and Frank Liu

Review: 2D Discrete Fourier Transform If I is an image of size N then Sin image Cos image Let ሚI be the DFT of the I N 1 N 1 ሚI u, v = I i, j cos[ 2π (ui + vj)] N 1 i=0 j=0 N 1 N 1 N 1 N 1 i=0 I i, j sin[ 2π (ui + vj)] N ሚI u, v = I i, j (cos[ 2π (ui + vj)] N 1sin[2π (ui + vj)]) N i=0 j=0 N 1 N 1 ሚI u, v = I i, j e 12π N (ui+vj) i=0 j=0 0 F u = f x e 1ux

Review: 2D Inverse Discrete Fourier Transform Let ሚI be the DFT of the I N 1 N 1 I i, j = u=0 u=0 ሚI u, v e 12π N (ui+vj) f x = F u e iux

Review: Properties of DFT Matrix We can understand the DFT matrix better by studying some of its properties. Any image I of interest to us is composed of real integers. However, the DFT of I is generally complex. It can be written in the form 21 8.5 8.5 12 1.5 1.5 0 4.3 4.3 0 0.8 0.8

Review: Symmetry of DFT ሚI N u, N v = ሚI u, v The DFT of an image I is conjugate symmetric: The magnitude DFT of an image I is symmetric:

Review: Symmetry of DFT Depiction of the symmetry of the DFT (magnitude). The highest frequencies are represented near (u, v) = (N/2, N/2). 6

Review: Periodicity of DFT We have defined the DFT matrix as finite in extent (N x N): However, if the arguments are allowed to take values outside the range 0 u, v N-1, we find that the DFT is periodic in both the u- and v-directions, with period N: For any integers m, n This is called the periodic extension of the DFT. It is defined for all integer frequencies u, v. 7

Review: Periodic Extension of DFT 8

Review: Periodic Extension of Image The IDFT equation implies the periodic extension of the image I as well (with period N), simply by letting the arguments (i, j) take any integer value. Note that for any integers n, m In a sense, the DFT implies that the image I is already periodic. This will be extremely important when we consider convolution 9

Review: Periodic Extension of Image 10

Review: Displaying the DFT Usually, the DFT is displayed with its center coordinate (u, v) = (0, 0) at the center of the image. This way, the lower frequency information (which usually dominates an image) is clustered together near the origin at the center of the display. This can be accomplished in practice by taking the DFT of the alternating image (for display purposes only!) Observe that [(-1) i+j I(i,j) ; 0 i, j N-1] A simple shift of the DFT by half its length in both directions. 11

Review: Centered DFT 12

Review: Granularity Large values near the DFT origin correspond to large smooth regions in the image or a strong background. Since images are positive (implying an additive offset), any image has a large peak at (u, v) = (0, 0). Masking the DFT Suppose that we define several zero-one images: Masking the DFT with these will produce IDFT images with only low, mid-, or high frequencies remaining (slides). Of course, if we add up the results, we get the original image back. 13

Review: Directionality If the DFT is brighter along a specific orientation, then the image must contains highly oriented components in that direction. Masking the DFT Suppose that we define several oriented zero-one images: Masking the DFT with these will produce IDFT images with only highly oriented frequencies remaining (slides). Again, if we add up the results, we get the original image back. 14

Review: Periodic Noise removal

Spatial Correlation Operator The correlation of a filter w( x, y) of size m n with an image f ( x, y), denoted as w( x, y) f ( x, y) a w( x, y) f ( x, y) w( s, t) f ( x s, y t) b s a t b 10/6/2017 16

f 0 0 0 1 0 0 0 0 w 1 2 3 2 8

f 0 0 0 1 0 0 0 0 w 1 2 3 2 8 1 2 3 2 8 0 0 0 1 0 0 0 0

f 0 0 0 1 0 0 0 0 w 1 2 3 2 8 Zero Padding 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 2 3 2 8 Initial Position

f 0 0 0 1 0 0 0 0 w 1 2 3 2 8 Zero Padding 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 2 3 2 8 0

f 0 0 0 1 0 0 0 0 w 1 2 3 2 8 Zero Padding 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 2 3 2 8 Position after one shift 0 0

f 0 0 0 1 0 0 0 0 w 1 2 3 2 8 Zero Padding 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 2 3 2 8 Position after one shift 0 0

f 0 0 0 1 0 0 0 0 w 1 2 3 2 8 Zero Padding 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 2 3 2 8 Position after four shift 0 0 0 8

f 0 0 0 1 0 0 0 0 w 1 2 3 2 8 Zero Padding 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 2 3 2 8 Final Position 0 0 0 8 2 3 2 1 0 0 0 0

f 0 0 0 1 0 0 0 0 w 1 2 3 2 8 Full Correlation result 0 0 0 8 2 3 2 1 0 0 0 0

f 0 0 0 1 0 0 0 0 w 1 2 3 2 8 Cropped Correlation result 0 8 2 3 2 1 0 0

Spatial Convolution Operator The convolution of a filter w( x, y) of size m n with an image f ( x, y), denoted as w( x, y) f ( x, y) a w( x, y) f ( x, y) w( s, t) f ( x s, y t) b s a t b 10/6/2017 27

f 0 0 0 1 0 0 0 0 w 1 2 3 2 8

f 0 0 0 1 0 0 0 0 w 1 2 3 2 8 8 2 3 2 1 w rotated by 180 0 0 0 0 1 0 0 0 0

f 0 0 0 1 0 0 0 0 w 1 2 3 2 8 Zero Padding 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 8 2 3 2 1 Initial Position

f 0 0 0 1 0 0 0 0 w 1 2 3 2 8 Zero Padding 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 8 2 3 2 1 0

f 0 0 0 1 0 0 0 0 w 1 2 3 2 8 Zero Padding 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 8 2 3 2 1 Position after four shift 0 0 0 1

f 0 0 0 1 0 0 0 0 w 1 2 3 2 8 Full Convolution result 0 0 0 1 2 3 2 8 0 0 0 0

f 0 0 0 1 0 0 0 0 w 1 2 3 2 8 Cropped Convolution result 0 8 2 3 2 1 0 0

Spatial Filtering A spatial filter consists of (a) a neighborhood, and (b) a predefined operation Linear spatial filtering of an image of size MXN with a filter of size mxn is given by the expression a b g( x, y) w( s, t) f ( x s, y t) s a t b 35

Spatial Filtering 36

Spatial Correlation Operator 37

38

Linear Systems And Linear Image Filtering A process that accepts a signal or image I as input and transforms it by an act of linear convolution is a type of linear system Example 39

Goals of Linear Image Filtering Process sampled, quantized images to transform them into - images of better quality (by some criteria) - images with certain features enhanced - images with certain features de-emphasized or eradicated 40

Some Specific Goals smoothing - remove noise from bit errors, transmission, etc deblurring - increase sharpness of blurred images sharpening - emphasize significant features, such as edges combinations of these 41

Smoothing Spatial Filters Smoothing filters are used for blurring and for noise reduction Blurring is used in removal of small details and bridging of small gaps in lines or curves Smoothing spatial filters include linear filters and nonlinear filters. 42

Spatial Smoothing Linear Filters The general implementation for filtering an M N image with a weighted averaging filter of size m n is given g( x, y) a b s a t b w( s, t) f ( x s, y t) w( s, t) where m 2a 1, n 2b 1. a b s a t b 43

Two Smoothing Averaging Filter Masks 44

Two Smoothing Averaging Filter Masks Demo Filters 45

46

Example: Gross Representation of Objects Blur an image for getting a gross representation. Small objects get blended with background 47

Example: Gross Representation of Objects Blur an image for getting a gross representation. Small objects get blended with background Demo stars 48

Laplace Operator: Foundation The first-order derivative of a one-dimensional function f(x) is the difference f f ( x 1) f ( x) x The second-order derivative of f(x) as the difference 2 f f ( x 1) f ( x 1) 2 f ( x) 2 x 50

10/6/2017 51

Laplace Operator The second-order isotropic derivative operator is the Laplacian for a function (image) f(x,y) f x f y 2 2 2 f 2 2 2 f f ( x 1, y) f ( x 1, y) 2 f ( x, y) 2 x 2 f f ( x, y 1) f ( x, y 1) 2 f ( x, y) 2 y 2 f f x y f x y f x y f x y ( 1, ) ( 1, ) (, 1) (, 1) - 4 f ( x, y) 52

Laplace Operator Demo Filters 53

Sharpening Spatial Filters: Laplace Operator Image sharpening in the way of using the Laplacian: g x y f x y c f x y where, f ( x, y) is input image, g( x, y) is sharpenend images, c 2 (, ) (, ) (, ) 2-1 if f ( x, y) corresponding to Fig. 3.37(a) or (b) and c 1 if either of the other two filters is used. 54

55

Unsharp Masking and Highboost Filtering Unsharp masking Sharpen images consists of subtracting an unsharp (smoothed) version of an image from the original image e.g., printing and publishing industry Steps 1. Blur the original image 2. Subtract the blurred image from the original 3. Add the mask to the original 56

Unsharp Masking and Highboost Filtering Let f ( x, y) denote the blurred image, unsharp masking is g ( x, y) f ( x, y) f ( x, y) mask Then add a weighted portion of the mask back to the original g( x, y) f ( x, y) k * g ( x, y) k 0 mask when k 1, the process is referred to as highboost filtering. 57

Unsharp Masking: Demo 58

Unsharp Masking and Highboost Filtering: Example Demo Sharpen 59

Convolution Theorem Let f be and image and h a filtering window Lets us consider the convolution f(t) h(t)

Convolution Theorem Let f and h be two function Lets us consider the convolution f t h t = f τ h t τ τ= From the definition of convolution a w( x, y) f ( x, y) w( s, t) f ( x s, y t) b s a t b

Convolution Theorem Let f and h be two function Lets us consider the convolution f t h t = f τ h t τ F[f t h t ] τ= = [ f τ h t τ ]e 12πμt t= τ= Computing the Fourier transform of the convolution F u = f x e 1ux

Convolution Theorem Let f and h be two function Lets us consider the convolution f t h t = f τ h t τ τ= F[f t h t ] = [ f τ h t τ ]e 12πμt t= τ= = f τ [ h t τ e 12πμt ] τ= t=

Convolution Theorem Let f and h be two function Lets us consider the convolution f t h t = f τ h t τ τ= F[f t h t ] = [ f τ h t τ ]e 12πμt t= τ= = f τ [ h t τ e 12πμt ] τ= t= = f τ [ h t τ e 12πμ(t τ) ] e 12πμτ τ= t=

Convolution Theorem Let f and h be two function Lets us consider the convolution f t h t = F[f t h t ] = = = τ= τ= = τ= f τ [ τ= [ t= τ= f τ [ t= t= f τ h t τ f τ h t τ ]e 12πμt h t τ e 12πμt ] h t τ e 12πμ(t τ) ] e 12πμτ f τ [H(μ)] e 12πμ(τ) = H(μ) = H μ F(μ) τ= f τ e 12πμ(τ)

Convolution Theorem Fourier transform pairs f t h t H μ F(μ) f t h t H μ F(μ)