By Dr. Rajeev Srivastava Image Restoration: Spatial Filtering By Dr. Rajeev Srivastava
The filters which needs to be considered are: 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 𝑆 𝑥𝑦 :𝑠𝑒𝑡 𝑜𝑓 𝑐𝑜𝑜𝑟𝑑𝑖𝑛𝑎𝑡𝑒𝑠 𝑖𝑛 𝑎 𝑟𝑒𝑐𝑡𝑎𝑛𝑔𝑢𝑙𝑎𝑟 𝑠𝑢𝑏𝑖𝑚𝑎𝑔𝑒 𝑤𝑖𝑛𝑑𝑜𝑤 𝑜𝑓 𝑠𝑖𝑧𝑒 𝑚×𝑛 𝑓 𝑥,𝑦 = 1 𝑚𝑛 (𝑥,𝑡)𝜖 𝑆 𝑥𝑦 𝑔(𝑠,𝑡)
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. 𝑓 𝑥,𝑦 = (𝑠,𝑡)𝜖 𝑆 𝑥𝑦 𝑔(𝑠,𝑡) 1 𝑚𝑛 Harmonic mean filter The advantage with harmonic filter is that it works well for salt noise and gaussian noise but it fails considerably for pepper noise 𝑓 𝑥𝑦 = 𝑚𝑛 (𝑠,𝑡)𝜖 𝑆 𝑥𝑦 1 𝑔(𝑠,𝑡)
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 𝐹 𝑥,𝑦 = (𝑠,𝑡)𝜖 𝑆 𝑥𝑦 𝑔 𝑄+1 (𝑠,𝑡) (𝑠,𝑡) 𝑔 𝑄 (𝑠,𝑡)
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.
Arithmetic and Geometric Mean Filters (Example)
Contra-Harmonic Mean Filter (Example)
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. 𝑓 𝑥,𝑦 = 𝑚𝑒𝑑𝑖𝑎𝑛 {𝑔 𝑠,𝑡 }
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)}
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) = 1 2 [ 𝑚𝑎𝑥 (𝑠,𝑡)𝜖 𝑆 𝑥𝑦 {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 𝑚𝑛−𝑑 (𝑠,𝑡)𝜖 𝑆 𝑥𝑦 𝑔 𝑟 (𝑠,𝑡)
Examples
END