Image Restoration:Spatial Filtering
ByDr. Rajeev Srivastava
Restoration of Noise Only- Spatial Filtering
The filters which needs to be considered are:
• Arithmetic mean filters• Geometric mean filters• Harmonic mean filters• Contra-harmonic mean filters
Mean filters
• Median filter• Max and min filter• Mid point filter• Alpha trimmed mean filter
Order statistics filter
Arithmetic Mean Filter
• Smooth local variations in an image• Noise is induced as a result of
blurring• g(s,t): Degraded image
Geometric and Harmonic Mean Filter
• Geometric mean filter: it is comparable to the arithmetic mean filter.it achieves smoothening and lossless image detail in the process.
• Harmonic mean filterThe advantage with harmonic filter is that it works well for salt noise and gaussian noise but it fails considerably for pepper noise
Contra-Harmonic Mean Filter
This filter can reduce the effect of both salt and pepper noise but the glitch is that it can not eliminate both of them simultaneously.If we consider the order of filter as Q, then the following will hold:• Q>0; eliminate pepper noise• Q<0; eliminate salt noise• Q=0; arithmetic mean filter• Q=-1; harmonic mean filter
Classification of Contra-Harmonic Filter Applications
The positive order filters effectively reduce the pepper noise, at the expense of blurring the dark areas.
The negative order filters effectively reduce the salt noise, at the expense of blurring the bright areas
Arithmetic and geometric mean filters suit the Gaussian or uniform noise
Contra harmonic filters suit the impulse noise,yet,with the information of dark or light noise to select the proper file for Q.
8
Arithmetic and Geometric Mean Filters (Example)
9
Contra-Harmonic Mean Filter (Example)
10
Contra-Harmonic Mean Filter (Example)
Order Statistics Filters: Median Filter
• Output is based on ordering(ranking) the pixels in a subimage.
• Replace the value of a pixel by the median of the grey levels in the neighborhood of that pixel.
• Excellent for removing both bipolar and unipolar impulse noise.
12
Median Filter (Example)
Order Statistics Filters: Max and Min filter
Max filter: replace the value of a pixel by the maximum of the grey levels(the brightest points) in
the neighborhood of that pixel.
Min filter: replace the value of a pixel by the minimum of the gray levels(the darkest points) in the
neighborhood of that pixel.
f(x,y)= {g(s,t)}
f(x,y)= {g(s,t)}
14
Max and Min Filters (Example)
Order Statistics Filters: Midpoint Filter
• Filters output: the midpoint between the maximum and minimum values of the gray levels in the mask.
• It combines order statistics and averaging• The midpoint filter works best for randomly
distributed noise which includes Gaussian or uniform noise.
f(x,y)[ {g(s,t)} + {g(s,t)}]
Order Statistics Filters: Alpha-Trimmed Mean Filter
Output:
Average of the grey levels of the remaining (mn-d) pixels in the mask after removing the d/2 lowest
and d/2 highest grey levels in
The range of ‘d’ lies in between 0 to (mn-1)
When d equals 0, it becomes arithmetic mean filter, when it equals ((mn-1)/2), it becomes
median filter.
These filters can be used to solve the problem of multi-type noise problem, like combination of salt and pepper noise and Gaussian noise.
𝑓 (𝑥 , 𝑦 )= 1𝑚𝑛−𝑑 ∑
(𝑠 ,𝑡 ) 𝜖𝑆𝑥𝑦
𝑔𝑟 (𝑠 , 𝑡 )
19
Examples
END
Top Related