lec-2 image enhancement in the frequency domain

74
1 Image Enhancement in the Frequency Domain Frequency Domain Filtering

Upload: ravibabukancharla

Post on 21-Jul-2016

34 views

Category:

Documents


1 download

DESCRIPTION

jhhjjj

TRANSCRIPT

Page 1: Lec-2 Image Enhancement in the Frequency Domain

1

Image Enhancement in the Frequency Domain

Frequency Domain Filtering

Page 2: Lec-2 Image Enhancement in the Frequency Domain

Basic steps for filtering in the frequency domain

Page 3: Lec-2 Image Enhancement in the Frequency Domain

Basics of filtering in the frequency domain1. multiply the input image by (-1)x+y to center the

transform to u = M/2 and v = N/2 (if M and N are even numbers, then the shifted coordinates will be integers)

2. compute F(u,v), the DFT of the image from (1)3. multiply F(u,v) by a filter function H(u,v)4. compute the inverse DFT of the result in (3)5. obtain the real part of the result in (4)6. multiply the result in (5) by (-1)x+y to cancel the

multiplication of the input image.

Page 4: Lec-2 Image Enhancement in the Frequency Domain

Images Black and white image is a 2D matrix. Intensities represented as pixels. Color images are 3D matrix, RBG.

Page 5: Lec-2 Image Enhancement in the Frequency Domain

Linear Filtering About modifying pixels based on neighborhood.

Local methods simplest. Linear means linear combination of neighbors.

Linear methods simplest. Useful to:

• Integrate information over constant regions.• Scale.• Detect changes.

Fourier analysis. Many nice slides taken from image database.

Page 6: Lec-2 Image Enhancement in the Frequency Domain
Page 7: Lec-2 Image Enhancement in the Frequency Domain
Page 8: Lec-2 Image Enhancement in the Frequency Domain
Page 9: Lec-2 Image Enhancement in the Frequency Domain
Page 10: Lec-2 Image Enhancement in the Frequency Domain
Page 11: Lec-2 Image Enhancement in the Frequency Domain
Page 12: Lec-2 Image Enhancement in the Frequency Domain
Page 13: Lec-2 Image Enhancement in the Frequency Domain
Page 14: Lec-2 Image Enhancement in the Frequency Domain
Page 15: Lec-2 Image Enhancement in the Frequency Domain
Page 16: Lec-2 Image Enhancement in the Frequency Domain
Page 17: Lec-2 Image Enhancement in the Frequency Domain
Page 18: Lec-2 Image Enhancement in the Frequency Domain
Page 19: Lec-2 Image Enhancement in the Frequency Domain
Page 20: Lec-2 Image Enhancement in the Frequency Domain
Page 21: Lec-2 Image Enhancement in the Frequency Domain
Page 22: Lec-2 Image Enhancement in the Frequency Domain
Page 23: Lec-2 Image Enhancement in the Frequency Domain

Filtering to reduce noise Noise is what we’re not interested in.

• We’ll discuss simple, low-level noise: Light fluctuations; Sensor noise; Quantization effects; Finite precision

• Not complex: shadows; extraneous objects. A pixel’s neighborhood contains

information about its intensity. Averaging noise reduces its effect.

Page 24: Lec-2 Image Enhancement in the Frequency Domain

Additive noise I = S + N. Noise doesn’t depend on

signal. We’ll consider:

ddistributey identicall ,

for t independen , tic.determinis

0)( with

ji

jiji

i

iiii

nn

nnnns

nEnsI

Page 25: Lec-2 Image Enhancement in the Frequency Domain

Average Filter• Mask with positive

entries, that sum 1.• Replaces each pixel

with an average of its neighborhood.

• If all weights are equal, it is called a BOX filter.

111111

1111 11

1111

11

FF

1/91/9

Page 26: Lec-2 Image Enhancement in the Frequency Domain

Does it reduce noise?

• Intuitively, takes out small variations.

),0(~),(ˆ1)),(ˆ(

0)),(ˆ(

),(1),(ˆm1

),(),(ˆm1 j)O(i,

)N(0,~j)N(i, with ),(),(ˆ),(

22

22

2/

2/

2/

2/

),(ˆ

2/

2/

2/

2/

2/

2/

2/

2/

mNjiN

mm

mjiNE

jiNE

kjhiNm

kjhiI

kjhiNkjhiI

jiNjiIjiI

m

mh

m

mk

jiN

m

mh

m

mk

m

mh

m

mk

2

2 2

Page 27: Lec-2 Image Enhancement in the Frequency Domain

Example: Smoothing by Averaging

Page 28: Lec-2 Image Enhancement in the Frequency Domain

Smoothing as Inference About the Signal

+ =

Nearby points tell more about the signal than distant ones.

Neighborhood for averaging.

Page 29: Lec-2 Image Enhancement in the Frequency Domain

Gaussian Averaging Rotationally

symmetric. Weights nearby

pixels more than distant ones.• This makes sense

as probabalistic inference. A Gaussian gives a

good model of a fuzzy blob

Page 30: Lec-2 Image Enhancement in the Frequency Domain

exp x2 y2

22

An Isotropic Gaussian The picture shows a

smoothing kernel proportional to

(which is a reasonable model of a circularly symmetric fuzzy blob)

Page 31: Lec-2 Image Enhancement in the Frequency Domain

Smoothing with a Gaussian

Page 32: Lec-2 Image Enhancement in the Frequency Domain

The effects of smoothing Each row shows smoothingwith gaussians of differentwidth; each column showsdifferent realizations of an image of gaussian noise.

Page 33: Lec-2 Image Enhancement in the Frequency Domain

Efficient Implementation

Both, the BOX filter and the Gaussian filter are separable:• First convolve each row with a 1D filter• Then convolve each column with a 1D filter.

Page 34: Lec-2 Image Enhancement in the Frequency Domain

Smoothing as Inference About the Signal: Non-linear Filters.

+ =

What’s the best neighborhood for inference?

Page 35: Lec-2 Image Enhancement in the Frequency Domain

Filtering to reduce noise: Lessons Noise reduction is probabilistic inference. Depends on knowledge of signal and

noise. In practice, simplicity and efficiency

important.

Page 36: Lec-2 Image Enhancement in the Frequency Domain

Filtering and Signal Smoothing also smooths signal. Removes detail This is good and bad: - Bad: can’t remove noise w/out blurring

shape. - Good: captures large scale structure

Page 37: Lec-2 Image Enhancement in the Frequency Domain

Notch filter

otherwise 1

N/2 (M/2, v)(u, if 0),(

) vuH

• this filter is to force the F(0,0) which is the average value of an image (dc component of the spectrum)• the output has prominent edges• in reality the average of the displayed image can’t be zero as it needs to have negative gray levels. the output image needs to scale the gray level

Page 38: Lec-2 Image Enhancement in the Frequency Domain

Low pass filter

high pass filter

Page 39: Lec-2 Image Enhancement in the Frequency Domain

Add the ½ of filter height to F(0,0) of the high pass filter

Page 40: Lec-2 Image Enhancement in the Frequency Domain

Correspondence between filter in spatial and frequency domains

Page 41: Lec-2 Image Enhancement in the Frequency Domain

Convolution

Convolution kernel g, represented as matrix.• it’s associative

Result is:

Page 42: Lec-2 Image Enhancement in the Frequency Domain
Page 43: Lec-2 Image Enhancement in the Frequency Domain
Page 44: Lec-2 Image Enhancement in the Frequency Domain
Page 45: Lec-2 Image Enhancement in the Frequency Domain
Page 46: Lec-2 Image Enhancement in the Frequency Domain
Page 47: Lec-2 Image Enhancement in the Frequency Domain

Smoothing Frequency-domain filters: Ideal Lowpass filter

Page 48: Lec-2 Image Enhancement in the Frequency Domain

image power circles

Page 49: Lec-2 Image Enhancement in the Frequency Domain

Result of ILPF

Page 50: Lec-2 Image Enhancement in the Frequency Domain

Example

Page 51: Lec-2 Image Enhancement in the Frequency Domain

Butterworth Lowpass Filter: BLPF

Page 52: Lec-2 Image Enhancement in the Frequency Domain

Example

Page 53: Lec-2 Image Enhancement in the Frequency Domain

Spatial representation of BLPFs

Page 54: Lec-2 Image Enhancement in the Frequency Domain

Gaussian Lowpass Filter: GLPF

Page 55: Lec-2 Image Enhancement in the Frequency Domain

Example

Page 56: Lec-2 Image Enhancement in the Frequency Domain

Example

Page 57: Lec-2 Image Enhancement in the Frequency Domain

Example

Page 58: Lec-2 Image Enhancement in the Frequency Domain

Example

Page 59: Lec-2 Image Enhancement in the Frequency Domain

Sharpening Frequency Domain Filter: Ideal highpass filter

Butterworth highpass filter

Gaussian highpass filter

0

0

Dv)D(u, if 1Dv)D(u, if 0

),( vuH

nvuDvuH 2

0 ),(D11),(

20

2 2/),(1),( DvuDevuH

Page 60: Lec-2 Image Enhancement in the Frequency Domain

Spatial representation of Ideal, Butterworth and Gaussian highpass filters

Page 61: Lec-2 Image Enhancement in the Frequency Domain

Example: result of IHPF

Page 62: Lec-2 Image Enhancement in the Frequency Domain

Example: result of BHPF

Page 63: Lec-2 Image Enhancement in the Frequency Domain

Example: result of GHPF

Page 64: Lec-2 Image Enhancement in the Frequency Domain

Laplacian in the Frequency domain

Page 65: Lec-2 Image Enhancement in the Frequency Domain

Example: Laplacian filtered image

Page 66: Lec-2 Image Enhancement in the Frequency Domain

Example: high-boost filter

Page 67: Lec-2 Image Enhancement in the Frequency Domain

Examples

Page 68: Lec-2 Image Enhancement in the Frequency Domain

2-D Fourier Transform Properties

Page 69: Lec-2 Image Enhancement in the Frequency Domain
Page 70: Lec-2 Image Enhancement in the Frequency Domain
Page 71: Lec-2 Image Enhancement in the Frequency Domain
Page 72: Lec-2 Image Enhancement in the Frequency Domain
Page 73: Lec-2 Image Enhancement in the Frequency Domain
Page 74: Lec-2 Image Enhancement in the Frequency Domain