13h(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:Form hp(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)13
14Example: h(x,y) is specified in the spatial domain Important: need to preserveodd symmetry (i.e., H(u,v)should be imaginary)(read details on page 268)In this example, we start with a spatial mask and show how to generate its corresponding filter in the frequency domain. Then, we compare the filtering results obtained using frequency domain and spatial techniques. We use the 3x3 Sobel vertical edge detector. The left one is a 600x600 pixel image, and its spectrum is shown on the right.Sobel14
15Results of Filtering in the Spatial and Frequency Domains spatial domainfilteringfrequency domainfilteringIn this example, we start with a spatial mask and show how to generate its corresponding filter in the frequency domain. Then, we compare the filtering results obtained using frequency domain and spatial techniques. We use the 3x3 Sobel vertical edge detector. The left one is a 600x600 pixel image, and its spectrum is shown on the right.15
16Low-pass (LP) filtering Preserves low frequencies, attenuates high frequencies.idealin practiceD0: cut-off frequency
17Lowpass (LP) filtering (cont’d) In 2D, the cutoff frequencies lie on a circle.
18Specifying 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.
19Specifying 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)originalr: radiusr=43 (95%)r=78 (99%)r=152 (99.5%)
20How does D0 control smoothing? Reminder: multiplication in the frequency domain implies convolution in the time domaintime domainfreq. domain*=
21How does D0 control smoothing? (cont’d) D0 controls the amount of blurringr=78 (99%)r=8 (90%)
22Ringing EffectSharp cutoff frequencies produce an overshoot of image features whose frequency is close to the cutoff frequencies (ringing effect).h=f*g
46Homomorphic filtering Many times, we want to remove shading effects from an image (i.e., due to uneven illumination)Enhance high frequenciesAttenuate low frequencies but preserve fine detail.
47Homomorphic 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): illuminationr(x,y): reflectionIDEA: separate low frequencies due to i(x,y)from high frequencies due to r(x,y)
48How are frequencies mixed together? Low and high frequencies from i(x,y) and r(x,y)are mixed together.When applying filtering, it is difficult to handlelow/high frequencies separately.
50Steps of Homomorphic Filtering (1) Take(2) Apply FT:or(3) Apply H(u,v)
51Steps of Homomorphic Filtering (cont’d) (4) Take Inverse FT:or(5) Take exp( ) or
52Example using high-frequency emphasis Attenuate the contribution made by illumination and amplify the contribution made by reflectanceAttenuate the contribution made by illumination and amplify the contribution made by reflectance