Objectives: We will learn about filters that are carried out in the frequency domain.

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

Image and Multidimensional Signal Processing

3. Several Random Variables

FEA Solution Procedure

Lesson 81: The Cross Product of Vectors

Section 7.4: Integration of Rational Functions by Partial Fractions

FEA Solution Procedure

Bertrand s Theorem. October 8, µr 2 + V (r) 0 = dv eff dr. 3 + dv. f (r 0 )

FEA Solution Procedure

FRTN10 Exercise 12. Synthesis by Convex Optimization

m = Average Rate of Change (Secant Slope) Example:

Integration of Basic Functions. Session 7 : 9/23 1

Elements of Coordinate System Transformations

Setting The K Value And Polarization Mode Of The Delta Undulator

Control Systems

Lecture 3. (2) Last time: 3D space. The dot product. Dan Nichols January 30, 2018

Figure 1 Probability density function of Wedge copula for c = (best fit to Nominal skew of DRAM case study).

Lecture 7 Waveguides. TC 412 Microwave Communications

Lecture Notes: Finite Element Analysis, J.E. Akin, Rice University

Second-Order Wave Equation

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

EXERCISES WAVE EQUATION. In Problems 1 and 2 solve the heat equation (1) subject to the given conditions. Assume a rod of length L.

III. Demonstration of a seismometer response with amplitude and phase responses at:

Frequency Estimation, Multiple Stationary Nonsinusoidal Resonances With Trend 1

MECHANICS OF SOLIDS COMPRESSION MEMBERS TUTORIAL 2 INTERMEDIATE AND SHORT COMPRESSION MEMBERS

Chapter 4 Linear Models

Department of Industrial Engineering Statistical Quality Control presented by Dr. Eng. Abed Schokry

1 The space of linear transformations from R n to R m :

Linear System Theory (Fall 2011): Homework 1. Solutions

CONTENTS. INTRODUCTION MEQ curriculum objectives for vectors (8% of year). page 2 What is a vector? What is a scalar? page 3, 4

The Cross Product of Two Vectors in Space DEFINITION. Cross Product. u * v = s ƒ u ƒƒv ƒ sin ud n

Math 116 First Midterm October 14, 2009

6.4 VECTORS AND DOT PRODUCTS

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

Assignment Fall 2014

STEP Support Programme. STEP III Hyperbolic Functions: Solutions

Filtering in Frequency Domain

Digital Image Processing COSC 6380/4393

EXPT. 5 DETERMINATION OF pk a OF AN INDICATOR USING SPECTROPHOTOMETRY

APPENDIX B MATRIX NOTATION. The Definition of Matrix Notation is the Definition of Matrix Multiplication B.1 INTRODUCTION

Sensitivity Analysis in Bayesian Networks: From Single to Multiple Parameters

n 1 sin 1 n 2 sin 2 Light and Modern Incident ray Normal 30.0 Air Glass Refracted ray speed of light in vacuum speed of light in a medium c v

Vectors in Rn un. This definition of norm is an extension of the Pythagorean Theorem. Consider the vector u = (5, 8) in R 2

Digital Image Processing. Filtering in the Frequency Domain

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

Classify by number of ports and examine the possible structures that result. Using only one-port elements, no more than two elements can be assembled.

Microscopic Properties of Gases

LIGHTWEIGHT STRUCTURES in CIVIL ENGINEERING - CONTEMPORARY PROBLEMS

Study on the impulsive pressure of tank oscillating by force towards multiple degrees of freedom

Discontinuous Fluctuation Distribution for Time-Dependent Problems

10.2 Solving Quadratic Equations by Completing the Square

Chapter 3 MATHEMATICAL MODELING OF DYNAMIC SYSTEMS

Pulses on a Struck String

Introdction Finite elds play an increasingly important role in modern digital commnication systems. Typical areas of applications are cryptographic sc

Graphs and Networks Lecture 5. PageRank. Lecturer: Daniel A. Spielman September 20, 2007

4 Exact laminar boundary layer solutions

sin u 5 opp } cos u 5 adj } hyp opposite csc u 5 hyp } sec u 5 hyp } opp Using Inverse Trigonometric Functions

Technical Note. ODiSI-B Sensor Strain Gage Factor Uncertainty

A Survey of the Implementation of Numerical Schemes for Linear Advection Equation

Complex Variables. For ECON 397 Macroeconometrics Steve Cunningham

Homework 5 Solutions

Math 263 Assignment #3 Solutions. 1. A function z = f(x, y) is called harmonic if it satisfies Laplace s equation:

Chapter 9 Flow over Immersed Bodies

Linear Strain Triangle and other types of 2D elements. By S. Ziaei Rad

1. State-Space Linear Systems 2. Block Diagrams 3. Exercises

Formal Methods for Deriving Element Equations

Multiplication and division. Explanation and worked examples. First, we ll look at work you should know at this level.

Evaluation of the Fiberglass-Reinforced Plastics Interfacial Behavior by using Ultrasonic Wave Propagation Method

Uncertainties of measurement

Chapter 4 Supervised learning:

Move Blocking Strategies in Receding Horizon Control

Unknown Input High Gain Observer for Parametric Fault Detection and Isolation of Dynamical Systems

Chem 4501 Introduction to Thermodynamics, 3 Credits Kinetics, and Statistical Mechanics. Fall Semester Homework Problem Set Number 10 Solutions

Simplified Identification Scheme for Structures on a Flexible Base

Optimal Control of a Heterogeneous Two Server System with Consideration for Power and Performance

The Dual of the Maximum Likelihood Method

Solving a System of Equations

Image Enhancement in the frequency domain. GZ Chapter 4

VIBRATION MEASUREMENT UNCERTAINTY AND RELIABILITY DIAGNOSTICS RESULTS IN ROTATING SYSTEMS

Which of these statements are true? A) 1, 2 and 3 only C) 2, 4 and 5 only. B) 1, 2 and 5 only D) 1, 3 and 4 only

L = 2 λ 2 = λ (1) In other words, the wavelength of the wave in question equals to the string length,

FOUNTAIN codes [3], [4] provide an efficient solution

Theoretical and Experimental Implementation of DC Motor Nonlinear Controllers

Bayes and Naïve Bayes Classifiers CS434

Reflections on a mismatched transmission line Reflections.doc (4/1/00) Introduction The transmission line equations are given by

CFD-Simulation thermoakustischer Resonanzeffekte zur Bestimmung der Flammentransferfunktion

Curves - Foundation of Free-form Surfaces

OPTI-502 Optical Design and Instrumentation I John E. Greivenkamp Final Exam In Class Page 1/16 Fall, 2015

PhysicsAndMathsTutor.com

The Linear Quadratic Regulator

QUANTILE ESTIMATION IN SUCCESSIVE SAMPLING

EDEXCEL NATIONAL CERTIFICATE/DIPLOMA. PRINCIPLES AND APPLICATIONS of FLUID MECHANICS UNIT 13 NQF LEVEL 3 OUTCOME 3 - HYDRODYNAMICS

Decision Making in Complex Environments. Lecture 2 Ratings and Introduction to Analytic Network Process

MEG 741 Energy and Variational Methods in Mechanics I

An Investigation into Estimating Type B Degrees of Freedom

ρ u = u. (1) w z will become certain time, and at a certain point in space, the value of

When are Two Numerical Polynomials Relatively Prime?

Interest Point Detection. Lecture-4

Shooting Method for Ordinary Differential Equations Autar Kaw

Step-Size Bounds Analysis of the Generalized Multidelay Adaptive Filter

Transcription:

Chapter Freqency Domain Processing Objectives: We will learn abot ilters that are carried ot in the reqency domain. In addition to being the base or linear iltering, Forier Transorm oers considerable lexibility in the design and implementation o iltering soltions in areas sch as image enhancement, image restoration, image data compression, and a some other applications. The reqency and spatial iltering can be combined to achieve reslts that are beyond what each can achieve individally. Forier Transorm Forier transorm o a nction x one-dimensional is: F j π x x e dx where j. We can obtain the x sing the inverse Forier Transorm. j π x F x F e d The two-dimensional version o this eqations are: F, v j π x vy x, y e dxdy And the inverse Forier Transorm or this one can be shown as: j π x vy x, y F, v e ddv

Discrete Forier Transorm To do any o these on a compter we need the discrete versions. For one dimensional case sppose we have M discrete points. In the two dimensional case, assme we have M and N discrete points in x and y directions respectively. One-dimensional: M F xi e M i 0 The inverse transorm is: j πx / M i or 0,,,3,..., M M x F i 0 i e j π x / M i or x 0,,,3,..., M 3

5 Two-dimensional: 0 0 / /,, M i N k N vy M x j k i k i e y x MN v F π Discrete Forier Transorm Where, x,y denotes the inpt image with: x 0,,,, M- and y 0,,,, N- representing the nmber o rows and colmns o the M-by-N image. The inverse transorm is: 0 0 / /,, M i N k N y v M x j k i k i e v F y x π Remember that we have: sin cos θ θ θ j e j Since images are -D arrays, we work with these two. 6 [ ],, tan, : Spectrm Phase,,,, : Spectrm Power,,, : Spectrm Forier / v R v I v v I v R v F v P v I v R v F φ Discrete Forier Transorm

What are they? The vale o the transormation at the origin o the reqency domain [I.e., F0,0] is called the dc component o the Forier Transorm. F0,0 is is eqal to MN times the average vale o x,y Even i x,y is real, it transormation in general is complex. To visally analyze a transorm, we need to compte its spectrm. I.e., compte the magnitde o the complex variable F, v and display it as an image. F,v can also be represented as: F, v F, v e jφ, v 7 Discrete Forier Transorm Example Compte the Forier transorm o the nction shown below: x,y A y Y X x 8

9 Example FFT Compte the FFT o x x. Let s only comptes or reqencies. 0,,,3,..., or 0 / M e x M F M i M x j i i π 3 0,,, or 3 0 / and e x F i x j i i π 3 6 0 3 0 3 0 0 03/ 0 / 0 / 00 / e e e e F j j j j π π π π 0 j --... 3 0 3 0 / 3 / 3 / / / 0 / π π π π π π π j j j j j j j e e e e e e e F F - F3 - - j

Example >> zeros5,5; >> 5:65,35:75; >> imshow Example - cont >> F t; >> F logabsf; >> imshowf

Example cont Centering the spectrm F t; F logabsf; imshowf or i :5 or j :5 i,j -^ij*i,j; end end F t; F logabsf; igre,imshowf 3 This is what happened

5 Filtering in the reqency domain In general, the ondation o linear iltering in both the spatial and reqency domains is the convoltion theorem: x, y h h, y H, v F, v Conversely, we will have: x, y h h, y H, v* G, v Here, the symbol * indicates convoltion o the two nctions, and the expression on sides o the doble arrow denotes Forier Transorm pair. We are interested in the irst one, where iltering in spatial domain consists o convolting an image x,y with a ilter mask, hx,y. Based on the convoltion theorem we can obtain the same reslt by mltiplying F,v by H,v, the Forier transorm o the spatial ilter. It is common to reer to H,v as the ilter transer nction. 6

Convoltion and Correlation Example: Occrrences o a letter in a text 7 Read the Original Image, Store it in array text Determine the size, Let s say p, q Read the image o the letter, Store it in an array l Determine the size, Let s say n, m Rotate the image o the letter by 80 Compte the FFT o the letter, pad it to the p, q size Compte the FFT o the text 8

Mltiply element-by-element the two Take the Real part o the reslt Mltiply element-by-element the two Find the MAX Threshold based on the MAX Display 9 Based on convoltion theorem: To obtain corresponding iltered image in the spatial domain we simply compte the inverse Forier transorm o the prodct o H,vF,v. This is identical to what we wold obtain by sing convoltion in the spatial domain, as long as the ilter mask hx,y is the inverse Forier transorm o H,v. Convolving periodic nctions can case intererence between adjacent period i the periods are close with respect to the dration o the nonzero parts o the nctions. 0

This intererence, wraparond error, can be avoided by padding the nctions with zeros as explain below. Assme that nctions x,y and hx,y are o size AXB and CXD, respectively. Form two extended padded nctions both o size PXQ by appending zeros to and h. The wraparond error is avoided by choosing: P A C and Q B D In MATLAB, we will se F t, PQ, PQ This appends enogh zeros to sch that the reslting image is o size PQ*PQ, then comptes the FFT.

3

Basic Steps in DFT Filtering 5 Basic Steps in DFT Filtering. Obtain the padding parameters sing nction paddedsize: PQ paddedsizesize;. Obtain the Forier transorm with padding: F t, PQ, PQ; 3. Generate a ilter nction, H, o size PQXPQ sing one o the methods discssed in the remainder o this chapter. The ilter mst be in the ormat shown in Fig.b. I it is not in that ormat, se shit to make it.. Mltiply the transorm by the ilter: G H.* F 6

Basic Steps in DFT Filtering 5. Obtain the real part o the inverse FFT o G: g realitg; 6. Crop the top, let rectangle to the original size: g g:size,, :size, ; 7 Example or DFT Filtering Try this or [0 0; ]; PQ paddedsizesize; Fp t, PQ, PQ; HP lpilter gassian, PQ, PQ, *sig; GP HP.* Fp; gp realitgp; gpc gp:size,, :size,; %cropping imshowgp, [ ] Similar reslt as: w special'gassian', 3,3; gnew imilterdoble, w 8

Obtaining Freqency Domain Filters rom Spatial Filters In general, iltering in the spatial domain is more eicient comptationally than reqency domain iltering when the ilters are small. One obvios approach or generating a reqency domain ilter, H, that corresponds to a given spatial ilter, h, is to let: H th, PQ, PQ, where the vales o vector PQ depend on the size o the image we want to ilter, as discssed in the last section. Bt we need to know: 9 Obtaining Freqency Domain Filters rom Spatial Filters How to convert spatial ilters into eqivalent reqency domain ilters, How to compare the reslts between spatial domain iltering sing nction imilter, and reqency domain iltering. 30

600x600 image F t S tshitlog absf; S gscales; imshows 3 Generate the spatial ilter sing special: h special sobol h 0-0 - 0 - To view a plot o the corresponding reqency domain ilter: 3

reqzh 33 PQ paddedsizesize; H reqzh, PQ, PQ; H itshith; Origin at the top 3

absh 35 absh 36

Next, we generate the iltered images. In spatial domain we se: gs imilterdoble, h; Which pads the border o the image with 0. The iltered image obtained by reqency domain processing: g dtilt, H; Download the dtilt, paddedsize, and other related iles rom the notes web page. 37 gs imilterdoble, h; 38

g dtilt, H; Negative vales are presented. Average is below the mid-gray vale. 39 imshowabsgs, [ ] 0

imshowabsg, [ ] Using thresholding we can see the bondaries better absgs > 0.*absmaxgs:

Using thresholding we can see the bondaries better absg > 0.*absmaxg: 3 Generating Filters Directly in the Freqency Domain We discssed circlarly symmetric ilters that are speciied as varios nctions o distance rom the origin o the transorm. One o the things we need to compte is the distance between any point and a speciied point in the reqency rectangle. In MATLAB, or FFT comptations the origin o the transorm is at the top-let o the reqency rectangle. Ths, or distance is also measred rom that point. In order or s to compte sch a distance, we need the meshing system. This is what we call meshgrid array and is generated by dtv nction.

Example Here is an example o distance comptation. In this example we will compte the distance sqared rom every point in a rectangle o size 8x5 to the origin o the reqency rectangle. >> [U, V] dtv8, 5; This comptes meshgrid reqency matrices U and V both o size 8-by-5. >> D U.^ V.^ 5 U 0 0 0 0 0 3 3 3 3 3-3 -3-3 -3-3 - - - - - - - - - - V 0 - - 0 - - 0 - - 0 - - 0 - - 0 - - 0 - - 0 - - 6

D 0 5 5 5 8 8 5 9 0 3 3 0 6 7 0 0 7 9 0 3 3 0 5 8 8 5 5 5 7 U 0 0 0 0 0 3 3 3 3 3-3 -3-3 -3-3 - - - - - - - - - - V 0 - - 0 - - 0 - - 0 - - 0 - - 0 - - 0 - - 0 - - D 0 5 5 5 8 8 5 9 0 3 3 0 6 7 0 0 7 9 0 3 3 0 5 8 8 5 5 5 8

nction [U, V] dtv[m, N] 0: M-; v 0: N-; idx ind > M/; idx idx M; idy indv > N/; vidy vidy N; [U, V] meshgrid, v; The meshgrid nction will prodce two arrays. Rows on U are copies o rows in and colmns on V are copies o colmns on v. 9 The distance with respect to the center o the reqency rectangle can be compted as: >> tshitd ans 0 7 6 7 0 3 0 9 0 3 8 5 5 8 5 5 0 5 5 8 5 5 8 3 0 9 0 3 50

Lowpass Freqency Domain Filters An Ideal Lowpass Filter ILPF has the transer nction: i D, v D0 H, v 0 i D, v > D0 Where D 0 is a speciied non-negative nmber and D,v is the distance rom point, v to the center o the ilter. The D,v D 0 alls on a circle. Since we mltiply ilter H by the Forier transorm o an image, an ideal case wold be where all components o F otside the circle gets ct o, i.e. gets mltiplied by 0 and keep the points in/on the circle nchanged. 5 Lowpass Freqency Domain Filters cont. A Btterworth lowpass ilter BLPF o order n, with a cto reqency at distance D 0 rom the origin, has the transorm nction: Unlike ILPF, this one does not have a shape discontinity at D 0. In this transormation when D,v D 0,H,v will be 0.5, or down 50% rom its maximm vale. The Gassian lowpass ilter GLPF is given by: Where σ is the standard deviation. H I we let σ D 0 we will obtain: What wold be H,v For H D,v D 0? [ D, v / D0] H, v n, v e, v e D D, v/ σ 5, v/ D 0

GLPF 0.9 e^-p/ 0.8 0.7 0.6 0.5 0 0. 0. 0.6 0.8 p Where p D,v/D 0 53 Example: Create a 3x3 ilter in the reqency domain. 5

Example Original Image 55 PQ paddedsizesize; [U, V] dtvpq, PQ ; D0 0.05*PQ; F t, PQ, PQ; H exp- U.^ V.^/*D0^; igre, imshowtshith, [ ] 56

Spectrm: igre, imshowlog abstshitf,[ ] 57 g dtilt, H; igre, imshowg, [ ] Note: The lpilter generates the transer nctions o all the lowpass ilters discssed in this chapter. Yo need to copy this ile rom the notes web page. 58

Sharpening Freqency Domain Filters Jst as lowpass iltering blrs an image, the opposite will happen in case o highpass iltering. Highpass ilters sharpen the image by attenating the low reqencies and leaving the high reqencies o the Forier transorms relatively nchanged. Basics o highpass iltering Given the transer nction H p,v o a lowpass ilter, we obtain the transer nction o the corresponding highpass ilter by sing the simple relation: H hp, v H p, v The nction hpilter is sed in MATLAB to generate highpass ilters. 59 Highpass Filter Options with hpilter hpiltertype, M, N, D0, n It creates the transer nction o a highpass ilter, H, o the speciied TYPE and size M-by-N. ideal : Ideal highpass ilter with cto reqency D0. No need or n, and D0 mst be positive. btw : Btterworth highpass ilter o order n, and cto D0. The dealt vale or n is.0. D0 mst be positive. gassian : Gassian highpass ilter with cto standard deviation D0. No need or n, and D0 mst be positive. 60

Example Ideal highpass ilter H tshithpilter ideal, 500, 500, 50 ; meshh:0:500, :0:500; axis[0 50 0 50 0 ] colormap[0 0 0] axis o axis o 6 Example Ideal highpass ilter Corresponding image to This one is shown on the right hand side igre, imshowh, [ ] 6

Example Btterworth highpass ilter H tshithpilter btterworth, 500, 500, 50 ; meshh:0:500, :0:500; axis[0 50 0 50 0 ] colormap[0 0 0] axis o axis o 63 Example Btterworth highpass ilter Corresponding image to This one is shown on the right hand side igre, imshowh, [ ] 6

Example Gassian highpass ilter Corresponding image to This one is shown on the right hand side 65 PQ paddedsizesize; D0 0.05*PQ; H hpilter gassian, PQ, PQ, D0; g dtilt, H; igre, imshoowg, [ ] 66

High-Freqency Emphasis Filtering Highpass iltering zero ot the dc term, ths redcing the average vale o an image to 0. An approach to compensate or this is to add an oset to a highpass ilter. When an oset is combined with mltiplying the ilter by a constant greater than, the approach is called highreqency emphasis. The mltiplier increases the amplitde o low reqencies, bt low reqency eects on enhancement are less than those o high reqencies. The high-reqency emphasis transer nction is deined as: H he, v a bh hp,v Where a is the oset, b is the mltiplier, and H hp,v is the transer nction o a highpass ilter. 67