Image processing, Noise, Noise Removal filters

4,305 views 43 slides Aug 16, 2021
Slide 1
Slide 1 of 43
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43

About This Presentation

Basics of images, Digital Images, Noise, Noise Removal filters

Reference:
Richard Szeliski, Computer Vision: Algorithms and Applications, Springer 2010


Slide Content

Image Processing
Dr. P. Kuppusamy

Content
•Typesofimages
•ImageProcessingDefinition
•DigitalImage
•ImageFormation
•Typesofdigitalimages
•Histogram
•Noiseinimages
•Typesofnoiseinimage
•Saltandpeppernoise/Impulsenoise/Shotnoise/Spikenoise
•Gaussiannoise
•Uniformnoise
•Rayleighnoise
•Erlang(Gamma)noise
•Exponentialnoise(GammaNoise)
Noiseremovalfilters

Content
•Noiseremovalfilters
•Arithmeticandgeometricmeanfilters
•Contraharmonicfilters
•Mean/averagefilter
•Medianfilter
•AdaptivemedianFilters
•Maxandminfilter
•Midpointfilter
•Alphatrimmedmeanfilter
•GaussianFilter/GaussianSmoothingFilter
•BandRejectFilters
•Inversefilter
•MaximumMeanSquareError(Wiener)Filtering

TwoTypesofImages
1.VectorImages–Imagesmadeupofvectorswhichleadthroughlocations
calledcontrolpoints.EachofthesecontrolpointsdefinedontheXandYaxes
oftheworkplain.
2.DigitalImages-Adigitalimageisan2dim-arrayofrealnumbers.2-D
imageisdividedintoN-rowsandM-columns.
Theintersectionoftheserows&columnsisknownaspixels.

Digitalimageisformation
•Capturinganimagefromacameraisaphysicalprocess.The
sunlightisusedasasourceofenergy.
•Asensorarrayisusedfortheacquisition(digitization)ofthe
image.
•Whenthesunlightfallsupontheobject,theamountoflight
reflectedbythatobjectissensedbythesensors,andacontinuous
voltagesignalisgeneratedbythesenseddata.
•Tocreateadigitalimage,convertthisdataintoadigitalform.This
involvessamplingandquantization.
•Theresultofsamplingandquantizationistwodimensionalarray
ormatrixofnumbersiscalledadigitalimage.

Imageprocessing
•Imageprocessingisamethodtoperformsomeoperationsonan
image,likeenhancingtheimageorextractsomeusefulinformation
fromtheimage.
•Itisatypeofsignalprocessinginwhichinputisanimageand
outputmaybeimageorcharacteristics/featuresoftheimage.
Twotypesofmethods:
1.Analogueimageprocessing–Itcanbeusedforthehardcopies
likeprintoutsandphotographs.
2.Digitalimageprocessing-useofadigitalcomputertoprocess
digitalimagesthroughanalgorithm.

DigitalImage
•Animageisatwodimensionalsignal.Itisdefinedbythemathematicalfunction
f(x,y)wherexandyarethetwospatial(plane)co-ordinateshorizontallyand
vertically.
–Theamplitudeoffatpairof(x,y)isintensityoftheimage.
–Ifx,yandamplitudevaluesoffarefinite,itiscalleddigitalimage.
–Animagecanbedefinedbyatwo-dimensionalarrayspecificallyarranged
inrowsandcolumns.
–Thevalueoff(x,y)atanypointgivesthepixelvalueatthatpointofan
image.
–Eachpixelhasaparticularlocationandvalue.
•f(x,y)=H(x,y)+B(x,y),
•f(x,y)=functionofnoisyimage,H(x,y)=functionofimagenoise,B(x,y)=functionof
originalimage.
•Theoretically,apictureisafunctionofimageintensityataparticularposition
intheimage.i.eI(x,y)isanimagefunctionwhereI=Intensityatposition
(x,y)inanimage.

Imagesasfunctions

f(1,1) = 103
83 82 82 82 82 82
82 82 82 81 81 81
82 82 81 81 80 80
82 82 81 80 80 79
80 79 78 77 77 77
80 79 78 78 77 77
f(2724,2336) = 88
f(645:650,1323:1328) =
Pixel intensity value
Pixel location
In8-bit representation,
Pixel intensity values change
between 0 (Black) and 255
(White)
rowscolumns
Considertheimage(2724x2336pixels)tobe2Dfunctionoramatrixwith
rowsandcolumns

Typesofdigitalimages
1.BinaryImages
–outputofthefunctioniseitherthebrightestpixel1(255)orthedarkestpixel0
2.GrayScaleImages
–theoutputofthefunctionisarangeofpossiblevaluesfromthebrightest
pixel255tothedarkestpixel0
3.ColorImages
–vectorvaluedfunctionrepresentred,blueandgreenpixelvaluesrange0-
255.

HISTOGRAM
•Histogramofimagedescribetheintensityvalueofpixelsthatoccurinanimage.
•Itisaplotthatshowsthefrequencyofoccurrenceofanevent.
Image Histogram

Noiseinimages
•Imagenoiseisrandomvariationofbrightnessorcolorinformationinthe
capturedimages.
•Itisdegradationinimagesignalcausedbyexternalsources.
•Imagescontainingmultiplicativenoisehavethecharacteristicthatbrighterthe
areathenoisierit.Butmostlyitisadditive.

Noiseinimages
•Modelanoisyimageas
g(x, y) = f(x, y) + η(x, y)
g(x, y)= function of noisy image, η(x, y) = function of image noise ,
f(x, y) = function of original image.
Sources of Image noise:
•While image being sent electronically from one place to another through satellite,
wireless, etc
•Sensor heatwhile clicking an image.
•With varyingISO Factorwhich varies with the capacity of camera to absorb light.
h(x,y)=SpatialrepresentationofH.
ConvolutioninSpatialdomain=multiplication
inFrequencyDomain

TypesofImageNoise
1.Saltandpeppernoise/Impulsenoise/Shotnoise/Spikenoise
•containsrandomoccurrencesofblackorwhiteorbothpixels
•ProbabilitiesDensityFunction(PDF),p(z)isdistributionsaltandpepper
noiseinimage
•Reasonsforimpulsenoise:
–memorycellfailure.
–malfunctioningofcamera’ssensorcells.
–synchronizationerrorsinimagedigitizingortransmission
•Filteringtechniquesforimpulsenoise
•Meanfiltering
•Medianfiltering
•Gaussianfiltering




=
=
=
otherwise0
for
for
)( bzP
azP
zp
b
a

TypesofImageNoise
2.Gaussiannoise:
•variations(fluctuation)inintensitydrawnfromaGaussiannormal
distribution
•Thisnoisecontainspdfofthenormaldistribution
Z–randomvariable
SourcesofGaussianNoise
•Itoccursduringacquisition
oE.g.Sensornoisecausedbypoorilluminationand/orhigh
temperature
•Transmission
oe.g.Electroniccircuitnoise.
GaussianNoisefilteringtechniques
•Mean(convolution)filtering
•Medianfiltering
•Gaussianfiltering
Original
Image
Noisy Image22
2/)(
2
1
)(


−−
=
z
ezp

TypesofImageNoise
3.SpeckleNoise
•Specklenoisecanbemodeledbyrandomvaluesmultipliedby
pixelvaluesofanimage
•Outputfromrandomfluctuationsinthereturnsignalfroman
objectisnotbiggerthanasingleimage-processingelement.
•Itincreasesthemeangreylevelofalocalarea.
•Thedistributionnoisecanbeexpressedasg(n,m),istheobserved
image,u(n,m)isthemultiplicativecomponent.and(n,m)isthe
additivecomponentofthespecklenoise.
SpeckleNoisefilteringtechniques
•Mean(convolution)filtering
•Medianfiltering
Original
Image
Noisy Image

TypesofImageNoise
4.UniformNoise
•Theuniformnoisecausebyquantizingthepixelsofimagetoa
numberofdistinctlevelsisknownasquantizationnoise.
•Uniformnoisecanbeanalyticallydescribedbythegraylevel
valuesofthenoisethatareevenly(uniformly)distributedacrossa
specificrange.
•Quantizationnoisehasanapproximatelyuniformdistribution
Original
Image
Noisy Image






=
otherwise0
if
1
)(
bza
ab
zp 2
ba+
= 12
)(
2
2 ab−
=

SpecialTypesofImageNoise
5.Rayleighnoise
Radarrangeandvelocityimagestypicallycontainnoisethat
canbemodeledbytheRayleighdistribution.
6.Erlang(Gamma)noise
Itisatwo-parameterspositiveintegerforshape,positivereal
numberforrateofcontinuousprobabilitydistributions.
7.Exponentialnoise(SpecialCaseofGammaNoise)
Continuousprobabilitydistributions.Itisusedtomodelthe
timeelapsedbetweenevents

NoiseRemoval
•Use spatial filters to remove different kinds of noise.
•Noisereductioncanbeimplementedinspatialandfrequencydomain.
•Techniquestoreducenoiseare:
•UniformFilter/AveragingFilter
•MedianFilter/OrderstatisticFilter
•GaussianFilter/BandRejectFilter
•InverseFiltering
•WeinerFiltering
•A general technique to noise reduction is smoothing and median filter.

Average/Mean/Uniformfilter
•Spatialfilterremovesimpulsenoise(saltandpeppernoise).
•Theaveragingfilterofsize3x3pixelsis:
•m,nareno.ofrowsandno.ofcolumns.
•g(s,t)isobservednoisyimage.
Filter mask

Average/Meanfiltertypes
Mean Filter
Harmonic
(Arithmetic) Mean
Geometric Mean
Contraharmonic
Mean
•Arithmetic and geometric mean filters are suitable for Gaussian or uniform noise
•Contraharmonicfilters are suitable for impulse noise

Harmonic Mean Filter
•Harmonicmeantechniquereducesthesaltnoise.
•But,itcan’treducepeppernoisewell.
•ThistechniquealsocanreducedamagedimageduetoGaussiannoise.
Geometric Mean Filter
•Theresultobtainedfromgeometricmeanproducesblurimage.
•Theinformationofimagewilllost.

Contraharmonic Mean Filter
•Qistheorderofthefilterandadjustingitsvaluechangesthe
filter’sbehaviour.
•iftheQvalueisnegativevalue,itcanreducesaltnoise.
•iftheQvalueispositivevalue,itcanreducepeppernoise.
•Thistechniquecan’teliminatebothsaltandpeppernoise
concurrently.

OrderStatisticsFilters
•Spatialfiltersthatarebasedonorderingthepixelvaluesthatmake
uptheneighbourhoodoperatedonbythefilter
•Spatialfiltersare
–Medianfilter
–Maxandminfilter
–Midpointfilter
–Alphatrimmedmeanfilter

Median Filter
•Median filter technique reduces impulse noise such as Salt and Pepper
well.
•Median filter is defined as:
•Center(median)valueintheoriginalimage3x3pixelsisreplacedby
themedianvalue.
•Medianfiltertechniqueisappliedforeachnon-overlappingblockof3x3
pixels,fromtop-leftcornertotop-rightcornerandfromtoptobottom.

Median Filter
164 156 145 96 168 188
146 135 90 185 200 198
137 83 189 199 214 199
94 191 215 211201 198
179 221 200 218 222 201
185 210 221 220 198 214
164 156 145 96 168 188
146 135 90 185 200 198
137 83 191 199 214 199
94 189 215 211 201 198
179 221 200 218 222 201
185 210 221 220 198 214
ascendingorder:83,94,137,179,189,191,200,215,221
•The 2 D array shows the grayscale image with 3x3 filter.
•Pixel intensity value 191 replaced by 3 x 3 filter median intensity value
189.

Median Filter
Thecomputational
blockoverlaponly
pixelsthatareinthe
originalimage.
Thecomputationalblock
overlappixelsoutside
theoriginalimage,but
thecenterpixeloverlaps
apixelintheimage.
Thecomputational
blockoverlappixelsat
theedgesonly.The
centerpixelisoutside
theimage.

Adaptive median Filters
•Adaptive median filterscan perform better than media filter on impulse noise
such as pepper and salt noise.
•The results obtained from adaptive median filter produce slightly smooth image.
•Thebehaviourofadaptivefilterschangesdependingonthecharacteristicsofthe
imageinsidethefilterregion.
•Themedianfilterperformsrelativelywellonimpulsenoiseaslongasthespatial
densityoftheimpulsenoiseisnotlarge.
•Theadaptivemedianfiltercanhandlemuchmorespatiallydenseimpulsenoise,
andalsoperformssomesmoothingfornon-impulsenoise.
•Thekeyinsightintheadaptivemedianfilteristhatthefiltersizechanges
dependingonthecharacteristicsoftheimage.
•Filtering looks at each original pixel image and generates a new filtered pixel.

Adaptive median Filters
–z
min = minimum grey level in S
xy
–z
max = maximum grey level in S
xy
–z
med = median of grey levels in S
xy
–z
xy = grey level at coordinates (x, y)
–S
max = maximum allowed size of S
xy
Level A: A1 = z
med–z
min
A2 = z
med–z
max
ifA1 > 0andA2 <0, Go tolevel B
else increase the window size
if window size ≤ repeat S
maxlevel A
else output z
med
Level B: B1 = z
xy–z
min
B2 = z
xy–z
max
ifB1 > 0andB2 <0,output z
xy
else output z
med

Adaptive median Filters
•Adaptive median filter has three purposes:
–Remove impulse noise
–Provide smoothing of other noise
–Reduce distortion such as excessive thinning or thickening of
object boundaries

MaxandMinFilter
Max Filter:
Min Filter:
•Max filter is good for pepper noise and minis good for salt
noise)},({max),(
ˆ
),(
tsgyxf
xySts
= )},({min),(
ˆ
),(
tsgyxf
xy
Sts
=

MidpointFilter
•Good for random Gaussian and uniform noise





+=

)},({min)},({max
2
1
),(
ˆ
),(),(
tsgtsgyxf
xyxy
StsSts
Alpha-Trimmed Mean Filter:
•Hybrid of median and mean filters
•Work on the monochrome images only 8 bit and 24 bits.
•Alpha parameter is d responsible for number of trimmed (discard) element
•Average the pixel values by Delete the d/2 lowest and d/2highest grey level
values. So use the remaining mn–dpixels.
•Useful in situations involving multiple types of noise, such as a combination of
salt-and-pepper and Gaussian noise
−
=
xy
Sts
r
tsg
dmn
yxf
),(
),(
1
),(
ˆ

PeriodicNoise
•Periodicnoisearisesdueto
electricalor electromagnetic
interference.
•Givesrisetoregularnoise
patternsinanimage
•Frequencydomaintechniquesinthe
Fourierdomainaremosteffectiveat
removingperiodicnoise.
•Frequencydomaindatarangefrom0to
2π.

GaussianFilter/GaussianSmoothingFilter
•GaussianfilteringisusedtoblurimagesandremovenoiseusingGaussian
function.
•Blurringisusedinpreprocessingsteps,suchasremovalofsmalldetails
fromanimagepriortoobjectextraction,andbridgingofsmallgapsin
linesorcurves.
•Noisereductioncanbeaccomplishedbyblurring
•Inedgedetection,GaussiansmoothingisdonepriortoLaplacianto
removetheeffectofnoise.
•σ-varianceofthemask(filter)
•Gaussianfiltersdesigncanbecontrolledbymanipulatingjustone
variable-thevariance.

GaussianFilter/GaussianSmoothingFilter
•Thevalueofthevariancecorrespondsinverselytotheamountoffiltering,
smallervaluesofsigmahasmorefrequenciesaresuppressedandvice
versa.
•TheStandarddeviationplaysmajorroleinitsbehavior.
•Thevalueslocatedbetween+/-ofσfor68%,whiletwostandarddeviations
fromthemean(blueandbrown)accountfor95%,andthreestandarddeviations
(blue,brownandgreen)for99.7%.
•ThisisveryimportantwhendesigningaGaussiankerneloffixedlength.

BandRejectFilters
•Removingperiodicnoiseformanimageinvolvesremovinga
particularrangeoffrequenciesfromthatimage.
•Distancefunction-Bandrejectfiltersusesdistanceofeach
elementofthetransferfunctiontotheorigin(0,0).
•Anidealbandrejectfilteris








+
+−
−
=
2
),( 1
2
),(
2
0
2
),( 1
),(
0
00
0
W
DvuDif
W
DvuD
W
Dif
W
DvuDif
vuH
D(u,v)-Distancetotheorigin
D
0–Cutofffrequencyi.e.Transitionpointbetweenthepassandstop
bandsofthefilter
W–Bandwidth

BandRejectFilters
–Butterworthbandrejectfilteroforderndeterminesthesteepness
ofthetransitionbetweenthepass-bandandstop-band.
•BetterresultscanbeachievedwithaGaussianshapedfilterfunction.
•AcommonlyuseddiscreteapproximationtotheGaussianisthe
Butterworthfilter.
•Applyingthisfilterinthefrequencydomainshowsasimilarresulttothe
Gaussiansmoothinginthespatialdomain.n
DvuD
WvuD
vuH
2
2
0
2
),(
),(
1
1
),(









+
=

BandRejectFilters
•The ideal band reject filter is shown along with Butterworth and
Gaussian versions of the filter.
Ideal
Band Reject Filter
Butterworth
Band Reject Filter (of order 1)
Gaussian
Band Reject Filter

Inversefilter
•ComputeanestimateF’(u,v)ofthetransformoftheoriginalimageby:
•&#3627408441;′&#3627408482;,&#3627408483;=
&#3627408442;(&#3627408482;,&#3627408483;)
&#3627408443;(&#3627408482;,&#3627408483;)
•Divisionsaremadebetweenindividualelementsofthefunctions.
•&#3627408441;′&#3627408482;,&#3627408483;=&#3627408441;&#3627408482;,&#3627408483;+
??????(&#3627408482;,&#3627408483;)
&#3627408443;(&#3627408482;,&#3627408483;)
•Equationshowsthatevenifweknowdegradationfunction,wecannot
recovertheundegradedimage[InverseFourierTransformofF(u,v)]
exactly,becauseN(u,v)israndomfunctionwhoseFourierTransformis
notknown.
•IfdegradationhasZEROorlessvaluethenN(u,v)/H(u,v)dominates
theestimatedF’(u,v).
•NoexplicitprovisionforhandlingNoise.

MaximumMeanSquareError(Wiener)Filtering
•Incorporatesbothdegradationfunctionandstatisticalcharacteristicsof
noiseintorestorationprocess.
•Considersimagesandnoiseasrandomprocess.
•Findanestimatef’oftheuncorruptedimagefsuchthatmeansquare
errorbetweenthemisminimized.Errormeasureisgivenby:
&#3627408466;
2
=&#3627408440;{&#3627408467;−&#3627408467;
′2
}
•E{.}=Expectedvalueoftheargument
•Assumptions:
•imageandnoiseareuncorrelated.
•OneorotherhasZeromean
•Graylevelsintheestimatearealinearfunctionoflevelsinthe
degradedimage.

MaximumMeanSquareError(Wiener)Filtering
Based on these conditions:
•F

(u,v) =[1/H(u,v)] [ |H(u,v|
2
/ (|H(u,v|
2
+S
(u,v)/S
f(u,v))] G(u,v)
•H(u,v) –degraded function
•H * (u,v) –complecx conjugate of H(u,v)
•H(u,v) = H * (u,v)H(u,v)
•S
(u,v) = |N(u,v)|
2
power spectrum of noise
•S
f(u,v) = |F(u,v)|
2
power spectrum of undegraded image

Relationshipbetweenadigitalimageandasignal
Signal
•Inphysicalworld,anyquantitymeasurablethroughtimeoverspaceconsidered
asasignal.Asignalisamathematicalfunction,anditconveyssome
information.
•Asignalcanbeonedimensionalortwodimensionalorhigherdimensional
signal.
•Onedimensionalsignalisasignalthatismeasuredovertime.E.g.voicesignal.
•Thetwodimensionalsignalsarethosethataremeasuredoversomeother
physicalquantities.E.g.digitalimage.
Relationship
•Anythingthatconveysinformationorbroadcastamessageinphysicalworld
betweentwoobserversisasignal.
•Whenhumanspeak,voiceisconvertedtoasoundwave/signalandtransformed
withrespecttothetimetoopponentperson.
•Also,acquiringanimagefromadigitalcamerainvolvestransferofasignalfrom
onepartofthesystemtotheother.

References
•Richard Szeliski, Computer Vision: Algorithms and Applications,
Springer 2010