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

Slides:



Advertisements
Similar presentations
Image Enhancement in the Frequency Domain (2)
Advertisements

3-D Computer Vision CSc83020 / Ioannis Stamos  Revisit filtering (Gaussian and Median)  Introduction to edge detection 3-D Computater Vision CSc
Chapter 3 Image Enhancement in the Spatial Domain.
Frequency Domain Filtering (Chapter 4)
1 Image Processing Ch4: Filtering in frequency domain Prepared by: Tahani Khatib AOU.
Digital Image Processing
Image Enhancement in the Frequency Domain Part III
Fourier Transform (Chapter 4)
Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department
© by Yu Hen Hu 1 ECE533 Digital Image Processing Image Enhancement in Frequency Domain.
Chap 4 Image Enhancement in the Frequency Domain.
DREAM PLAN IDEA IMPLEMENTATION Introduction to Image Processing Dr. Kourosh Kiani
ECE 472/572 - Digital Image Processing Lecture 5 - Image Enhancement - Frequency Domain Filters 09/13/11.
Digital Image Processing
Digtial Image Processing, Spring ECES 682 Digital Image Processing Oleh Tretiak ECE Department Drexel University.
Reminder Fourier Basis: t  [0,1] nZnZ Fourier Series: Fourier Coefficient:
Chapter 4 Image Enhancement in the Frequency Domain.
CHAPTER 4 Image Enhancement in Frequency Domain
Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006.
Digital Image Processing Chapter 4: Image Enhancement in the Frequency Domain.
Image Enhancement in the Frequency Domain Spring 2005, Jen-Chang Liu.
Chapter 4 Image Enhancement in the Frequency Domain.
Transforms: Basis to Basis Normal Basis Hadamard Basis Basis functions Method to find coefficients (“Transform”) Inverse Transform.
DREAM PLAN IDEA IMPLEMENTATION Introduction to Image Processing Dr. Kourosh Kiani
Digital Image Processing, 2nd ed. © 2002 R. C. Gonzalez & R. E. Woods Chapter 4 Image Enhancement in the Frequency Domain Chapter.
Filters in the Frequency Domain.  Image Smoothing Using Frequency Domain Filters: ◦ Ideal Lowpass Filters ◦ Butterworth Lowpass Filters ◦ Gaussian Lowpass.
Presentation Image Filters
Introduction to Image Processing
Digital Image Processing Chapter # 4 Image Enhancement in Frequency Domain Digital Image Processing Chapter # 4 Image Enhancement in Frequency Domain.
Image Processing © 2002 R. C. Gonzalez & R. E. Woods Lecture 4 Image Enhancement in the Frequency Domain Lecture 4 Image Enhancement.
CS654: Digital Image Analysis
Chapter 7: The Fourier Transform 7.1 Introduction
Digital Image Processing Lecture 5: Neighborhood Processing: Spatial Filtering Prof. Charlene Tsai.
1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng.
Digital Image Processing Chapter 4 Image Enhancement in the Frequency Domain Part I.
Digital Image Processing CSC331 Image Enhancement 1.
ENG4BF3 Medical Image Processing Image Enhancement in Frequency Domain.
Computer Vision – Enhancement(Part III) Hanyang University Jong-Il Park.
Digital Image Processing (Digitaalinen kuvankäsittely) Exercise 2
7- 1 Chapter 7: Fourier Analysis Fourier analysis = Series + Transform ◎ Fourier Series -- A periodic (T) function f(x) can be written as the sum of sines.
Frequency Domain Processing Lecture: 3. In image processing, linear systems are at the heart of many filtering operations, and they provide the basis.
University of Ioannina - Department of Computer Science Filtering in the Frequency Domain (Application) Digital Image Processing Christophoros Nikou
Practical Image Processing1 Chap7 Image Transformation  Image and Transformed image Spatial  Transformed domain Transformation.
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.
1 CMPB 345: IMAGE PROCESSING DISCRETE TRANSFORM 2.
Fourier Transform.
Image Enhancement (Frequency Domain)
Computer Graphics & Image Processing Chapter # 4 Image Enhancement in Frequency Domain 2/26/20161.
Digital Image Processing Lecture 9: Filtering in Frequency Domain Prof. Charlene Tsai.
Frequency Domain Filtering. Frequency Domain Methods Spatial Domain Frequency Domain.
Fourier transform.
Amity School of Engineering & Technology 1 Amity School of Engineering & Technology DIGITAL IMAGE PROCESSING & PATTERN RECOGNITION Credit Units: 4 Mukesh.
Digital Image Processing Lecture 8: Image Enhancement in Frequency Domain II Naveed Ejaz.
Fourier Transform (Chapter 4) CS474/674 – Prof. Bebis.
Digital Image Processing Chapter - 4
Digital Image Processing , 2008
Miguel Tavares Coimbra
IMAGE ENHANCEMENT IN THE FREQUENCY DOMAIN
IMAGE PROCESSING FREQUENCY DOMAIN PROCESSING
The content of lecture This lecture will cover: Fourier Transform
Spatial & Frequency Domain
Gaussian Lowpass Filter
Image Enhancement in the
Digital Image Processing
ENG4BF3 Medical Image Processing
4. Image Enhancement in Frequency Domain
Digital Image Processing
Filtering in the Frequency Domain
Lecture 4 Image Enhancement in Frequency Domain
Presentation transcript:

Digital Image Processing Chapter 4: Image Enhancement in the Frequency Domain 22 June 2005 Digital Image Processing Chapter 4: Image Enhancement in the Frequency Domain 22 June 2005

Background: Fourier Series Any periodic signals can be viewed as weighted sum of sinusoidal signals with different frequencies Fourier series: Frequency Domain: view frequency as an independent variable (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition.

Fourier Tr. and Frequency Domain Time, spatial Domain Signals Frequency Domain Signals Fourier Tr. Inv Fourier Tr. 1-D, Continuous case Fourier Tr.: Inv. Fourier Tr.:

Fourier Tr. and Frequency Domain (cont.) 1-D, Discrete case Fourier Tr.: Inv. Fourier Tr.: u = 0,…,M-1 x = 0,…,M-1 F(u) can be written as or where

Example of 1-D Fourier Transforms Notice that the longer the time domain signal, The shorter its Fourier transform (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition.

Relation Between  x and  u For a signal f(x) with M points, let spatial resolution  x be space between samples in f(x) and let frequency resolution  u be space between frequencies components in F(u), we have Example: for a signal f(x) with sampling period 0.5 sec, 100 point, we will get frequency resolution equal to This means that in F(u) we can distinguish 2 frequencies that are apart by 0.02 Hertz or more.

2-Dimensional Discrete Fourier Transform 2-D IDFT 2-D DFT u = frequency in x direction, u = 0,…, M-1 v = frequency in y direction, v = 0,…, N-1 x = 0,…, M-1 y = 0,…, N-1 For an image of size MxN pixels

F(u,v) can be written as or where 2-Dimensional Discrete Fourier Transform (cont.) For the purpose of viewing, we usually display only the Magnitude part of F(u,v)

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. 2-D DFT Properties

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. 2-D DFT Properties (cont.)

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. 2-D DFT Properties (cont.)

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. 2-D DFT Properties (cont.)

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. Computational Advantage of FFT Compared to DFT

Relation Between Spatial and Frequency Resolutions where  x = spatial resolution in x direction  y = spatial resolution in y direction  u = frequency resolution in x direction  v = frequency resolution in y direction N,M = image width and height  x and  y are pixel width and height. )

How to Perform 2-D DFT by Using 1-D DFT f(x,y)f(x,y) 1-D DFT by row F(u,y)F(u,y) 1-D DFT by column F(u,v)F(u,v)

How to Perform 2-D DFT by Using 1-D DFT (cont.) f(x,y)f(x,y) 1-D DFT by row F(x,v)F(x,v) 1-D DFT by column F(u,v)F(u,v) Alternative method

Periodicity of 1-D DFT 0 N 2N-N DFT repeats itself every N points (Period = N) but we usually display it for n = 0,…, N-1 We display only in this range From DFT:

Conventional Display for 1-D DFT 0 N-1 Time Domain Signal DFT f(x)f(x) 0 N-1 Low frequency area High frequency area The graph F(u) is not easy to understand !

0 -N/2N/2-1 0 N-1 Conventional Display for DFT : FFT Shift FFT Shift: Shift center of the graph F(u) to 0 to get better Display which is easier to understand. High frequency area Low frequency area

Periodicity of 2-D DFT For an image of size NxM pixels, its 2-D DFT repeats itself every N points in x- direction and every M points in y-direction. We display only in this range 0N2N-N 0 M 2M -M 2-D DFT: g(x,y)g(x,y) (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition.

Conventional Display for 2-D DFT High frequency area Low frequency area F(u,v) has low frequency areas at corners of the image while high frequency areas are at the center of the image which is inconvenient to interpret. (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition.

2-D FFT Shift : Better Display of 2-D DFT 2D FFTSHIFT 2-D FFT Shift is a MATLAB function: Shift the zero frequency of F(u,v) to the center of an image. High frequency areaLow frequency area (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition.

Original display of 2D DFT 0N2N-N 0 M 2M -M (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. Display of 2D DFT After FFT Shift 2-D FFT Shift (cont.) : How it works

Example of 2-D DFT Notice that the longer the time domain signal, The shorter its Fourier transform (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition.

Example of 2-D DFT Notice that direction of an object in spatial image and Its Fourier transform are orthogonal to each other. (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition.

Example of 2-D DFT Original image 2D DFT 2D FFT Shift

Example of 2-D DFT Original image 2D DFT 2D FFT Shift

Basic Concept of Filtering in the Frequency Domain From Fourier Transform Property: We cam perform filtering process by using (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. Multiplication in the frequency domain is easier than convolution in the spatial Domain.

Filtering in the Frequency Domain with FFT shift f(x,y)f(x,y) 2D FFT FFT shift F(u,v)F(u,v) 2D IFFTX H(u,v) (User defined) G(u,v)G(u,v) g(x,y)g(x,y) In this case, F(u,v) and H(u,v) must have the same size and have the zero frequency at the center.

Multiplication in Freq. Domain = Circular Convolution f(x)f(x)DFTF(u)F(u) G(u) = F(u)H(u) h(x)h(x)DFTH(u)H(u) g(x)g(x)IDFT Multiplication of DFTs of 2 signals is equivalent to perform circular convolution in the spatial domain. f(x)f(x) h(x)h(x) g(x)g(x) “Wrap around” effect

H(u,v) Gaussian Lowpass Filter with D0 = 5 Original image Filtered image (obtained using circular convolution) Incorrect areas at image rims Multiplication in Freq. Domain = Circular Convolution

Linear Convolution by using Circular Convolution and Zero Padding f(x)f(x)DFTF(u)F(u) G(u) = F(u)H(u) h(x)h(x)DFTH(u)H(u) g(x)g(x) IDFT Zero padding Concatenation Padding zeros Before DFT Keep only this part

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. Linear Convolution by using Circular Convolution and Zero Padding

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. Linear Convolution by using Circular Convolution and Zero Padding Zero padding area in the spatial Domain of the mask image (the ideal lowpass filter) Filtered image Only this area is kept.

Filtering in the Frequency Domain : Example In this example, we set F(0,0) to zero which means that the zero frequency component is removed. Note: Zero frequency = average intensity of an image (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition.

Filtering in the Frequency Domain : Example (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. Highpass Filter Lowpass Filter

Filtering in the Frequency Domain : Example (cont.) (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. Result of Sharpening Filter

Filter Masks and Their Fourier Transforms (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition.

Ideal Lowpass Filter where D(u,v) = Distance from (u,v) to the center of the mask. Ideal LPF Filter Transfer function (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition.

Examples of Ideal Lowpass Filters (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. The smaller D 0, the more high frequency components are removed.

Results of Ideal Lowpass Filters Ringing effect can be obviously seen! (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition.

How ringing effect happens Ideal Lowpass Filter with D 0 = 5 Surface Plot Abrupt change in the amplitude

How ringing effect happens (cont.) Spatial Response of Ideal Lowpass Filter with D 0 = 5 Surface Plot Ripples that cause ringing effect

How ringing effect happens (cont.) (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition.

Butterworth Lowpass Filter Transfer function Where D 0 = Cut off frequency, N = filter order. (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition.

Results of Butterworth Lowpass Filters There is less ringing effect compared to those of ideal lowpass filters! (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition.

Spatial Masks of the Butterworth Lowpass Filters Some ripples can be seen. (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition.

Gaussian Lowpass Filter Transfer function Where D 0 = spread factor. Note: the Gaussian filter is the only filter that has no ripple and hence no ringing effect. (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition.

Gaussian Lowpass Filter (cont.) Gaussian lowpass filter with D 0 = 5 Spatial respones of the Gaussian lowpass filter with D 0 = 5 Gaussian shape

Results of Gaussian Lowpass Filters No ringing effect! (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition.

Application of Gaussian Lowpass Filters The GLPF can be used to remove jagged edges and “repair” broken characters. Better LookingOriginal image (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition.

Application of Gaussian Lowpass Filters (cont.) Remove wrinkles Softer-Looking Original image (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition.

Application of Gaussian Lowpass Filters (cont.) Remove artifact lines: this is a simple but crude way to do it! Filtered imageOriginal image : The gulf of Mexico and Florida from NOAA satellite. (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition.

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. Highpass Filters H hp = 1 - H lp

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. Ideal Highpass Filters where D(u,v) = Distance from (u,v) to the center of the mask. Ideal LPF Filter Transfer function

Butterworth Highpass Filters (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. Transfer function Where D 0 = Cut off frequency, N = filter order.

Gaussian Highpass Filters (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. Transfer function Where D 0 = spread factor.

Gaussian Highpass Filters (cont.) Gaussian highpass filter with D 0 = 5 Spatial respones of the Gaussian highpass filter with D 0 = 5

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. Spatial Responses of Highpass Filters Ripples

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. Results of Ideal Highpass Filters Ringing effect can be obviously seen!

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. Results of Butterworth Highpass Filters

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. Results of Gaussian Highpass Filters

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. Laplacian Filter in the Frequency Domain From Fourier Tr. Property: Then for Laplacian operator Surface plot We get Image of –(u 2 +v 2 )

Laplacian Filter in the Frequency Domain (cont.) Spatial response of –(u 2 +v 2 ) Cross section Laplacian mask in Chapter 3

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. Sharpening Filtering in the Frequency Domain Spatial Domain Frequency Domain Filter

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. Sharpening Filtering in the Frequency Domain (cont.) p

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. Sharpening Filtering in the Frequency Domain (cont.) f A = 2 A = 2.7

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. High Frequency Emphasis Filtering Original Butterworth highpass filtered image High freq. emphasis filtered image After Hist Eq. a = 0.5, b = 2

Homomorphic Filtering An image can be expressed as i(x,y) = illumination component r(x,y) = reflectance component We need to suppress effect of illumination that cause image Intensity changed slowly.

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. Homomorphic Filtering

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. Homomorphic Filtering More details in the room can be seen!

(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. Correlation Application: Object Detection