ENEE631 Digital Image Processing (Spring'04) Fourier Transform and Spatial Filtering Spring ’04 Instructor: Min Wu ECE Department, Univ. of Maryland, College.

Slides:



Advertisements
Similar presentations
Spatial Filtering (Chapter 3)
Advertisements

Topic 6 - Image Filtering - I DIGITAL IMAGE PROCESSING Course 3624 Department of Physics and Astronomy Professor Bob Warwick.
Image Processing Lecture 4
Chapter 3 Image Enhancement in the Spatial Domain.
Image Processing Frequency Filtering Instructor: Juyong Zhang
Sliding Window Filters and Edge Detection Longin Jan Latecki Computer Graphics and Image Processing CIS 601 – Fall 2004.
CS 4487/9587 Algorithms for Image Analysis
Digital Image Processing
Digital Image Processing In The Name Of God Digital Image Processing Lecture3: Image enhancement M. Ghelich Oghli By: M. Ghelich Oghli
6/9/2015Digital Image Processing1. 2 Example Histogram.
Digital Image Processing
CS 376b Introduction to Computer Vision 02 / 27 / 2008 Instructor: Michael Eckmann.
Edge Detection Phil Mlsna, Ph.D. Dept. of Electrical Engineering
1 Image Filtering Readings: Ch 5: 5.4, 5.5, 5.6,5.7.3, 5.8 (This lecture does not follow the book.) Images by Pawan SinhaPawan Sinha formal terminology.
Image Enhancement.
2-D, 2nd Order Derivatives for Image Enhancement
ELE 488 F06 ELE 488 Fall 2006 Image Processing and Transmission Linear 2-D Image Filtering 1-D discrete convolution 2-D discrete convolution 2-D.
Image (and Video) Coding and Processing Lecture 2: Basic Filtering Wade Trappe.
Digital Image Processing, 2nd ed. © 2002 R. C. Gonzalez & R. E. Woods Chapter 4 Image Enhancement in the Frequency Domain Chapter.
M. Wu: ENEE631 Digital Image Processing (Spring'09) Edge Detection and Basics on 2-D Random Signal Spring ’09 Instructor: Min Wu Electrical and Computer.
Introduction to Image Processing Grass Sky Tree ? ? Review.
CS 376b Introduction to Computer Vision 02 / 26 / 2008 Instructor: Michael Eckmann.
Spatial-based Enhancements Lecture 3 prepared by R. Lathrop 10/99 updated 10/03 ERDAS Field Guide 6th Ed. Ch 5: ;
Computer Vision – Enhancement(Part II) Hanyang University Jong-Il Park.
Spatial Filtering: Basics
University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell Image processing.
Linear Filtering – Part I Selim Aksoy Department of Computer Engineering Bilkent University
AdeptSight Image Processing Tools Lee Haney January 21, 2010.
M. Wu: ENEE631 Digital Image Processing (Spring'09) Fourier Transform and Spatial Filtering Spring ’09 Instructor: Min Wu Electrical and Computer Engineering.
Technion, CS department, SIPC Spring 2014 Tutorials 12,13 discrete signals and systems 1/39.
Digital Image Processing CSC331 Image Enhancement 1.
ENG4BF3 Medical Image Processing Image Enhancement in Frequency Domain.
ENEE631 Digital Image Processing (Spring'04) Image Restoration Spring ’04 Instructor: Min Wu ECE Department, Univ. of Maryland, College Park  
Digital Image Processing Chapter 4: Image Enhancement in the Frequency Domain 22 June 2005 Digital Image Processing Chapter 4: Image Enhancement in the.
Digital Image Processing, 3rd ed. © 1992–2008 R. C. Gonzalez & R. E. Woods Gonzalez & Woods Chapter 3 Intensity Transformations.
Image Subtraction Mask mode radiography h(x,y) is the mask.
COMP322/S2000/L171 Robot Vision System Major Phases in Robot Vision Systems: A. Data (image) acquisition –Illumination, i.e. lighting consideration –Lenses,
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities Prof. Charlene Tsai.
ENEE631 Digital Image Processing (Spring'04) Point Operations Spring ’04 Instructor: Min Wu ECE Department, Univ. of Maryland, College Park  
ELE 488 F06 ELE 488 Fall 2006 Image Processing and Transmission Image Restoration distortion noise Inverse Filtering Wiener Filtering Ref: Jain,
ENEE631 Digital Image Processing (Spring'04) Signal Processing: From 1-D to 2-D (m-D) Spring ’04 Instructor: Min Wu ECE Department, Univ. of Maryland,
ENEE631 Digital Image Processing (Spring'04) Basics on 2-D Random Signal Spring ’04 Instructor: Min Wu ECE Department, Univ. of Maryland, College Park.
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.
Image Enhancement (Frequency Domain)
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities May 2, 2005 Prof. Charlene Tsai.
Machine Vision Edge Detection Techniques ENT 273 Lecture 6 Hema C.R.
Image Enhancement by Spatial Domain Filtering
Digital Image Processing CSC331
Sliding Window Filters Longin Jan Latecki October 9, 2002.
Oh-Jin Kwon, EE dept., Sejong Univ., Seoul, Korea: 2.3 Fourier Transform: From Fourier Series to Fourier Transforms.
Digital Signal Processing Lecture 6 Frequency Selective Filters
Computer Vision – 2D Signal & System Hanyang University Jong-Il Park.
Spatial Filtering (Chapter 3) CS474/674 - Prof. Bebis.
Image Enhancement in the Spatial Domain.
Digital Image Processing Lecture 8: Fourier Transform Prof. Charlene Tsai.
Miguel Tavares Coimbra
Edge Detection Phil Mlsna, Ph.D. Dept. of Electrical Engineering Northern Arizona University.
REMOTE SENSING Digital Image Processing Radiometric Enhancement Geometric Enhancement Reference: Chapters 4 and 5, Remote Sensing Digital Image Analysis.
Fundamentals of Spatial Filtering:
CE Digital Signal Processing Fall Discrete-time Fourier Transform
Digital Image Processing CSC331
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities Prof. Charlene Tsai.
Image Pre-Processing in the Spatial and Frequent Domain
ELE 488 Fall 2006 Image Processing and Transmission
Digital Image Processing
Signal Processing: From 1-D to 2-D (m-D)
Lecture 3 (2.5.07) Image Enhancement in Spatial Domain
Tania Stathaki 811b LTI Discrete-Time Systems in Transform Domain Ideal Filters Zero Phase Transfer Functions Linear Phase Transfer.
Image Enhancement in the Spatial Domain
Presentation transcript:

ENEE631 Digital Image Processing (Spring'04) Fourier Transform and Spatial Filtering Spring ’04 Instructor: Min Wu ECE Department, Univ. of Maryland, College Park   (select ENEE631 S’04)   Based on ENEE631 Spring’04 Section 5

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [2] Overview Last Time: –Assignment-1 –Dithering and Halftoning –2-D signals and systems Today –2-D Fourier Transform –Image Enhancement via Spatial Filtering Additional reference on halftoning: –Special Issue on “Digital Halftoning”, IEEE Signal Processing Magazine, July 2003 (five articles) UMCP ENEE631 Slides (created by M.Wu © 2004)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [3] Review of 1-D Fourier Transform UMCP ENEE624 Slides (created by M.Wu © 2003)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [4] 2-D Fourier Transform FT for a 2-D continuous function u Horizontal and vertical spatial frequencies (cycles per degree of viewing angle) –Separability: u 2-D transform can be realized by a succession of 1-D transform along each spatial coordinate –Many other properties can be extended from 1-D FT u convolution in one domain  multiplication in another domain u inner product preservation (Parseval energy conservation theorem) UMCP ENEE408G Slides (created by M.Wu © 2002)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [5] 2-D Fourier Transform FT for a 2-D continuous function u Horizontal and vertical spatial frequencies (cycles per degree of viewing angle) –Separability: u 2-D transform can be realized by a succession of 1-D transform along each spatial coordinate –Many other properties can be extended from 1-D FT u convolution in one domain  multiplication in another domain u inner product preservation (Parseval energy conservation theorem) UMCP ENEE408G Slides (created by M.Wu © 2002)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [6] Freq. Response & Eigen functions for LSI System Eigen function of a system –Defined as an input function that is reproduced at the output with a possible change only in its amplitude Fundamental property of a Linear Shift Invariant System –Its eigen functions are complex exponentials exp[j2  (x  x + y  y )] (recall similar property for 1-D LTI system) Frequency response H(  x,  y ) for a 2-D continuous LSI system is the Fourier Transform of its impulse response u represents the (complex) amplitude of the system response for an complex exponential input at spatial frequency (  x,  y ) exp[j2  (x  x + y  y )] H(  x,  y ) exp[j2  (x  x + y  y )] H UMCP ENEE631 Slides (created by M.Wu © 2004)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [7] Freq. Response & Eigen functions for LSI System Eigen function of a system –Defined as an input function that is reproduced at the output with a possible change only in its amplitude Fundamental property of a Linear Shift Invariant System –Its eigen functions are complex exponentials exp[j2  (x  x + y  y )] (recall similar property for 1-D LTI system) Frequency response H(  x,  y ) for a 2-D continuous LSI system is the Fourier Transform of its impulse response u represents the (complex) amplitude of the system response for an complex exponential input at spatial frequency (  x,  y ) exp[j2  (x  x + y  y )] H(  x,  y ) exp[j2  (x  x + y  y )] H UMCP ENEE631 Slides (created by M.Wu © 2004)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [8] 2-D FT on Discrete/Sampled 2-D Function Note: (1) X(  1,  2 ) is periodic with period 2  in each argument (2) exp{j(m  1 + n  2 )} are eigen functions of 2-D discrete LSI system UMCP ENEE408G Slides (created by M.Wu © 2002)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [9] 2-D FT on Discrete/Sampled 2-D Function Note: (1) X(  1,  2 ) is periodic with period 2  in each argument (2) exp{j(m  1 + n  2 )} are eigen functions of 2-D discrete LSI system UMCP ENEE408G Slides (created by M.Wu © 2002)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [10] 2-D DFT (on Discrete Periodic 2-D Function) –W N = exp{ - j2  / N } complex conjugate of primitive N th root of unity –Separability: realize 2-D DFT by succession of 1-D DFTs –Circular convolution in one domain ~ multiplication in another domain UMCP ENEE408G Slides (created by M.Wu © 2002)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [11] Examples of 2-D DFT Image examples are from Gonzalez-Woods 2/e online slides. UMCP ENEE408G Slides (created by M.Wu © 2002)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [12] Frequency Domain View of Linear Spatial Filtering Image examples are from Gonzalez-Woods 2/e online slides Fig.4.4 & 4.7. UMCP ENEE408G Slides (created by M.Wu © 2002)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [13] Optical and Modulation Transfer Function Optical Transfer Function (OTF) for a LSI imaging system –Defined as its normalized frequency response Modulation Transfer Function (MTF) –Defined as the magnitude of the OTF UMCP ENEE631 Slides (created by M.Wu © 2004)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [14] MTF of the Visual System Direct MTF measurement of Human Visual System (HVS) –Use sinusoidal grating of varying contrast and spatial frequency u The contrast is specified by the ratio of maximum to minimum intensity u Observation of this grating shows the visibility thresholds at various spatial frequencies Typical MTF has band-pass shape –Suggest HVS is most sensitive to mid-freq. and least to high freq. –Some variations with viewer & viewing angle From Jain’s book Figure 3.7 UMCP ENEE631 Slides (created by M.Wu © 2004)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [15] Image Enhancement via Spatial Filtering UMCP ENEE631 Slides (created by M.Wu © 2004)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [16] Spatial Operations with Spatial Mask Spatial mask is 2-D finite impulse response (FIR) filter –Usually has small support 2x2, 3x3, 5x5, 7x7 –Convolve this mask with the image u v(m,n) =  u(m-k, n-l) h(k,l) … mirror w.r.t. origin, then shift & sum up –Frequency domain interpretation u multiplying DFT(image) with DFT(mask) UMCP ENEE631 Slides (created by M.Wu © 2004)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [17] Spatial Averaging Masks For softening, noise smoothing, LPF before subsampling(anti-aliasing), etc. –“isotropic” (i.e. circularly symmetric / rotation invariant) filters: with response independent of directions 1/ / /9 01/8 1/ /8 0 0 UMCP ENEE408G/631 Slides (created by M.Wu & R.Liu © 2002/2004)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [18] Frequency Response of Averaging Mask Recall: averaging mask is a FIR filter with a square support => take FT to get its frequency response: it is a low pass filter Image examples are from Gonzalez-Woods 2/e online slides. UMCP ENEE408G Slides (created by M.Wu © 2002)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [19] Suppressing Noise via Spatial Averaging Image with iid noise y(m,n) = x(m,n) + N(m,n) Averaged version v(m,n) = (1/N w )  x(m-k, n-l) + (1/N w )  N(m-k, n-l) Noise variance reduced by a factor of N w –N w ~ # of pixels in the averaging window SNR improved by a factor of Nw if x(m,n) is constant in local window Window size is limited to avoid blurring UMCP ENEE408G Slides (created by M.Wu & R.Liu © 2002)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [20] Directional Smoothing Problems with simple spatial averaging mask –Edges get blurred Improvement –Restrict smoothing to along edge direction –Avoid filtering across edges Directional smoothing –Compute spatial average along several directions –Take the result from the direction giving the smallest changes before & after filtering Other solutions –Use more explicit edge detection and adapt filtering accordingly  WW UMCP ENEE631 Slides (created by M.Wu © 2001)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [21] Coping with Salt-and-Pepper Noise ( From Matlab Image Toolbox Guide Fig & ) UMCP ENEE408G Slides (created by M.Wu & R.Liu © 2002)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [22] Median Filtering Salt-and-Pepper noise –Isolated white/black pixels spread randomly over the image –Spatial averaging filter may incur blurred output Median filtering –Take median value over a small window as output ~ nonlinear u Median{ x(m) + y(m) }  Median{x(m)} + Median{y(m)} –Odd window size is commonly used u 3x3, 5x5, 7x7 u 5-pixel “ + ”-shaped window –Even-sized window ~ take the average of two middle values as output UMCP ENEE408G Slides (created by M.Wu & R.Liu © 2002)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [23] Image Sharpening Use LPF to generate HPF –Subtract a low pass filtered result from the original signal –HPF extracts edges and transitions Enhance edges I 0  I LP  I HP = I 0 – I LP  I 1 = I 0 + a*I HP UMCP ENEE408G Slides (created by M.Wu & R.Liu © 2002)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [24] Example of Image Sharpening –v(m,n) = u(m,n) + a * g(m,n) –Often use Laplacian operator to obtain g(m,n) –Laplacian operator is a discrete form of 2 nd -order derivatives 0-¼ ¼ 0 0 UMCP ENEE408G Slides (created by M.Wu & R.Liu © 2002)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [25] Example of Image Sharpening Original moon image is from Matlab Image Toolbox. UMCP ENEE408G Slides (created by M.Wu & R.Liu © 2002)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [26] Other Variations of Image Sharpening High boost filter (Gonzalez-Woods 2/e pp132 & pp188) I 0  I LP  I HP = I 0 – I LP  I 1 = (b-1) I 0 + I HP –Equiv. to high pass filtering for b=1 –Amplify or suppress original image pixel values when b  2 Combine sharpening with histogram equalization Image example is from Gonzalez- Woods 2/e online slides. UMCP ENEE408G Slides (created by M.Wu © 2002)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [27] Spatial LPF, HPF, & BPF HPF and BPF can be constructed from LPF Low-pass filter –Useful in noise smoothing and downsampling/upsampling High-pass filter –h HP (m,n) =  (m,n) – h LP (m,n) –Useful in edge extraction and image sharpening Band-pass filter –h BP (m,n) = h L2 (m,n) – h L1 (m,n) –Useful in edge enhancement –Also good for high-pass tasks in the presence of noise u avoid amplifying high-frequency noise UMCP ENEE408G Slides (created by M.Wu & R.Liu © 2002)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [28] Gradient, 1 st -order Derivatives, and Edges Edge: pixel locations of abrupt luminance change For binary image –Take black pixels with immediate white neighbors as edge pixel u Detectable by XOR operations For continuous-tone image –Spatial luminance gradient vector of an edge pixel  edge u a vector consists of partial derivatives along two orthogonal directions u gradient gives the direction with highest rate of luminance changes –How to represent edge? u by intensity + direction => Edge map ~ edge intensity + directions –Detection Method-1: prepare edge examples (templates) of different intensities and directions, then find the best match –Detection Method-2: measure transitions along 2 orthogonal directions UMCP ENEE408G Slides (created by M.Wu & R.Liu © 2002)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [29] Common Gradient Operators for Edge Detection –Move the operators across the image and take the inner products u Magnitude of gradient vector g(m,n) 2 = g x (m,n) 2 + g y (m,n) 2 u Direction of gradient vector tan –1 [ g y (m,n) / g x (m,n) ] –Gradient operator is HPF in nature ~ could amplify noise u Prewitt and Sobel operators compute horizontal and vertical differences of local sum to reduce the effect of noise Roberts H 1 (m,n) H 2 (m,n) PrewittSobel UMCP ENEE408G Slides (created by M.Wu & R.Liu © 2002)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [30] Examples of Edge Detectors –Quantize edge intensity to 0/1: u set a threshold u white pixel denotes strong edge RobertsPrewittSobel UMCP ENEE408G Slides (created by M.Wu & R.Liu © 2002)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [31] Examples of Edge Detectors –Quantize edge intensity to 0/1: u set a threshold u white pixel denotes strong edge RobertsPrewittSobel UMCP ENEE408G Slides (created by M.Wu & R.Liu © 2002)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [32] Edge Detection: Summary Measure gradient vector –Along two orthogonal directions ~ usually horizontal and vertical u g x =  L /  x u g y =  L /  y –Magnitude of gradient vector u g(m,n) 2 = g x (m,n) 2 + g y (m,n) 2 u g(m,n) = |g x (m,n) | + |g y (m,n)| (preferred in hardware implement.) –Direction of gradient vector u tan –1 [ g y (m,n) / g x (m,n) ] Characterizing edges in an image –(binary) Edge map: specify “edge point” locations with g(m,n) > thresh. –Edge intensity map: specify gradient magnitude at each pixel –Edge direction map: specify directions UMCP ENEE408G Slides (created by M.Wu & R.Liu © 2002)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [33] Summary of Today’s Lecture 2-D Fourier Transform Image enhancement via spatial filtering –Filtering with a small FIR filter Next time –Edge detection –2-D random signals and image restoration Readings –Jain’s book Section , 3.3, 7.4 Gonzalez’s book Section , UMCP ENEE631 Slides (created by M.Wu © 2004)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [34]

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [35] Extra: For Future Lectures UMCP ENEE631 Slides (created by M.Wu © 2004)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [36] 2-D Z-Transform The 2-D Z-transform is defined by –The space represented by the complex variable pair (z 1, z 2 ) is 4-D Unit surface –If ROC include unit surface Transfer function of discrete LSI system UMCP ENEE631 Slides (created by M.Wu © 2004)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [37] Example of 2-D ZT and Region of Convergence See Lim’s book UMCP ENEE631 Slides (created by M.Wu © 2004)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [38] Stability Recall for 1-D LTI system –Stability condition in bounded-input bounded-output sense (BIBO) is that the impulse response h[n] is absolutely summable u i.e. ROC of H(z) includes the unit circle –The ROC of H(z) for a causal and stable system should have all poles inside the unit circle 2-D Stable LSI system –Requires the 2-D impulse response is absolutely summable –i.e. ROC of H(z 1, z 2 ) must include the unit surface |z 1 |=1, |z 2 |=1 UMCP ENEE631 Slides (created by M.Wu © 2004)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [39] Stability Recall for 1-D LTI system –Stability condition in bounded-input bounded-output sense (BIBO) is that the impulse response h[n] is absolutely summable u i.e. ROC of H(z) includes the unit circle –The ROC of H(z) for a causal and stable system should have all poles inside the unit circle 2-D Stable LSI system –Requires the 2-D impulse response is absolutely summable –i.e. ROC of H(z 1, z 2 ) must include the unit surface |z 1 |=1, |z 2 |=1 UMCP ENEE631 Slides (created by M.Wu © 2004)

ENEE631 Digital Image Processing (Spring'04) Lec5 – Spatial Filtering [40] Frequency Domain View of LPF / HPF UMCP ENEE631 Slides (created by M.Wu © 2004) Image example is from Gonzalez-Woods 2/e online slides.