Lecture #15 - Case Western Reserve University

Transcription

EECS490: Digital Image ProcessingLecture #15 Adaptive Noise Reduction FiltersBandreject and Notch filtersOptimum Notch FilterModeling Image DegradationInverse filteringWiener Filters

EECS490: Digital Image ProcessingMid-Term ProjectMouse visual cortex neuronbundle 2002 R. C. Gonzalez & R. E. WoodsExample of a segmentedimage with errors

EECS490: Digital Image ProcessingAdaptive Mean FilterDIFFERENT CASESf̂ ( x, y ) g ( x, y ) 2 2L g ( x, y ) mL 2 Noise variance over theentire image (estimated)mL Local mean (calculated) 2 Local variance (calculated) If L the filter returnsthe local mean thus averagingout the noise2 If L this is probablythe location of an edge and weshould return the edge value,i.e., g(x,y)222 If 0 there is no noiseand we return g(x,y) If L we can getnegative gray scale valueswhich is a potential problem2 2002 R. C. Gonzalez & R. E. Woods22

EECS490: Digital Image ProcessingAdaptive Mean FilterImage zero-meanGaussian noise7x7 geometricmean filterVisible blurringwith 7x7arithmetic meanfilter7x7 adaptivenoise reductionfilterPerformance candecrease if theestimated overall2noise variance isincorrect 2002 R. C. Gonzalez & R. E. Woods

EECS490: Digital Image ProcessingAdaptive Median Filtervaries Sxy to reduce impulsive noiseStageA: IF zmed zmin and zmax zmedTHEN goto StageBELSE increase the window size SxyIF WindowSize SmaxTHEN goto LevelAELSE output zmedStageB: IF zxy zmin and zmax zxyTHEN output zxyELSE output zmedzminzmaxzmedzxySmax 2002 R. C. Gonzalez & R. E. Woodsmin. gray value in Sxymax. gray value in Sxymedian gray value in Sxygray level value at (x,y)max. allowed size of SxyIf zmax zmed zmin then zmed isNOT an impulse and we go toStageB. Otherwise StageAcontinues to increase theneighborhood Sxy until zmed isnot an impulse.If zmax zxy zmin then zxy is NOTan impulse and we output zxyotherwise we output themedian zmed.The fundamental idea is toincrease the size of theneighborhood Sxy until we aresufficiently sure that zxy isimpulsive or not. If it isimpulsive then output themedian otherwise output zxy

EECS490: Digital Image ProcessingAdaptive Median FilterImage “lots”of salt &pepper noise 2002 R. C. Gonzalez & R. E. Woods7x7 medianfiltering withloss of detailAdaptive medianfiltering (Smax 7)with much betterdetail

EECS490: Digital Image ProcessingBandreject FiltersIdeal 1 GaussianW D ( u, v ) D0 2WW D ( u, v ) D0 H ( u, v ) 0 D0 221ButterworthW D ( u, v ) D0 2H ( u, v ) 1 D ( u, v )W 1 22 D ( u, v ) D0 2nH ( u, v ) 1 e221 D ( u,v ) D0 2 D ( u,v )W 2D0 is center of stopband; W is fullwidth of stopband 2002 R. C. Gonzalez & R. E. Woods

EECS490: Digital Image ProcessingBandreject FilteringNotice strongfrequencycomponents in aringButterworthbandreject filterBandreject filters are not typically usedbecause they can remove too much image detail. 2002 R. C. Gonzalez & R. E. WoodsYou cannot getsuch impressiveimprovementusing a spatialdomain approachwith small filtermasks.

EECS490: Digital Image ProcessingBandpass FilteringConvert Butterworth bandreject filter on previous page toButterworth bandpass filter: Hbandpass(u,v) 1-Hbandreject(u,v).Above image is the result of filtering noisy image with theButterworth bandpass filter — it is the periodic noise inthe spatial domain. 2002 R. C. Gonzalez & R. E. Woods

EECS490: Digital Image ProcessingNotch Filters 2002 R. C. Gonzalez & R. E. Woods

EECS490: Digital Image ProcessingNotch FilteringFourier spectra of original imageshowing periodic noise on v axisNotch pass filter tocapture noiseImage afternotch rejectfiltering 2002 R. C. Gonzalez & R. E. WoodsNoise captured by notchpass filter

EECS490: Digital Image ProcessingOptimum Notch FilterWhen several interference components arepresent or if the interference has broadskirts a simply notch filter may remove toomuch image information.One solution is to use an optimum filter whichminimizes local variances of the restoredestimate.Such “smoothness” constraints areoften found in optimum filter design 2002 R. C. Gonzalez & R. E. Woods

EECS490: Digital Image ProcessingOptimum Notch Filter1.Manually place a notch pass filter HNP at eachnoise spike in the frequency domain. The Fouriertransform of the interference noise pattern isN ( u, v ) H NP ( u, v ) G ( u, v )2.3.Determine the noise pattern in the spatial domain ( x, y ) F 1{ H (u, v ) G (u, v )}NPConventional thinking would be to simply eliminatenoise by subtracting the periodic noise from thenoisy imagef̂ ( x, y ) g ( x, y ) ( x, y ) 2002 R. C. Gonzalez & R. E. Woods

EECS490: Digital Image ProcessingOptimum Notch Filter4.To construct an optimal filter consider5.where w(x,y) is a weighting function.We use the weighting function w(x,y) to minimizethe variance 2(x,y) of f̂ ( x, y )with respect to w(x,y)f̂ ( x, y ) g ( x, y ) w ( x, y ) ( x, y )w ( x, y ) g ( x, y ) ( x, y ) g ( x, y ) ( x, y ) 2 ( x, y ) 2 ( x, y )We only need to compute this for one point in eachnonoverlapping neighborhood. 2002 R. C. Gonzalez & R. E. Woods

EECS490: Digital Image ProcessingOptimum Notch Filterw ( x, y ) g ( x, y ) ( x, y ) g ( x, y ) ( x, y ) 2 ( x, y ) 2 ( x, y ) ( x, y ) Mean noise output from the notch filter 2 ( x, y ) Mean squared noise output from the notch filter 2 ( x, y ) Squared mean noise output from the notch filterg ( x, y ) Mean noisy imageg ( x, y ) ( x, y ) Mean product of noisy image and noise 2002 R. C. Gonzalez & R. E. Woods

EECS490: Digital Image ProcessingImage RestorationCenteredFouriertransformshowingmany strongperiodicinterferers. 2002 R. C. Gonzalez & R. E. Woods

EECS490: Digital Image ProcessingImage Restoration(noncentered)Fouriertransformshowing thesame strongperiodicinterferers. 2002 R. C. Gonzalez & R. E. Woods

EECS490: Digital Image ProcessingImage RestorationFourier spectrum N(u,v) of the noise andits corresponding noise pattern (x,y) 2002 R. C. Gonzalez & R. E. Woods

EECS490: Digital Image ProcessingImage Restoration“Optimum” image constructed bysubtracting weighted periodic noise. 2002 R. C. Gonzalez & R. E. Woods

EECS490: Digital Image ProcessingCharacterization of DegradationOriginal beamof light such asfrom a laser 2002 R. C. Gonzalez & R. E. WoodsBlurring due topassing throughan optical system

EECS490: Digital Image ProcessingModeling of DegradationK 0.0025H ( u, v ) e( k u252 6 v)Atmospheric turbulencedegradation modelK 0.001K 0.00025 2002 R. C. Gonzalez & R. E. Woods

EECS490: Digital Image ProcessingMotion BlurringModel motion in x- and y-directions over a period T for an integratingdetector such as a camera.g ( x, y ) T f x x (t ), y y (t ) dt000Fourier transform g(x,y) and reverse order of integrationG ( u, v ) g ( x, y )e j 2 (ux vy)dxdy T f 0T G ( u, v ) f0 2002 R. C. Gonzalez & R. E. Woods j 2 (ux vy)dxdy x x0 ( t ) , y y0 ( t ) dt e x x0 ( t ) , y y0 ( t ) e j 2 ( ux vy ) dxdy dt

EECS490: Digital Image ProcessingMotion BlurringReplace innter term by F(u,v), the Fourier transform of f(x,y)TT00 j 2 ux t vy t j 2 ux t vy tG ( u, v ) F ( u, v ) e ( 0 ( ) 0 ( ))dxdy dt F ( u, v ) e ( 0 ( ) 0 ( ))dtIdentify the motion blurring transfer function asTH ( u, v ) e j 2 ( ux0 ( t ) vy0 ( t ))dt0We can then model motion degradation asG ( u, v ) H ( u, v ) F ( u, v )Where, for x0(t) at/T, y0(t) 0TH ( u, v ) e0 2002 R. C. Gonzalez & R. E. Woods j 2 ux0 ( t )Tdt e0 j 2 uatTTdt sin ( ua ) e j ua ua

EECS490: Digital Image ProcessingModeling Image DegradationOriginal image(1st editioncover)Motion blurringtransfer function 2002 R. C. Gonzalez & R. E. WoodsMotion blurringwith a b 0.1and T 1H ( u, v ) Tsin ( ua vb ) e j (ua vb ) ( ua vb )

EECS490: Digital Image ProcessingInverse Filtering If degraded image is given by degradation noise Estimate the image by dividing by the degradationfunction H(u,v)G ( u, v ) H ( u, v ) F ( u, v ) N ( u, v )G ( u, v ) H ( u, v ) F ( u, v ) N ( u, v )N ( u, v ) F ( u, v ) F ( u, v ) H ( u, v )H ( u, v )H ( u, v )We can never recover F(u,v) exactly:1. N(u,v) is not known since (x,y) is a r.v. — estimated2. If H(u,v) - 0 then noise term will dominate. Helped byrestricting analysis to (u,v) near origin. 2002 R. C. Gonzalez & R. E. Woods

EECS490: Digital Image ProcessingModeling of Degradation480x480No radial limitingof H(u,v)H(u,v) cut off atR 40H(u,v) cut off atR 70H(u,v) cut off atR 85N ( u, v )F ( u, v ) F ( u, v ) where H ( u, v ) eH ( u, v ) 2002 R. C. Gonzalez & R. E. Woods22 M N k u v 22 56

EECS490: Digital Image ProcessingWiener FilterMinimizee E2{( f f̂ ) }2Assuming: 1. f and n are uncorrelated2. f and/or n is zero mean3. gray levels in f are a linear function ofthe gray levels in fThe best estimate F̂ ( u, v ) is then given by H * ( u, v ) S f ( u, v )H*u,v() G ( u, v ) G ( u, v ) F̂ ( u, v ) 2 S ( u, v ) 2 S f ( u, v ) H ( u, v ) S ( u, v ) Hu,v () S f ( u, v ) 2 Hu,v()1 G ( u, v )F̂ ( u, v ) H ( u, v )S ( u, v ) 2Hu,v () S f ( u, v ) 2002 R. C. Gonzalez & R. E. WoodsH(u,v) degradation functionH*(u,v) complex conjugate of H H(u,v) H*(u,v) H(u,v)S (u,v) N(u,v) 2 power spectrum of noise(estimated)Sf(u,v) F(u,v) 2 power spectrum of originalimage (not known)

EECS490: Digital Image ProcessingModeling of DegradationInverse filteringN ( u, v )H ( u, v ) 2002 R. C. Gonzalez & R. E. WoodsRadially limitat Do 75Wiener filtering2 1H ( u, v ) G ( u, v )F̂ ( u, v ) 2Hu,v ( ) H ( u, v ) K In practice we don’t know the powerspectrum Sf(u,v) F(u,v) 2 of the originalimage so we replace the S /Sf term witha constant K which we vary

EECS490: Digital Image Processing Lecture #15 Adaptive Noise Reduction Filters Bandreject and Notch filters Optimum Notch Filter Modeling Image Degradation