digital image processing lectures 21 & 22image enhancement transform domain operations root...

20
Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration Digital Image Processing Lectures 21 & 22 M.R. Azimi, Professor Department of Electrical and Computer Engineering Colorado State University M.R. Azimi Digital Image Processing

Upload: others

Post on 16-Oct-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Digital Image Processing Lectures 21 & 22Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration Then, inverse unitary transformation gives

Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration

Digital Image ProcessingLectures 21 & 22

M.R. Azimi, Professor

Department of Electrical and Computer EngineeringColorado State University

M.R. Azimi Digital Image Processing

Page 2: Digital Image Processing Lectures 21 & 22Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration Then, inverse unitary transformation gives

Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration

Transform Domain OperationsIdea is to map an image, using a unitary transform, to the feature domainwhere the desired features are more localized. The filtering is then carriedout in the transform domain using a “zonal filter”. The inverse unitarymapping then converts the result back to the spatial domain (see Fig. 1).The transform domain operation provides better insight about thefeatures that need to be removed or enhanced in the image.

Figure 1: Block Diagram of Transform Domain Operation.

The filtering is performed on the transformed image using algebraicoperations i.e.

Y (k, l) = H(k, l)X(k, l)

where X(k, l) = Ax(m,n) and Y (k, l) = Ay(m,n) are the 2-Dunitary transforms of the original and the filtered images, x(m,n) andy(m,n), respectively, H(k, l) = Ah(m,n) is the response of the 2-Dzonal filter, i.e. the unitary transform of the impulse response, h(m,n),and A. is the unitary mapping.

M.R. Azimi Digital Image Processing

Page 3: Digital Image Processing Lectures 21 & 22Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration Then, inverse unitary transformation gives

Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration

Then, inverse unitary transformation gives

y(m,n) = A−1Y (k, l)

The simplest filter that can be constructed is an ideal 2–D filter.

HI(Ω1,Ω2) =

1, D(Ω1,Ω2) ≤ D0

0, otherwise

where D0 is the cut-off frequency. For circularly symmetric ideal filters,

D(Ω1,Ω2) =√

(Ω21 + Ω2

2). The choice of D0 presents a trade-off

between noise removal ability and the blurring artifacts. Fig. 2 (a) shows

the sampled frequency response of an ideal 2–D LPF, i.e.

HI(k, l) = HI(Ω1,Ω2)|Ω1= 2πkN1

,Ω2= 2πlN2

. Taking the IDFT of HI(k, l)’s of

size N1 ×N2 yields the impulse response (Fig. 2(b)) or the filter

coefficients, hI(m,n) = IDFTHI(k, l)’s, for the corresponding 2–D

FIR filter of order N1 ×N2 (frequency sampling approach for the design

of 2–D FIR filters).

M.R. Azimi Digital Image Processing

Page 4: Digital Image Processing Lectures 21 & 22Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration Then, inverse unitary transformation gives

Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration

Figure 2: Sampled Frequency Response and Impulse Response Contour.

Bandwidth D0 can be chosen by specifying % energy, β, retained in thefiltered image wrt total energy, i.e.

β = [(∑∑k,l∈S0

E(k, l))/(

N−1∑k=0

N−1∑k=0

E(k, l))]× 100%

E(k, l) = |X(k, l)|2 and S0 is the set of (k, l) values within the passbandregion (N1 = N2 = N).

Figs. 3 (a)-(f) show the filtered Peppers images and the corresponding

DFTs for increasing values of D0 namely 20%, 50% and 70% of the total

radius (i.e. N).

M.R. Azimi Digital Image Processing

Page 5: Digital Image Processing Lectures 21 & 22Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration Then, inverse unitary transformation gives

Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration

For D0 = 0.2 more than 99% of the energy is retained while the filteredimage still exhibits some blurring (loss of high frequency components) AsD0 increases blurring reduces but the ringing artifacts due to sharp cutoffare still there. As D0 increases the number of rings in a given regionincreases, while producing more finely spaced rings. Note that 100%

energy is obtained when D0 =√

22 N .

D0 = 20% β = 99.12%

M.R. Azimi Digital Image Processing

Page 6: Digital Image Processing Lectures 21 & 22Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration Then, inverse unitary transformation gives

Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration

D0 = 50% β = 99.73%

D0 = 70% β = 99.84%Figure 3: Filtered Images and Magnitude Spectra.

M.R. Azimi Digital Image Processing

Page 7: Digital Image Processing Lectures 21 & 22Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration Then, inverse unitary transformation gives

Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration

Ringing effects can be circumvented by designing filters that exhibitsmooth transition region using the windowing method for FIR filterdesign. Figs. 4(a) and (b) show the 2-D frequency response of a filterand the contour plot of its impulse response designed by windowing theimpulse response of the ideal filter for D0 = 0.2 using a Hammingwindow. The filter possesses a smooth cut-off characteristic as desired.Figs. 4(c) and (d) show the resultant filtered Peppers image and itsDFT, respectively. Although the blurring effect is still noticeable, noringing is evident in the processed image.

Figure 4: Frequency Response & Impulse Response of the Designed Filter.

M.R. Azimi Digital Image Processing

Page 8: Digital Image Processing Lectures 21 & 22Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration Then, inverse unitary transformation gives

Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration

Figure 5: Non-ideal Filter Result & DFT.

Remarks:

1 To avoid circular convolution results implement the zero-paddingprocedure (see Lecture 10) prior to taking DFT and transformdomain filtering.

2 Other non-ideal filters that can be used to reduce the ringingartifacts are 2D Butterworth and trapezoidal filters.

M.R. Azimi Digital Image Processing

Page 9: Digital Image Processing Lectures 21 & 22Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration Then, inverse unitary transformation gives

Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration

For Low-pass Butterworth filter transfer function is:

H(Ω1,Ω2) =1

1 + (√

2− 1)[D(Ω1,Ω2)/D0]2n

where n is the order of the filter that determines the sharpness of theresponse. At D(Ω1,Ω2) = D0 we have H(Ω1,Ω2) = 1/

√2 i.e. the

cut-off point.For low-pass trapezoidal filter, we have

H(Ω1,Ω2) =

1 D(Ω1,Ω2) ≤ D0

1(D0−D1) [D(Ω1,Ω2)−D1], D0 ≤ D ≤ D1

0 otherwise

Example 1:Consider the problem of approximating an ideal LPF with frequencyresponse

HI(Ω1,Ω2) =

1, |Ω1| < a < π, |Ω2| < b < π0, otherwise

by a desired filter whose impulse response is

M.R. Azimi Digital Image Processing

Page 10: Digital Image Processing Lectures 21 & 22Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration Then, inverse unitary transformation gives

Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration

hD(m,n) =

A, m = n = 0B, m = ±1, n = 0C, m = 0, n = ±1

0, otherwise

What values of unknown A,B, and C will minimize the design objectivefunction

ε =1

4π2

∫ π

−π

∫ π

−π|HI(Ω1,Ω2)−HD(Ω1,Ω2)|2dΩ1dΩ2

Proof:From the definition of hD(m,n)

hD(m,n) = Aδ(m,n)+B(δ(m−1, n)+δ(m+1, n))+C(δ(m,n−1)+δ(m,n+1))

which givesHD(m,n) = A+ 2B cos Ω1 + 2C cos Ω2

Now, taking partial derivatives wrt A,B and C and using the fact that

area under cos is zero within [−π, π] gives

M.R. Azimi Digital Image Processing

Page 11: Digital Image Processing Lectures 21 & 22Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration Then, inverse unitary transformation gives

Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration

∂ε

∂A= 0 =⇒ A =

∫ a−a∫ b−b dΩ1dΩ2∫ π

−π∫ π−π dΩ1dΩ2

=ab

π2

∂ε

∂B= 0 =⇒ B =

∫ a−a∫ b−b cos Ω1dΩ1dΩ2

2∫ π−π∫ π−π cos2 Ω1dΩ1dΩ2

=b sin a

π2

∂ε

∂C= 0 =⇒ C =

∫ a−a∫ b−b cos Ω2dΩ1dΩ2

2∫ π−π∫ π−π cos2 Ω2dΩ1dΩ2

=a sin b

π2

Remark:This method is referred to as the method of Least Squares for optimalFIR filter design.

2-D Matched Filtering in Transform DomainMatched filtering can be carried in the transform domain using 2-D DFT,i.e.

Cx,t(k, l) = X(k, l)T ∗(k, l)

where Cx,t(k, l) (cross-power spectrum) and T (k, l) are 2-D DFTs ofcx,t(p, q) and t(p, q), respectively and ∗ stands for complex conjugateoperation.

M.R. Azimi Digital Image Processing

Page 12: Digital Image Processing Lectures 21 & 22Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration Then, inverse unitary transformation gives

Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration

Root Filtering & Cepstral Domain Processing

Idea behind root filtering and Cepstral (juxtaposition of first four lettersof the word Spectral) is to apply a nonlinear mapping to the magnitudespectrum in order to redistribute the energy of image in the transformdomain while the phase is unchanged. Several types of nonlinear mappingfunctions can be employed for different tasks. In root filtering themagnitude component is raised to a power α < 1 while the phasecomponent is retained (see Fig. 6) i.e.

Y (k, l) = |X(k, l)|α exp(jθ(k, l)), 0 ≤ α ≤ 1

This operation tends to deemphasize those frequency components withlarge magnitude while boosting the magnitude of those that have smallercontribution.

Figures 6: Root Filtering Operation

M.R. Azimi Digital Image Processing

Page 13: Digital Image Processing Lectures 21 & 22Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration Then, inverse unitary transformation gives

Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration

Thus, high frequency components corresponding to edges and texturalfeatures that generally have small magnitudes will be emphasized incomparison with those of the lower frequencies. This will yield an imagewith enhanced edges and hence better visual appearance.

Another useful nonlinear transformation consists of taking the log of themagnitude function while keeping the phase the same, i.e.

S(k, l) = [log |X(k, l)|] exp(jθ(k, l))

Figures 7: Inverse Cepstral Mapping.

Now, the inverse transform of S(k, l), denoted by c(m,n) is called the

generalized Cepstrum or generalized Homomorphic transform of x(m,n)

(see Fig. 7 for inverse mapping). This operation tends to reduce the

dynamic range of components in the Cepstral domain and hence increases

the dynamic range of pixels in the image domain upon reconstruction.

M.R. Azimi Digital Image Processing

Page 14: Digital Image Processing Lectures 21 & 22Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration Then, inverse unitary transformation gives

Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration

Consequently, this operation provides certain amount of high frequencyenhancement since natural images tend to have large magnitudes at lowspatial frequencies. Several types of operations (e.g., point operation)can be performed in the Cepstral domain (see next section). If the entireCepstral transform is denoted by H, the block diagram in Fig. 8 shows atypical Cepstral domain operation.

Figures 8: Cepstral Domain Operation.

To prevent log operation to become negative infinity at spatialfrequencies where X(k, l) = 0, we useS(k, l) = [log(a+ b|X(k, l)|)] exp(jθ(k, l)) where a and b control theshape of the log function.

Contrast Enhancement with Homomorphic FiltersUnlike histogram manipulation methods, contrast enhancement using thismethod can be done without loss of any grey level resolution. Fig. 9(a)shows the result of applying contrast enhancement (linear mapping) inthe Cepstral domain to the Dollar image.

M.R. Azimi Digital Image Processing

Page 15: Digital Image Processing Lectures 21 & 22Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration Then, inverse unitary transformation gives

Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration

The histogram of the enhanced image is shown in Fig. 9(b). As can beobserved, contrast enhancement is achieved without losing grey levelresolution at all.

Figure 9: Enhanced dollar image & its histogram.

M.R. Azimi Digital Image Processing

Page 16: Digital Image Processing Lectures 21 & 22Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration Then, inverse unitary transformation gives

Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration

Area 3: Image RestorationAny image acquired by different types of imaging sensors is subject tonoise and other degradations caused by stochastic and/or deterministicsources as:

1 Sensor/channel noise (additive)

2 Multiplicative noise (e.g., speckle in coherent imaging systems)

3 Clutter (correlated noise), e.g., in radar and sonar,

4 Blurring phenomenon (deterministic) caused by:

(a) Motion between camera and object,(b) De-focusing,(c) Atmospheric turbulence as a result of changes in the refractive indexof media in satellite imaging,(d) Finite aperture size in radar or sonar.

Image restoration can be viewed as an inverse process where the effects

of degradations are removed as much as possible using certain a priori

knowledge of the degradation processes.

M.R. Azimi Digital Image Processing

Page 17: Digital Image Processing Lectures 21 & 22Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration Then, inverse unitary transformation gives

Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration

Goal:

Design a restoration filter to recover or estimate the original image fromthe degraded image taking into account the properties of the degradationphenomena.

Figure 10: Image restoration operation.

A typical image formation system consisting of additive noise and blur isshown in Fig. 11. The noisy observed image is given by

y(u, v) = x(u, v) ∗ ∗h(u, v) + η(u, v)

where η(u, v) represents additive noise image and h(u, v) is the PSF ofthe blur, which is assumed to be linear space invariant (LSI).

Figure 11: A simple image formation system.

M.R. Azimi Digital Image Processing

Page 18: Digital Image Processing Lectures 21 & 22Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration Then, inverse unitary transformation gives

Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration

Some examples of LSI blur and corresponding PSF and frequencyresponse are given in the following table.

Type h(u, v) H(ω1, ω2)Horizontal Motion

Blur 1α0

rect[ uα0

− 12]δ(v) α0e

−j ω1α02 sinc

(ω1α2π

)Atmospheric

Turbulence e−πα2(u2+v2) 1

α2 e(−ω

21+ω2

24πα2 )

Rectangular

Scanning Aperture rect[uα, vβ

]αβsinc

(αω12π

)sinc

(βω22π

)CCD local

interactions ∑ 1∑k,l=−1

αk,lδ(u−k∆,v−l∆)∑ 1∑k,l=−1

αk,le−j(ω1k+ω2l)∆

Diffraction-limited

(coherent) absinc(au)sinc(bv) rect[ ω12πa

, ω22πb

]

Diffraction-limited

(incoherent) sinc2(au)sinc2(bv) tri[ ω12πa

, ω22πb

]

M.R. Azimi Digital Image Processing

Page 19: Digital Image Processing Lectures 21 & 22Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration Then, inverse unitary transformation gives

Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration

Clearly, these are obtained based upon certain physical characteristicsabout the blurring phenomenon. The following is an example thatillustrates how physical properties can be used to yield the PSF.

Example: An object x(u, v) being imaged moves uniformly alongu-direction at velocity g. If the exposure time is T , find h(u, v).The image intensity at time t is

xt(u, v) = x(u− g t, v)

Observed image over T seconds is

y(u, v) =1

T

∫ T

0

x(u− g t, v)dt

Let g t = α and let g T = α0 then d t = dαg and thus

y(u, v) =1

α0

∫ α0

0

x(u− α, v)dα

M.R. Azimi Digital Image Processing

Page 20: Digital Image Processing Lectures 21 & 22Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration Then, inverse unitary transformation gives

Image Enhancement Transform Domain Operations Root & Cepstral Domain Filtering Image Restoration

or

y(u, v) =1

α0

∫ ∫ ∞−∞

rect

α0− 1

2

]δ(β)x(u− α, v − β)dαdβ

Now comparing with

y(u, v) =

∫ ∫h(α, β)x(u− α, v − β)dαdβ

gives

h(u, v) =1

α0rect(

u

α0− 1

2)δ(v)

i.e. the result in the table.

M.R. Azimi Digital Image Processing