Example f(x,y) f p (x,y) f p (x,y)(-1) x+y F(u,v) H(u,v) - centered G(u,v)=F(u,v)H(u,v) g(x,y) g p (x,y)
h(x,y) specified in spatial domain: how to generate H(u,v) from h(x,y)? If h(x,y) is given in the spatial domain (case 2), we can generate H(u,v) as follows: 1.Form h p (x,y) by padding with zeroes. 2. Multiply by (-1) x+y to center its spectrum. 3. Compute its DFT to obtain H(u,v)
Example: h(x,y) is specified in the spatial domain 600 x 600 Sobel Important: need to preserve odd symmetry (i.e., H(u,v) should be imaginary) (read details on page 268)
Results of Filtering in the Spatial and Frequency Domains spatial domain filtering frequency domain filtering
Low-pass (LP) filtering Preserves low frequencies, attenuates high frequencies. ideal in practice D 0 : cut-off frequency
Lowpass (LP) filtering (cont’d) In 2D, the cutoff frequencies lie on a circle.
Specifying a 2D low-pass filter Specify cutoff frequencies by specifying the radius of a circle centered at point (N/2, N/2) in the frequency domain. The radius is chosen by specifying the percentage of total power enclosed by the circle.
Specifying a 2D low-pass filter (cont’d) Typically, most frequencies are concentrated around the center of the spectrum. r=8 (90% power)r=18 (93% power) r=43 (95%)r=78 (99%)r=152 (99.5%) original r: radius
How does D 0 control smoothing? Reminder: multiplication in the frequency domain implies convolution in the time domain * = freq. domain time domain
How does D 0 control smoothing? (cont’d) D 0 controls the amount of blurring r=8 (90%) r=78 (99%)
Ringing Effect Sharp cutoff frequencies produce an overshoot of image features whose frequency is close to the cutoff frequencies (ringing effect). h=f*g
Comparison: BHPF and GHPF GHPF BHPF D 0 =30,60,160 n=2 D 0 =30,60,160
Example: High-pass Filtering and Thresholding for Fingerprint Image Enhancement BHPF (order 4 with a cutoff frequency 50)
Difference of Gaussians: Frequency – Spatial Domains This is a high-pass filter!
Difference of Gaussians: Frequency – Spatial Domains (cont’d) spatial domain frequency domain High-pass filter!
Frequency Domain Analysis of Unsharp Masking and Highboost Filtering Unsharp Masking: Highboost filtering: (alternative definition) Frequency domain: previous definition:
Revisit: Unsharp Masking and Highboost Filtering Highboost Filter
Highboost and High-Frequency-Emphasis Filters 1 1+k k1k1 k 1 +k 2 HighboostHigh-emphasis
High-Frequency Emphasis filtering Using Gaussian filter k 1 =0.5, k 2 =0.75 D 0 =40 Example GHPF High-emphasis and hist. equal.
Homomorphic filtering Many times, we want to remove shading effects from an image (i.e., due to uneven illumination) –Enhance high frequencies –Attenuate low frequencies but preserve fine detail.
Homomorphic Filtering (cont’d) Consider the following model of image formation: In general, the illumination component i(x,y) varies slowly and affects low frequencies mostly. In general, the reflection component r(x,y) varies faster and affects high frequencies mostly. i(x,y): illumination r(x,y): reflection IDEA: separate low frequencies due to i(x,y) from high frequencies due to r(x,y)
How are frequencies mixed together? When applying filtering, it is difficult to handle low/high frequencies separately. Low and high frequencies from i(x,y) and r(x,y) are mixed together.