40
Module IV (13 hours) Image restoration - image obs er va tion models - inverse fil ter ing - wien er f ilt ering Image compression - pixel coding - predictive coding - trans form coding - basic ideas

Ip Image Restoration

Embed Size (px)

Citation preview

Page 1: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 1/40

Module IV (13 hours)

Image restoration - image observation

models - inverse filtering - wiener filteringImage compression - pixel coding -predictive coding - transform coding -basic ideas

Page 2: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 2/40

IMAGE RESTORATION     The process of recovering an image which has beendegraded by using a prior knowledge of degradation

phenomenon.     Degradation comes in many forms such as motion blur or 

camera misfocus     Image degradation model is important in image

restoration.     We have to find what is the image degradation model and

once it is found then we can apply inverse process torecover the image.

     in image enhancement we donot use any degradationmodel

Page 3: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 3/40

What is degradation model?

Degradation function H    filters

Noise termn(x,y)

f(x,y)

g(x,y) f^ (x,y)

Page 4: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 4/40

     f(x,y) is a 2 D function and degraded bydegradation function H

     g(x,y) is the degraded image     From g(x,y) we have to get f(x,y) using

some image restoration function     So for recovering f(x,y) , perform filtering

operation and this filter is derived usingdegradation function H and o/p of filter isf^(x,y)

Page 5: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 5/40

     Reconstruced image is f^(x,y) bcozrestoring of original image is difficult in

many cases     Using goodness criteria we can getapproximate image of original

     

Blocks from f(x,y) to g(x,y) -----process of degradation     From Block of filter is restoration process

Page 6: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 6/40

Important task in restoration is to estimatethe degradadtion model which has

degraded the original image There are various techniques to estimatethe degradation function

Page 7: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 7/40

Conversion from f(x,y) to g(x,y)

In spatial domaing(x,y) = h(x,y)*f(x,y) + (x,y)

In frequency domainG(u,v)= H(u,v)F(u,v) + N(u,v)

G(u,v) FT of g(x,y)

H(u,v) FT of h(x,y)N(u,v) FT of (x,y)

Page 8: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 8/40

Convolution in spatial domain ismultiplication in frequency domain.

Before we proceed we will look into somedefinitions used in image restorationg(x,y) = H[f(x,y)] + (x,y)

H ---- degradation operator 

Page 9: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 9/40

     What is linearity?H is linear operator.If f 1(x,y) & f 2(x,y) are 2 functions

We say H(k1f 1(x,y) +k2f 2(x,y)) =k1 H(f 1(x,y)) + k2 H (f 2(x,y))If this relation is true then H is a linear 

operator      If k1,k2=1 then the above equation leads

H(f 1(x,y) +f 2(x,y)) = H (f 1(x,y)) + H (f 2(x,y))

This is called additive property

Page 10: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 10/40

     If f2(x,y) =0

Then the above equation becomesH(k1f 1(x,y)) =k1 H (f 1(x,y))This property is homogenety property

These are properties of linear system &system is called position invariant if itsatisfies the following property

     If an operator is having the input-outputrelationship g(x,y)=H(f(x,y)) and it is saidto be position invariant if 

Page 11: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 11/40

H(f(x-,y-)) = g(x-,y-)     This says that the response at any point in

the image will depend only on the value of the input at that point not on its position .     What is degradation model incase of 

continuous function?     We will make use of the old mathematicfn.

Page 12: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 12/40

(x,y) = 1 x=0 & y=0

0 otherwise

We use shifted version as(x-x0,y-y0) = 1 if x=x0

0 otherwiseIf we have image f(x,y)

-f(x,y) (x-x0,y-y0) dxdy = f(x0,y0)this says that if I multiply a 2D function with delta

function and integrate the product, the result is f (x,y)at position (x0,y0) , so slightly modify the expression

Page 13: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 13/40

-f(,) (x-,y-) dd = f(x,y)So we get equivalent expression f(x,y) in terms

of &For time being consider noise term =0Therefore

g(x,y) = H[f(x,y)]

= H[ -f(,) (x-,y-) dd]

Page 14: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 14/40

Now apply linearity & additive property onthis we get

g(x,y)== -

H[f(,) (x-,y-) dd] As f(,) are independent variables of x andy

Therefore same expression can berewritten asg(x,y)== -f(,) H[ (x-,y-) ] dd

Page 15: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 15/40

     H[ (x-,y-) ] can be written as h(x,,y,)& this is known as the impulse response of H

     Using this impulse response g(x,y) can bewritten asg(x,y)== -f(,) h(x,,y,)] dd

this says that response of H is known,response to any input f(,) can becalculated using the above equation

Page 16: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 16/40

     Impulse response characterises the system     In addition to this if H is position invariant then

obviously

H[ (x-,y-) ] = h (x-,y-)Using this position inavariant property we can writedegraded image g(x,y) asg(x,y)= -f(,) h(x-,y-)] dd

This expression is nothing but convolutionoperation of f(x,y) & h(x,y)

Page 17: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 17/40

     Earlier we had taken noise term is 0     

But now consider noise termdegradation model if H is positioninvariant and linear isg(x,y)=

-f(,) h(x-,y-)] dd + (x,y)

the above equation can be written asg(x,y) = h(x,y) *f(x,y) + (x,y)

this in frequency domain isG(u,v) = H(u.v)F(u,v) + N(u,v)

Page 18: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 18/40

How to do restoration?

If operation is done in frequency domain or spatial domain, knowledge of degradation

function is essential Th simplest approach to restoration isdirect inverse filtering

Page 19: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 19/40

     Objective is to estimate original image function from adegraded image g and some knowledge about H and n

     We know

g(x,y) = h(x,y)*f(x,y) + (x,y)G(u,v)= H(u,v)F(u,v) + N(u,v)in matrix form the above eqn. g=Hf+n

Where g , H and F are column vectorsn=g-Hf 

In the absence of knowledge of nf^ is found such that

Page 20: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 20/40

     Hf^ §g

     We want to find f^ such thatn2 = g - Hf^2 is min

by def 

(i) n2 = nTntherefore

(ii) g - Hf^2 = (g-Hf^ )T (g-Hf^ )

the (i) and (ii) are squared norms of n andg - Hf^

Page 21: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 21/40

     Equalent view of this problem can be done byminimizing the criterion fn

J (f ̂ ) = g - Hf^2

for minimizing the above equation differentiate Jw.r.t f ^ and set the result =0 J (f ̂ ) / (f ̂ ) =0

= -2HT(g - Hf^) = -2HTg +2HTH f^thereforef^ =HTg (HTH) -1

Page 22: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 22/40

Assume H is square matrix and H -1 existsf^ = H-1(HT) -1 HTg

f^=H-1g ------- unconstrainedrestorationConstrained restoration:

     Here the minimizing function takes theform Qf^2where Q is linear operator onf 

Page 23: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 23/40

Here the constraint is expressed in theform

(g - Hf^2 -n2 ) and appendingQf^2 to the function

We seek an f that minimizes the criterionfunction

J (f ^) = Qf^2 + (g - Hf^2 -n2 ) is constant called the langrangesmultiplier 

Page 24: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 24/40

differentiate J w.r.t f ^ and set the result =0 J (f ̂ ) / (f ̂ ) =0 =2 QTQf^ - 2 HT(g-Hf^)

we getF=(HTH+QTQ)-1HTg where = 1/

Page 25: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 25/40

Inverse filtering

     Concept is simpleOur expression isG(u,v)= H(u,v)F(u,v)

H(u,v) is degradation function in frequencydomain

now Bcoz H(u,v) F(u,v) is point by pointmultiplication, from this expression we can get

F(u,v) = G(u,v)/H(u,v)and since H(u,v) is estimated value and it will

never be exact

Page 26: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 26/40

Therefore F(u,v) is appropriate imageF(u,v) = F^(u,v)

If we consider noise termG(u,v)= H(u,v)F(u,v)+N(u,v)F^(u,v) =G(u,v)/H(u,v)

=H(u,v)F(u,v)/H(u,v) +N(u,v)/H(u,v)= F(u,v) + N(u,v)/H(u,v)

Page 27: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 27/40

     From the above expression we cannot

recover the original image even if we knowdegradation function bcoz N(u,v) is arandom function whose FT is not known.

     

If degradation has 0 or small values thethe ratio N(u,v)/H(u,v) will dominate theF^(u,v) , so noise term dominates.

     To overcome this problem limit the filter frequencies to values near origin, or instead of taking entire frequency planewe have to restrict our frequency

Page 28: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 28/40

Wiener filter 

     This is min mean suqare error approach     Uses estimated value of H

     Tries to restore by minimizing an error      If original iamge is f and reconstructed

image is f^

     Winier filter tries to minimize error functionwhich is given by

Page 29: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 29/40

E[(f-f^)2] and this is error value e     wenier filtering minimizes this expectation

value.     Here assumption is iamge and noise

intensity are uncorrelated & using thisassumption wenier filter works

     It can be shown that if e is min,corresponding F(u,v) in freq domain isgiven by

Page 30: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 30/40

F^(u,v) = H*(u,v)Sf (u,v)Sf(u,v)H(u,v) 2 +S(u,v)

G(u,v)

Page 31: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 31/40

H* -- it is complex conjugate of H(u,v) Sf(u,v) --- power spectrum of original

image S(u,v) --- nose power spectrum If I simplify the above expression we get

F^(u,v) = [1/H(u,v) . |H(u,v)|2

/ (|H(u,v)|2

+S(u,v)/Sf (u,v))] G(u,v)

Page 32: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 32/40

     This is the Ft of reconstructed image whenusing wiener filter 

     If image has no noiseS(u,v) = 0Therefore wiener filter will become identical

to inverse filtering

     if noise term is present tehn weiner filter  inverse filetring

Page 33: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 33/40

     Weiner filter considers ratio of power spectrum of Sand Sf 

     

If noise present is white noise for whichSn is constant but it is not possible to findwhat is power spectrum of original imagefor that we take

S(u,v)/Sf (u,v) = constant K

Page 34: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 34/40

F^(u,v) = [1/H(u,v) . |H(u,v)|2/ (|H(u,v)|2 +K)]G(u,v)

K is to adjusted manually for best visualization or 

appearance     Therefore weiner filter is slightly better than

inverse filtering      Advantage

need not consider to what extend of frequencycomponents are to be used for reconstruction

Page 35: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 35/40

     Disadvantage:manually adjust K and this is not a

 justified approach in all cases as K variesfor different imageso go in for filtering operation called

constrained least square filter 

Page 36: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 36/40

Pseudo inverse filtering

Stabilized version of inverse filter  Defined as

F^(u,v) = 1/H(u,v) H00 H=0

Page 37: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 37/40

Consider the result of weiner filter F^(u,v) = H*(u,v)Sf (u,v)

Sf (u,v)H(u,v) 2 +S(u,v)

Page 38: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 38/40

This can be written as|H|Sf (u,v) / (|H|2 Sf (u,v) +Sn(u,v))

weiner smoothing filter In the absence of blur H=1Therefore above equation becomes

Sf (u,v) / ( Sf (u,v) +Sn(u,v)) ± this issmoothing filter 

Page 39: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 39/40

In the absence of noise|H|Sf (u,v)

Sf (u,v)|H|2

= 1/H which is inverse filter On the other hand if S 0 we getLim S 0 G = 1/H(u,v) H0

0 H=0 this is pseudo inversefilter 

so we can say smoothing and pseudoinverse filters arespecial cases of weiner filter 

Page 40: Ip Image Restoration

8/3/2019 Ip Image Restoration

http://slidepdf.com/reader/full/ip-image-restoration 40/40

Image compression