Image Restoration. Chapter 5. You want to obtain an image X. But you only have a degradation version Y. How do you determine X from Y?

Save this PDF as:
 WORD  PNG  TXT  JPG

Størrelse: px
Starte visningen fra side:

Download "Image Restoration. Chapter 5. You want to obtain an image X. But you only have a degradation version Y. How do you determine X from Y?"

Transkript

1 Imge Restortion Chpter 5 Imge Restortion Problem: You wnt to obtin n imge X. But ou onl hve degrdtion version Y. How do ou determine X from Y? Degrdtion m result from: Additive noise Non-dditive noise. Nonliner distortion. Liner distortion Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem ١

2 Imge Restortion Restortion: A process tht ttempts to reconstruct or recover degrded imge b using some priori knowledge of the degrdtion phenomenon. Technique: model the degrdtion ppl the inverse process to recover the originl imge. Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 3 Restortion vs. Enhncement Enhncement technique re heuristic Procedures designed to mnipulte n imge in order to tke the dvntge of the pschophsicl spects of the humn visul sstem while restortion techniques re mthemticl. Enhncement is subjective process while restortion is objective process. Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 4 ٢

3 Degrdtion Model g h * f η Gu Hu F u N u Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 5 Noise Noise Origin: Imge sensor might produce noise becuse of environmentl conditions or qulit of sensing elements. Interference in the imge trnsmission chnnel. Assumptions: Noise is independent of sptil coordintes ecept for periodic noise nd independent of the imge. Sptil description of noise: Gussin noise Rleigh noise Erlng Gmm noise Eponentil noise Uniform noise Impulse noise etc. Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 6 ٣

4 Noise Models Gussin noise Mthemticll speking it is the most trctble noise model. Due to fctors such s electronic circuit noise sensor noise dueto poor illumintion or high temperture The pdf of Gussin rndom vrible z is given b: p z z μ ep πσ σ where z represents noise gr vlue μ is the men nd σ is its stndrd devition. The squred stndrd devition σ is usull referred to s vrince. Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 7 Noise Models For Gussin pdf pproimtel 7% of its vlues will be in the rnge [ μ σ μ σ ] nd 95% of its vlues will be in the rnge [ μ σ μ σ ] Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 8 ۴

5 Rleigh noise The pdf of Rleigh noise is given b: z ep z p z b / b The men nd vrince re given b: μ πb / 4 4 π σ b 4 model noise in rnge imging for z for z < Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 9 ErlngGmm noise The pdf of Erlng noise is given b: b b z z for z e p z b! for z < where > b is n integer nd! represents fctoril. The men nd vrince re given b: μ b/ σ b/ Model Noise in Lser Imging. Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem ۵

6 Eponentil noise The pdf of eponentil noise is given b: e p z z for z for z < where >. The men nd vrince re given b: μ / σ / This is specil cse of Erlng densit with b. Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem Uniform noise The pdf of uniform noise is given b: for z b p z b otherwise The men nd vrince re given b: μ b / σ b- / Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem ۶

7 Impulse slt-nd-pepper noise The pdf of bipolr impulse noise is given b: P p z Pb Where b > for z for z b otherwise found in quick trnsients e.g. fult switches Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 3 Noise Models 4 ٧

8 Noise Models Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 5 Noise Models Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 6 ٨

9 Periodic Noise Periodic noise: from electricl or electromechnicl interference during imge cquisition Frequenc domin filtering cn be used to remove this noise. Fourier trnsform of pure sinusoid is pir of conjugte impulses. In the Fourier trnsform of n imge corrupted with periodic noise should hve pir of impulses for ech sine wve. Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 7 Periodic Noise Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 8 ٩

10 ١٠ Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 9 Estimtion of Noise Prmeters N M N M S z i i S z i i g MN g MN z p z z p z i i μ σ μ μ σ μ Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem Restortion in the presence of noise When the onl degrdtion is noise: gfn GuFuNu Sptil filtering is the method of choice in this cse: Men filters Order-sttistics filters Adptive filters

11 Men Filter S :subimge of size m*n Arithmetic men filter: fˆ mn s t g s t Geometric men filter: it tends to lose less imge detils in the process f ˆ s t S S g s t mn Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem Men Filter Hrmonic men filter: works well for slt noise nd fils for pepper fˆ mn s t S g s t Contrhrmonic men filter: Positive Q order of filetr for pepper nd negtive Q for Slt Noise fˆ s t S s t S g s t g s t Q Q Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem ١١

12 Men Filter Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 3 Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 4 ١٢

13 Men Filter Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 5 Order-Sttistics Filter Medin Filter Effective for slt nd pepper noise fˆ medin{ g s t} M nd Min filters fˆ min s t S s t { g s t} S fˆ S m { g s t} st M filter: useful for finding brightest points in n imge remove pepper noise Min filter: useful for finding drkest points in n imge remove slt noise Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 6 ١٣

14 Order-Sttistics Filter Midpoint Filter Works best for Gussin nd Uniform noise fˆ min { g s t} s t S Alph-trimmed men filter S m { g s t} d/ lowest nd d/ highest gre-levels re removed fˆ mn d Useful for combintion of Slt-pepper nd Gussin noise. s t S st g s t r Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 7 Order-Sttistics Filter Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 8 ١۴

15 Order-Sttistics Filter Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 9 Adptive locl noise reduction filter Response of the filter is bsed on four quntities:. g.σ η :vrince of noise 3. m L : men of piels in S 4. σ L : vrince of piels in S σ η fˆ g σ L g m L Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 3 ١۵

16 Adptive locl noise reduction filter This filter does the following: If σ η or is smll the filter simpl returns the vlue of g. If the locl vrince σ L is high reltive to the noise vrince the filter returns vlue close to g. This usull corresponds to loction ssocited with edges in the imge. 3If the two vrinces re roughl equl the filter does simple verging over window S. Onl the vrince of overll noise hs to be estimted. Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 3 Adptive locl noise reduction filter Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 3 ١۶

17 Adptive medin filtering Hndle dense impulse noise. Preserves detils. z min : minimum gr level in S. z m : mimum gr level in S. z med : medin gr level of S. z : gr level t coordinte. S m : mimum llowed size of S. Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 33 Adptive medin filtering A Az med -z min Az med -z m If A> nd A< go to B else increse the window size If window size<s m repet A Else output z B Bz -z min Bz -z m If B> nd B< output z Else output z med Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 34 ١٧

18 Adptive medin filtering Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 35 Periodic noise reduction This tpe of noise cn be ver effectivel removed using frequenc domin filtering Bnd reject filters remove or ttenute bnd of frequencies round the centrl frequenc s D. An idel bnd reject filter is given b: H u if D u < D W / if D W / < D u < D W if D u > D W / / Where W: width of the stop bnd D : centrl frequenc. D u u v Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 36 ١٨

19 ١٩ Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 37 Bnd reject filters Butterworth bnd reject filter of order n is given b n D v u D W v D u v u H Gussin bnd reject filter is given b ep W v D u D v u D v u H Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 38 Bnd reject filters

20 Bnd reject filters Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 39 Bnd pss filters Bndpss filters re the ect opposite of bndreject filters. The pss bnd of frequencies round some frequenc s D rejecting the rest. H bp u H br u Bndpss filter is usull used to isolte components of n imge tht correspond to bnd of frequencies. It cn lso be used to isolte noise interference so tht more detiled nlsis of the interference cn be performed independent of the imge. Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 4 ٢٠

21 Notch filter It is kind of bnd reject/bnd pss filter tht rejects/psses ver nrrow set of frequencies round center frequenc. Due to smmetr considertions the notches must occur in smmetric pirs bout the origin of the frequenc plne. The trnsfer function of n idel notch-reject filter of rdius D with center frequenc u v is given b H u D u v D or D u v D otherwise where D [ ] / u u M / u v N / v D u [ u M / u v N / v ] / Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 4 Notch filter Butterworth notch reject filter of order n H u D D u v D u v Gussin notch reject filter is given b D H u ep u D D n u A notch pss filter cn be obtined from notch reject filter using: H np u H nr u Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 4 ٢١

22 Notch filter Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 43 Notch filter ppliction Scn line noise removing Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 44 ٢٢

23 Notch filter ppliction Stellite imge of Folrid nd the Gulf of Meico b Spectrum of c Notch pss filter shown superimposed on b d Inverse Fourier trnsform of filtered imge e Result of notch reject filtering Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 45 Optimum Notch Filtering When interference ptterns re more complicted the preceding filters tend to reject more imge informtion Obtin rough noise estimtion sme s previous method. NuGu Hu ηmn F - {Nu} Clculte output using the following Eqution f ˆ g w η Weighting function w re clculted optimll Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 46 ٢٣

24 ٢۴ Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 47 Optimum Notch Filtering W clcultion ] ˆ ˆ [ s b b s f t s f b σ Minimzing Results in σ g g w η η η η w σ Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 48 Liner position-invrint degrdtion Degrdtion Model ] [ f H g η Liner Degrdtion Model d d h f g η β α β α β α Liner position-invrint Degrdtion Model d d h f g η β α β α β α

25 Liner position-invrint degrdtion g h*f η Gu HuFu Nu The function h is Impulse response In Optic It is lso referred to s point-spred function PSF nd represents the observed imge corresponding to point source of light. To restore the originl imge we need to hve. The knowledge of the PSF h. The noise function η sttistics. Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 49 Estimtion of degrdtion function Estimtion b Imge observtion Identif reltivel noise-free subimge of the observed imge contining simple structures e.g. prt of n object nd the bckground Construct n unblurred imge of the subimge b using smple gr levels of the object nd bckground. Clculte H s u Gs u Fˆ u s G s u: the spectrum of the observed sub-imge F s u: the estimte of the spectrum of the originl imge Bsed on the chrcteristic of the function H s u we cn rescle to obtin the overll PSF Hu. Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 5 ٢۵

26 Estimtion of degrdtion function Estimtion b Eperimenttion If equipment similr to the equipment used to cquire the degrded imge is vilble it is possible to obtin n ccurte estimte of the degrdtion. The ide is to obtin the impulse response of the degrdtion b imging n impulse smll dot of light using the sstem G u H u A Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 5 Estimtion of degrdtion function Estimtion b Eperimenttion Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 5 ٢۶

27 Estimtion of degrdtion function Estimtion b modeling Approch: derive mthemticl model strting from bsic principles Emple: Atmospheric Turbulence model H u e k u v 5/ 6 Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 53 Estimtion of degrdtion function Estimtion b modeling Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 54 ٢٧

28 ٢٨ Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 55 Estimtion of degrdtion function Modeling the effect of cmer motion ] sin[ / / vb u j T t v t u j T t v t u j T e vb u vb u T v u H T bt t nd T t t if dt e v u H dt e v u F v u G dt t t f g π π π π π Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 56 Cmer Motion

29 Inverse Filtering The simplest pproch to restortion is direct inverse filtering. This is obtined s follows: ˆ G u F u H u Considering Noise effect ˆ N u F u F u H u Difficult: if the degrdtion hs zero or ver smll vlues then the rtio Nu/Hu could esil dominte the estimtion. Cure: limit filter frequencies to vlues ner the origin. Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 57 Inverse Filtering Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 58 ٢٩

30 Assumptions: e Wiener Filter Estimte imge fˆ b minimizing Men Squre error lso clled Minimum Men Squre Error Filter E{ f fˆ } Imge nd noise s rndom process Imge nd noise re uncorrelted 3 Noise is spectrll white noise nd hs zero men in sptil domin Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 59 Wiener Filter The DFT of the Wiener filter is given b: H* u HWiener u Huv K Sη u N u noise _ power K S f u v F u v imge _ power For spectrll white noise noise power is constnt. We don t know the power spectrum of undegrded imge. So consider the rtio s constnt nd tune different vlues to see the results of filtering. If the noise power is zero i.e. K HWiener u HInverse Huv Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 6 ٣٠

31 Wiener Filter Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 6 Constrined Lest Squre Filtering Vector-mtri representtion of n imge g Hf η Minimize criterion function C M N [ subject to constrint g Hf η f ] w w T w Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 6 ٣١

32 ٣٢ Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 63 Constrined Lest Squre Filtering γ is djusted to stisf the constrint Solution * v u G v u P v u H v u H v u F γ 4 p ] [ ] [ η η σ η η σ η m MN m MN M N η η Hf g Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 64 Constrined Lest Squre Filtering

33 Geometric Trnsformtion Geometricl trnsformtions: modif the sptil reltionships between piels in n imge Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 65 Geometric Trnsformtion Geometricl trnsformtion consists of two bsic opertions:. Sptil trnsformtion: defines the rerrngement of piels on the imge plne. Gr level interpoltion: dels with the ssignment of gr levels to piels in the sptill trnsformed imge Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 66 ٣٣

34 Sptil Trnsformtion Imge f with piels coordintes hs undergone geometric distortion to produce n imge g with coordintes r s Emple: r/ s/ Distortion is shrinking of the size of f b onehlf in both directions. Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 67 Sptil Trnsformtion If r nd s re known nlticll: the inverse of r nd s is pplied to g to recover f. In prctice finding single set of r nd s is not possible Solution: sptil reloction is formulted b the use of tiepoints. Tiepoints: set of piels whose loctions in distorted nd corrected imges re known Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 68 ٣۴

35 Sptil Trnsformtion Suppose the geometricl distortion process within the region is modeled b pir of biliner equtions: rc c c 3 c 4 sc 5 c 6 c 7 c 8 8 known tiepoints 8 unknown c i The model is used for ll the points inside the region Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 69 Sptil Trnsformtion for to horizontl size { for to verticl size { rc c c 3 c 4 sc 5 c 6 c 7 c 8 f^g } } Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 7 ٣۵

36 Gr-level Interpoltion Depending on the vlues of c i nd/or cn be noninteger for integer vlues of rc c c 3 c 4 sc 5 c 6 c 7 c 8 g is digitl imge nd its piel vlues re defined onl t integer vlues of. We need inferring gr-level vlues t noninteger loctions gr-level interpoltion Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 7 Gr-level Interpoltion Simplest scheme: nerest neighbor pproch zero-order interpoltion. Mpping to. Selection of closest integer coordinte neighbor to 3. Assign the gr-level of this nerest neighbor to the piel t. Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 7 ٣۶

37 ٣٧ Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 73 Gr-level Interpoltion Biliner interpoltion: use the gr level informtion four neighbors k b floor k l floor l k l bg k l g b k l g b k l g b f ˆ Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 74 Gr-level Interpoltion Bi-cubic interpoltion: use the gr level informtion 6 neighbors ˆ floor k floor l j i h j i g f b h h b h o w if if b h l l i k k j < <

38 ٣٨ 75 Tpes of Interpoltion Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 76 Sptil Trnsformtion Trnsltionl b Zoom nd De-zoom k cos sin sin cos θ θ θ θ Rottion

39 ٣٩ Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 77 Sptil Trnsformtion Trnsltionl-Zoom-Rottion Affine trnsformtion b k cos sin sin cos θ θ θ θ f e d c b Islmic Azd Universit of Njfbd Deprtment of Electricl Engineering Dr. H. Pourghssem 78 Sptil Trnsformtion Projective Trnsformtion Polnomil trnsformtion e d h g f e d c b n i i n j j i ij n i i n j j i ij b