smoothing filters gaussion and median filters comparing.ppt
ahmedshamsan2
94 views
26 slides
Jun 13, 2024
Slide 1 of 26
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
About This Presentation
In the world of image processing, unwanted noise and details can make your pictures appear rough. Smoothing filters come to the rescue, offering a way to refine your images. These filters work by analyzing a pixel and its surrounding neighbors, then replacing the pixel's value with a new one tha...
In the world of image processing, unwanted noise and details can make your pictures appear rough. Smoothing filters come to the rescue, offering a way to refine your images. These filters work by analyzing a pixel and its surrounding neighbors, then replacing the pixel's value with a new one that better reflects the overall tone of its neighborhood. This essentially evens out the "bumps" in your image, creating a smoother visual experience.
There are two main types of smoothing filters: Average and Gaussian. The Average Filter takes the average value of all neighboring pixels, creating a more uniform tone but potentially blurring edges. The Gaussian Filter uses a more nuanced approach, weighting the influence of neighboring pixels based on their distance from the central pixel. This allows for smoother transitions while preserving edges better than the Average Filter. The choice between these filters depends on your image and desired outcome. For basic noise reduction with some edge preservation, the Gaussian Filter is a good option. For removing impulsive noise like random black or white pixels, the Median Filter (not strictly a smoothing filter) excels at this task. By understanding smoothing filters and their impact, you can unlock the art of image refinement, transforming your photos from noisy to visually pleasing.
pen_spark
tune
share
more_vert
Size: 1.85 MB
Language: en
Added: Jun 13, 2024
Slides: 26 pages
Slide Content
Smoothing Filters
(low-pass)
1
Useful for reducing noise and removing
small details.
The elements of the mask must be
positive.
Mask elements sum to 1 assuming
normalized weights (i.e., divide each
weight by the sum of weights).
2
Smoothing Filters: Averaging
The mask weights are all equal to 1
5
Smoothing Filters: Averaging (cont’d)
Mask size determines
degree of smoothing (i.e.,
loss of detail).
3x3 5x5 7x7
15x15 25x25
original
6
Smoothing Filters: Averaging (cont’d)
15 X 15 AVERAGING AFTER IMAGE THRESHOLDING
Example: extract largest, brightest objects
ORGINAL
7
Smoothing filters: Gaussian
The mask weights are the sampled values of a 2D Gaussian:
8
Smoothing filters: Gaussian (cont’d)
Mask size depends on σ, e.g., it is usually chosen as follows:
9
Smoothing filters: Gaussian (cont’d)
•In this case, σcontrols the amount of smoothing
(since mask size depends on it)
σ= 3
σ= 1.4
10
Smoothing filters: Gaussian (cont’d)
EXAMPLE
11
Averaging vs Gaussian Smoothing
Averaging
Gaussian
12
BothaverageandGaussianfiltersareusedforsmoothinginimageprocessing,butthey
differintheirapproachandtheresultingeffects:
AverageFilter:
•Simpleandefficient:Itreplaceseachpixel'svaluewiththeaverageofitssurrounding
pixelsinadefinedneighborhood(likeasmallboxaroundthepixel).
•Equalweighting:Allneighboringpixelscontributeequallytothenewvalue,essentially
blurringtheimage.
•Sharperedgeloss:Sinceallpixelshavethesameweight,thefiltercanblursharpedges
anddetailssignificantly,especiallywithlargerneighborhoodsizes.
GaussianFilter:
•Weightedaverage:Italsousesaneighborhoodbutassignsweightstoeachpixelbased
itsdistancefromthecentralpixelbeingsmoothed.
•Bell-shapedcurve(Gaussianfunction):Theweightsfollowabell-shapedcurve,where
pixelsclosertothecenterhavehigherweights(contributemore)andthosefurtheraway
havelowerweights.
•Preservesedgesbetter:Bygivingmoreimportancetocloserpixels,thefiltercansmooth
outnoisewhilepreservingedgesandfinedetailstoagreaterextentcomparedtothe
averagefilter.
what is the difference between the average and
Gaussian filters in smoothing?
13
Feature Average Filter Gaussian Filter
Approach
Simple averaging of
neighbors
Weighted average
based on distance
Weighting
Equal weights for all
neighbors
Weights based on
Gaussian curve
Smoothing effect Strong blurring
Smoother image with
better edge
preservation
Detail preservation
Low (significant edge
loss)
Higher (better edge
preservation)
Computational
complexity
Lower Slightly higher
14
Smoothing Filters: Median Filtering
(non-linear)
Very effective for removing “salt and pepper” noise (i.e.,
random occurrences of black and white pixels).
AVERAGING
MEDIAN
FILTERING
20
Smoothing Filters: Median Filtering (cont’d)
Idea: replace each pixel by the medianin a neighborhood around the
pixel.
The size of the neighborhood controls the amount of smoothing.
21
22
Code results for Median 23
GaussianFilter:
•Approach:AppliesaweightedaveragebasedonaGaussiandistribution(bell-shapedcurve).Pixels
closertothecenterhavehigherweights,contributingmoretothesmoothingeffect.
•Smoothingeffect:Providesasmoothandcontinuoustransitionbetweenpixels,effectivelyreducing
noisewhilepreservingedgestoacertainextent.
•Impactondetails:Mayslightlyblurfinedetailsduetotheaveragingprocess,especiallywithlarger
kernelsizes.
•Noisehandling:WorkswellforGaussiannoise(randomvariationsinpixelintensity)duetothe
averagingnature.
•Computationalcomplexity:Slightlyhighercomparedtomedianfilter.
MedianFilter:
•Approach:Replaceseachpixelwiththemedianvalueofitssurroundingneighborhood(sortedlistof
pixelintensities).
•Smoothingeffect:OffersasharpersmoothingeffectcomparedtoGaussianfilter,particularlyfor
edges.
•Impactondetails:PreservesdetailsandedgesbetterthanGaussianfilterduetoselectingthemiddle
value,notanaverage.
•Noisehandling:Particularlyeffectiveforimpulsivenoiselikesalt-and-peppernoise(randomblackor
whitepixels)asthemedianislessinfluencedbyextremevalues.
•Computationalcomplexity:LowercomparedtoGaussianfilter.
Both Gaussian and Median filters are used for smoothing images in image processing,
but they have distinct characteristics and work in different ways:
24
Feature Gaussian Filter Median Filter
Approach
Weighted average
(Gaussian)
Median of surrounding
pixels
Smoothing effect
Smooth and
continuous
Sharper, preserves
edges
Impact on details May blur fine detailsPreserves details better
Noise handling
Good for Gaussian
noise
Excellent for impulsive
noise
Computational
complexity
Slightly higher Lower
TABLE SUMMARIZING THE KEY DIFFERENCES 25