Image Enhancement in the frequency domain. GZ Chapter 4

Similar documents
IMAGE ENHANCEMENT: FILTERING IN THE FREQUENCY DOMAIN. Francesca Pizzorni Ferrarese

Digital Image Processing. Image Enhancement: Filtering in the Frequency Domain

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

Chapter 4 Image Enhancement in the Frequency Domain

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

Digital Image Processing COSC 6380/4393

Digital Image Processing. Filtering in the Frequency Domain

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

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

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

Introduction to Computer Vision. 2D Linear Systems

EECS490: Digital Image Processing. Lecture #11

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

Filtering in Frequency Domain

Filtering in the Frequency Domain

Digital Image Processing COSC 6380/4393

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

Computer Vision. Filtering in the Frequency Domain

GBS765 Electron microscopy

G52IVG, School of Computer Science, University of Nottingham

IMAGE ENHANCEMENT II (CONVOLUTION)

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

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

Lecture 13: Implementation and Applications of 2D Transforms

Local Enhancement. Local enhancement

Contents. Signals as functions (1D, 2D)

Lecture # 06. Image Processing in Frequency Domain

Contents. Signals as functions (1D, 2D)

The Discrete-time Fourier Transform

ECG782: Multidimensional Digital Signal Processing

Prof. Mohd Zaid Abdullah Room No:

MITOCW watch?v=jtj3v Rx7E

Empirical Mean and Variance!

Contents. Signals as functions (1D, 2D)

Frequency2: Sampling and Aliasing

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

MIT 2.71/2.710 Optics 10/31/05 wk9-a-1. The spatial frequency domain

COMP344 Digital Image Processing Fall 2007 Final Examination

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

Machine vision, spring 2018 Summary 4

SEISMIC WAVE PROPAGATION. Lecture 2: Fourier Analysis

LAB 6: FIR Filter Design Summer 2011

3. Lecture. Fourier Transformation Sampling

Vectors [and more on masks] Vector space theory applies directly to several image processing/ representation problems

CITS 4402 Computer Vision

Digital Image Processing

Unit 7. Frequency Domain Processing

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

Basics on 2-D 2 D Random Signal

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

Lecture 3: Linear Filters

Lecture 3: Linear Filters

DISCRETE FOURIER TRANSFORM

Fourier Transform 2D

Image Filtering, Edges and Image Representation

ECG782: Multidimensional Digital Signal Processing

Introduction to Fourier Analysis Part 2. CS 510 Lecture #7 January 31, 2018

Chapter 16. Local Operations

Multiscale Image Transforms

EXAMINATION QUESTION PAPER

Module 3. Convolution. Aim

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

Linear Convolution Using FFT

9. Image filtering in the spatial and frequency domains

Fourier Transforms 1D

Discrete Fourier Transform

Fourier Series Representation of

ANALOG AND DIGITAL SIGNAL PROCESSING ADSP - Chapter 8

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

Responses of Digital Filters Chapter Intended Learning Outcomes:

2. Image Transforms. f (x)exp[ 2 jπ ux]dx (1) F(u)exp[2 jπ ux]du (2)

We know that f(x, y) and F (u, v) form a Fourier Transform pair, i.e. f(ax, by)e j2π(ux+vy) dx dy. x x. a 0 J = y y. = 0 b

EE482: Digital Signal Processing Applications

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

BOOK CORRECTIONS, CLARIFICATIONS, AND CORRECTIONS TO PROBLEM SOLUTIONS

Digital Image Processing. Lecture 8 (Enhancement in the Frequency domain) Bu-Ali Sina University Computer Engineering Dep.

Time series analysis in neuroscience. Lecture 6. FIR and IIR filters

FILTERING IN THE FREQUENCY DOMAIN

EE 508 Lecture 15. Filter Transformations. Lowpass to Bandpass Lowpass to Highpass Lowpass to Band-reject

ESS Finite Impulse Response Filters and the Z-transform

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

CS 179: GPU Programming. Lecture 9 / Homework 3

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

! Circular Convolution. " Linear convolution with circular convolution. ! Discrete Fourier Transform. " Linear convolution through circular

CS 179: GPU Programming. Lecture 9 / Homework 3

UNIVERSITI SAINS MALAYSIA. EEE 512/4 Advanced Digital Signal and Image Processing

Digital Signal Processing

Key Intuition: invertibility

Wavelets and Multiresolution Processing

encoding without prediction) (Server) Quantization: Initial Data 0, 1, 2, Quantized Data 0, 1, 2, 3, 4, 8, 16, 32, 64, 128, 256

Review: Continuous Fourier Transform

Multimedia Networking ECE 599

CS 4495 Computer Vision. Frequency and Fourier Transforms. Aaron Bobick School of Interactive Computing. Frequency and Fourier Transform

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

Chapter 4 Image Enhancement in the Frequency Domain

Additional Pointers. Introduction to Computer Vision. Convolution. Area operations: Linear filtering

DISCRETE-TIME SIGNAL PROCESSING

Review of Fundamentals of Digital Signal Processing

Digital Signal Processing:

1 1.27z z 2. 1 z H 2

Transcription:

Image Enhancement in the frequency domain GZ Chapter 4

Contents In this lecture we will look at image enhancement in the frequency domain The Fourier series & the Fourier transform Image Processing in the frequency domain Image smoothing Image sharpening Fast Fourier Transform

Fourier representation =

The Discrete Fourier Transform (DFT) Here we use the GW s notations The Discrete Time Fourier Transform of f(x,y) for x = 0, 1, 2 M-1 and y = 0,1,2 N-1, denoted by F(u, v), is given by the equation: for u = 0, 1, 2 M-1 and v = 0, 1, 2 N-1. åå - = - = + - = 1 0 1 0 ) / / ( 2 ), ( ), ( M x N y N vy M ux j e y x f v u F p

The Inverse DFT It is really important to keep in mind that the Fourier transform is completely reversible The inverse DFT is given by: for x = 0, 1, 2 M-1 and y = 0, 1, 2 N-1 åå - = - = + = 1 0 1 0 ) / / ( 2 ), ( 1 ), ( M u N v N vy M ux j e v u F MN y x f p

Fourier spectra Fourier spectra in 1D The absolute value of the complex function in the Fourier domain is the amplitude spectrum The angle defined by the inverse tg of the ratio between the imaginary and the real components of the complex function is the phase spectrum The square of the amplitude spectrum is the power spectrum 6

Fourier spectra in 2D 7

Main properties The value of the DFT in the origin is the mean value of the function f(x,y) If f is real its DFT is conjugate symmetric Thus the Fourier spectrum is symmetric 8

Basics of filtering in the frequency domain To filter an image in the frequency domain: Compute F(u,v) the DFT of the image Multiply F(u,v) by a filter function H(u,v) Compute the inverse DFT of the result

Some Basic Frequency Domain Filters Low Pass Filter (smoothing) High Pass Filter (edge detection)

Filtering in Fourier domain H(u,v) is the filter transfer function, which is the DFT of the filter impulse response The implementation consists in multiplying point-wise the filter H(u,v) with the function F(u,v) Real filters are called zero phase shift filters because they don t change the phase of F(u,v) 11

Filtered image The filtered image is obtained by taking the inverse DFT of the resulting image It can happen that the filtered image has spurious imaginary components even though the original image f(x,y) and the filter h(x,y) are real. These are due to numerical errors and are neglected The final result is thus the real part of the filtered image 12

Smoothing: low pass filtering

Edge detection: high-pass filtering Original image

Edge detection: greylevel image 15

Filtered image 16

Hints for filtering Color images are usually converted to graylevel images before filtering. This is due to the fact that the information about the structure of the image (what is in the image) is represented in the luminance component Images are usually stored as unsigned integers. Some operations could require the explicit cast to double or float for being implemented The filtered image in general consists of double values, so a cast to unsigned integer could be required before saving it in a file using a predefined format. This could introduce errors due to rounding operations. 17

Frequency Domain Filters The basic model for filtering is: G(u,v) = H(u,v)F(u,v) where F(u,v) is the Fourier transform of the image being filtered and H(u,v) is the filter transform function Filtered image ( ) = I 1 { F ( u, v) } f x, y Smoothing is achieved in the frequency domain by dropping out the high frequency components Low pass (LP) filters only passes the low frequencies, drops the high ones High-pass (HP) filters olny passes the frequencies above a minimum value

LP and HP filtering 19

Filtering in spatial and frequency domains The filtering operations in spatial and frequency domains are linked by the convolution theorem Modulation theorem (reminder) 20

Another proof of the convolution theorem Starting from the digital delta function, we will prove that the filtering operation in the signal domain is obtained by the convolution of the signal with the filter impulse response h(x,y) Consider the digital delta function, so an impulse function of strength A located in (x 0,y 0 ) Shifting (or sampling) property 21

Getting to the impulse response FT of the delta function located in the origin Now, let s set f(x,y)=δ(x,y) and calculate the convolution between f and a filter h(x,y) 22

Getting to the impulse response It can be observed that if f is a delta, then the result of the convolution is equal to the function h(x,y) apart from a change in the amplitude Then, h(x,y) is called impulse response because it represents the response (output) of the filter when the input is a delta f(x,y)=delta(x,y) h(x,y) h(x,y) So filtering in the signal domain is performed by the convolution of the signal with the filter impulse response 23

Filtering: summary 24

Ideal Low Pass Filter Simply cut off all high frequency components that are at a specified distance D 0 from the origin of the transform changing the distance changes the behaviour of the filter

Ideal Low Pass Filter (cont ) The transfer function for the ideal low pass filter can be given as: H( u, v) = ì1 í î0 if if D( u, v) D( u, v) > D D 0 0 where D(u,v) is given as: D - 2 ( u, v) = [( u - M / 2) + ( v N / 2) 2 ] 1/ 2

Ideal Low Pass Filter (cont ) Above we show an image, it s Fourier spectrum and a series of ideal low pass filters of radius 5, 15, 30, 80 and 230 superimposed on top of it

Ideal Low Pass Filter (cont )

Ideal Low Pass Filter (cont )

Ideal Low Pass Filter (cont ) Original image Result of filtering with ideal low pass filter of radius 5 Result of filtering with ideal low pass filter of radius 15 Result of filtering with ideal low pass filter of radius 30 Result of filtering with ideal low pass filter of radius 80 Result of filtering with ideal low pass filter of radius 230

Ideal Low Pass Filter (cont ) Result of filtering with ideal low pass filter of radius 5

Ideal Low Pass Filter (cont ) Result of filtering with ideal low pass filter of radius 15

Butterworth Lowpass Filters The transfer function of a Butterworth lowpass filter of order n with cutoff frequency at distance D 0 from the origin is defined as: 1 1+ [ D( u, v) / H ( u, v) = 2n D0]

Butterworth Lowpass Filter (cont ) Original image Result of filtering with Butterworth filter of order 2 and cutoff radius 5 Result of filtering with Butterworth filter of order 2 and cutoff radius 15 Result of filtering with Butterworth filter of order 2 and cutoff radius 30 Result of filtering with Butterworth filter of order 2 and cutoff radius 80 Result of filtering with Butterworth filter of order 2 and cutoff radius 230

Butterworth Lowpass Filter (cont ) Original image Result of filtering with Butterworth filter of order 2 and cutoff radius 5

Butterworth Lowpass Filter (cont ) Result of filtering with Butterworth filter of order 2 and cutoff radius 15

Gaussian Lowpass Filters The transfer function of a Gaussian lowpass filter is defined as: H( u, v) = e -D 2 ( u, v)/ 2D 2 0

Gaussian LP and HP filters 38

Gaussian Lowpass Filters (cont ) Original image Result of filtering with Gaussian filter with cutoff radius 5 Result of filtering with Gaussian filter with cutoff radius 15 Result of filtering with Gaussian filter with cutoff radius 30 Result of filtering with Gaussian filter with cutoff radius 85 Result of filtering with Gaussian filter with cutoff radius 230

Lowpass Filters Compared Result of filtering with ideal low pass filter of radius 15 Result of filtering with Butterworth filter of order 2 and cutoff radius 15 Result of filtering with Gaussian filter with cutoff radius 15

Lowpass Filtering Examples A low pass Gaussian filter is used to connect broken text

Lowpass Filtering Examples

Lowpass Filtering Examples (cont ) Different lowpass Gaussian filters used to remove blemishes in a photograph D 0 =100 D 0 =80

Lowpass Filtering Examples (cont ) Original image Gaussian lowpass filter Spectrum of original image Processed image

Sharpening in the Frequency Domain Edges and fine details in images are associated with high frequency components High pass filters only passes the high frequencies, drops the low ones High pass frequencies are precisely the reverse of low pass filters, so: H hp (u, v) = 1 H lp (u, v)

Ideal High Pass Filters The ideal high pass filter is given as: H( u, v) = ì0 í î1 if if D( u, v) D( u, v) > D D 0 0 where D 0 is the cut off distance as before

Ideal High Pass Filters (cont ) Results of ideal high pass filtering with D 0 = 15 Results of ideal high pass filtering with D 0 = 30 Results of ideal high pass filtering with D 0 = 80

Butterworth High Pass Filters The Butterworth high pass filter is given as: 1 1+ [ D0 / D( u, v)] H ( u, v) = 2n where n is the order and D 0 is the cut off distance as before

Butterworth High Pass Filters (cont ) Butterworth of order 2 D 0 = 15 Butterworth of order 2 D 0 = 80 Butterworth of order 2 D 0 = 30

Gaussian High Pass Filters The Gaussian high pass filter is given as: H( u, v) = 1- e -D 2 ( u, v)/ 2D 2 0 where D0 is the cut off distance as before

Gaussian High Pass Filters (cont ) Gaussian high pass D 0 = 15 Gaussian high pass D 0 = 80 Gaussian high pass D 0 = 30

Impulse response High pass filters comparison Gray-level profiles 52

Highpass Filter Comparison Results of ideal high pass filtering with D 0 = 15 Results of Butterworth high pass filtering of order 2 with D 0 = 15 Results of Gaussian high pass filtering with D 0 = 15

Highpass Filter Comparison Results of ideal high pass filtering with D 0 = 15

Highpass Filter Comparison Results of Butterworth high pass filtering of order 2 with D 0 = 15

Highpass Filter Comparison Results of Gaussian high pass filtering with D 0 = 15

Laplacian filter From the properties of the Fourier transform From this it follows that The expression on the left side is the laplacian of the function f, thus 57

Laplacian filter Thus, the Laplacian can be implemented in the Fourier domain by using the filter 58

Laplacian filter 59

Laplacian filter 60

High boost filtering A special case of unsharp masking Idea: HP filters cut the zero frequency component, namely the mean value. The resulting image is zero mean and looks very dark High boost filtering sums the original image to the result of HPF in order to get an image with sharper (emphasized) edges but with same range of gray values as the original one In formulas High pass High boost Signal domain Frequency domain 61

High boost filtering Reworking the formulas f hb f hb ( x, y) = Af ( x, y) f ( lp x, y) ( x, y) = Af ( x, y) f ( x, y) + f ( x, y) f ( lp x, y) = = A 1 ( ) f x, y ( ) + f hp x, y ( ) For A=1 the high-boost corresponds to the HP For A>1 the contribution of the original image becomes larger 62

High boost filtering Note: high pass filtering is also called unsharp filtering In the Fourier domain H hb ( u, v) = ( A 1)H ( u, v) + H ( hp u, v) Boosting the edges 63

High boost filtering Laplacian A=2 A=2.7 64

High boost + histogram equalization Butterworth High boost equalization 65

Rest of Chapter 4 2D Fourier transform and properties Convolution and correlation Need for padding Fast Fourier Transform (FFT) 66