frequency filtering

59
Frequency Domain Filtering (Chapter 4) CS474/674 - Prof. Bebis

Upload: mohammed-al-maaitah

Post on 25-Nov-2015

39 views

Category:

Documents


5 download

DESCRIPTION

signal

TRANSCRIPT

  • Frequency Domain Filtering (Chapter 4)CS474/674 - Prof. Bebis

  • Frequency Domain MethodsSpatial DomainFrequency Domain

  • Major filter categoriesTypically, filters are classified by examining their properties in the frequency domain:(1) Low-pass (2) High-pass (3) Band-pass (4) Band-stop

  • ExampleOriginal signalLow-pass filteredHigh-pass filteredBand-pass filteredBand-stop filtered

  • Low-pass filters(i.e., smoothing filters)Preserve low frequencies - useful for noise suppression

  • High-pass filters(i.e., sharpening filters)Preserves high frequencies - useful for edge detection

  • Band-pass filtersPreserves frequencies within a certain band

  • Band-stop filtersHow do they look like?Band-pass Band-stop

  • Frequency Domain MethodsCase 1: h(x,y) is given inthe spatial domain.

    Case 2: H(u,v) is given inthe frequency domain.

  • Frequency Domain Methods (contd) F(u,v) = R(u,v) + jI(u,v)

    F(u,v)H(u,v) = R(u,v)H(u,v) + jI(u,v) H(u,v)

  • StepsH(u,v) might be specified in the frequency domain or in the spatial domain (i.e., h(x,y))

  • How to generate H(u,v) from h(x,y)?If h(x,y) is given in the spatial domain, here is how to generate H(u,v):

    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)

  • How to generate h(x,y) from H(u,v)?We know that G(u,v) = F(u,v) H(u,v)

    - Use f(x,y)=(x,y) (i.e., impulse)

    - In this case, G(u,v)= 1 x H(u,v) = H(u,v) (i.e., transfer function)

    - Take IFT of G(u,v) to find h(x,y) (i.e., impulse response)

  • Steps (contd)

  • Steps (contd)

  • Example

  • Assume filter H(u,v) that is 0 at the center of the transform and 1 elsewhere; whats the output image?Examplezero average intensity

  • Example: Low-pass and band-reject

  • Zero-Phase-Shift Filters

    Filters affect the real and imaginary parts equally.H(u,v) cancels out when taking the ratio of imaginary and real parts,

  • Example: Nonzero-Phase-Shift FiltersEven small changes in the phase angle can have dramatic (usually undesirable) effects on the filtered outputPhase angle is multiplied by 0.5Phase angle is multiplied by 0.25

  • Low-pass (LP) filteringPreserves low frequencies, attenuates high frequencies.idealin practiceD0: cut-off frequency

  • Lowpass (LP) filtering (contd)In 2D, the cutoff frequencies lie on a circle.

  • Specifying a 2D low-pass filterSpecify cutoff frequencies by specifying the radius of a circle centered at point (u-N/2, v-N/2) in the frequency domain.The radius is chosen by specifying the total power enclosed by the circle.

  • Specifying a 2D low-pass filter (contd)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%)originalr: radius

  • How does D0 control smoothing?Reminder: multiplication in the frequency domain implies convolution in the time domain*=freq. domaintime domain

  • How does D0 control smoothing? (contd)Blurring is controlled by D0r=8 (90%)r=78 (99%)

  • Ringing EffectSharp cutoff frequencies produce an overshoot of image features whose frequency is close to the cutoff frequencies (ringing effect).

    h=f*g

  • Butterworth LP filter (BLPF)In practice, we use filters that attenuate high frequencies smoothly (e.g., Butterworth LP filter) less ringing effect

    n=1n=4n=16

  • Spatial Representation of BLPFsn=1 n=2 n=5 n=20

  • Comparison: Ideal LP and BLPFIdealButterworthD0=10, 30,60, 160,460n=2

  • Gaussian LP filter (GLPF)

  • Gaussian: Frequency Spatial Domains

    frequencydomainspatialdomain

  • Difference of Gaussians: Frequency Spatial Domains

  • Difference of Gaussians: Frequency Spatial Domains (contd)

    High-pass filter!spatialdomainfrequencydomain

  • Filtering in the Spatial and Frequency Domains: Example

    600 x 600SobelImportant to preserveodd symmetry (i.e., H(u,v)should be imaginary!)

    (read details on page268)

  • Filtering in the Spatial and Frequency Domains: Example (contd)

    spatial domain filteringfrequency domain filteringResults

  • Example: smoothing by GLPF (1)

  • **Examples of smoothing by GLPF (2)D0=100D0=80

  • High-Pass filtering A high-pass filter can be obtained from a low-pass filter using:

  • High-pass filtering (contd)Preserves high frequencies, attenuates low frequencies.

  • Butterworth high pass filter (BHPF)In practice, we use filters that attenuate low frequencies smoothly (e.g., Butterworth HP filter) less ringing effect

  • Spatial Representation of High-pass Filters

  • Comparison: Ideal HP and BHPFIdealButterworthD0=30,60,100n=2

  • Gaussian HP filterGaussianButterworth

  • Comparison: BHPF and GHPFGaussianButterworthD0=30,60,100n=2

  • Example: High-pass Filtering and Thresholding for Fingerprint Image EnhancementBHPF (order 4 with a cutoff frequency 50)

  • Frequency Domain Analysis of Unsharp Masking and Highboost FilteringUnsharp Masking: Highboost filtering:(variation)Use frequencydomain :

  • Revisit: Unsharp Masking and Highboost FilteringHighboost Filter

  • Highboost and High-Frequency-Emphasis FiltersHighboostHigh-emphasis

  • High-FrequencyEmphasis filteringUsing Gaussian filterk1=0.5, k2=0.75Gaussian Filter: D0=40ExampleGHPFHigh-emphasisHigh-emphasisand hist. equal.

  • Homomorphic filteringMany 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.

  • Homomorphic Filtering (contd)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)

  • How are frequencies mixed together?Difficult to handle low/high frequencies separately. Low and high frequencies from i(x,y) and r(x,y) are mixed together.

  • Can we separate them?Idea:Take the ln( ) of

  • Steps of Homomorphic Filtering

    (1) Take

    (2) Apply FT: or

    (3) Apply H(u,v)

  • Steps of Homomorphic Filtering (contd)(4) Take Inverse FT:

    or

    (5) Take exp( ) or

  • Example: use high-frequency emphasisAttenuate the contribution made by illumination and amplify the contribution made by reflectanceAttenuate the contribution made by illumination and amplify the contribution made by reflectance

  • Homomorphic Filtering: Example

  • Homomorphic Filtering: Example

    **************************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.*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.********