7. Lecture Image restoration: Spatial domain 1
Example: Movie restoration ² Very popular - digital remastering of old movies ² e.g. Limelight from Joanneum Research 2
Example: Scan from old film 3
Example: Image noise Thermal noise Line drop: part or all of a line lost 4
Example: Structured noise Periodic stationary: Noise has fixed amplitude frequency and phase Commonly caused by interference between electronic components Periodic nonstationary: noise parameters (amplitude frequency phase) vary across the image Intermittent interference between electronic components 5
Image degradation & restoration model ² H is a degradation function ² (x; y) is an additive noise term ² The degraded image is g(x; y) ² ^f(x; y) is the image after restoration and should be a close estimate of f(x; y) 6
Image degradation & restoration model ² If the degradation function H is a linear shift-invariant process then the degraded image is given in the spatial domain by g(x; y) = h(x; y) f(x; y) + (x; y) where h(x; y) is the spatial representation for the degradation function. ² In the frequency domain this is: G(u; v) = H(u; v)f (u; v) + N(u; v) 7
Noise models ² The principle source of noise is in image acquisition and/or image transmission ² Following factors a ect the performance of the image aquisition: { Environmental conditions { Light levels (especially low light) { Sensor temperature ² Reasons for transmission errors: { Electronic interferences { Lightning { Atmospheric disturbances 8
Noise models ² Noise produced from di erent sources has di erent characteristics. Therefore we work with multiple noise models. ² Gaussian noise: Sensor noise (low light high temperature electronic circuit noise) ² Rayleigh noise: Mainly used in range images ² Exponential or Erlang noise: Laser imaging ² Impulse noise: faulty components 9
Gaussian noise ² Approximates image noise very well ² De ned by mean ¹ and standard deviation ¾ ² The PDF (probability density function) is given by where z is the grayvalue. p G (z) = p 1 e (z ¹)2 2¾ 2¼¾ 2 10
Impulse (salt and pepper) noise ² Image is corrupted by random white (salt) and black (pepper) pixels 11
More noise models 12
Visual comparison of noise models 13
Visual comparison of noise models 14
Estimating the noise model ² Sometimes the noise model and parameters are known from speci cations. ² In most cases it is necessary to estimate them from images ² This can be done by looking at the histogram of areas of constant grey value. ² Either by taking images of uniform areas or by selecting small patches of reasonably constant gray value 15
Estimating the noise model 16
Periodic noise ² The parameters of periodic noise can be estimated by inspection of the Fourier spectrum. ² Noise is often visible as spikes in the spectrum 17
Restoration in the presence of noise only ² If noise is the only image degradation then the model is as follows: g(x; y) = f(x; y) + (x; y) and G(u; v) = F (u; v) + N(u; v) ² For periodic noise N(u; v) can usually get estimated and restoration can be done by subtracting it ² The image noise terms n(x; y) however cannot be estimated (only in statistical) manner. Restoration by subtraction is not possible. ² In this case spatial ltering needs to be used. 18
Mean filters ² Arithmetic mean lter: { Computes average grayvalue of pixels under a m n lter mask of a noisy image g(x; y) { Coe±cients of lter mask have value of 1=mn { Noise is suppressed by smoothing ² Geometric mean lter: ^f(x; y) = 2 6 4 Y (s;t)2s xy g(s; t) 3 7 5 1 mn { Smoothing similar to arithmetic mean { Preserves details better 19
Example: Mean filter Original Corrupted by Gaussian noise Arithmetic mean Geometric mean 20
Mean filter and salt and pepper noise ² Single pixels with highly deviating grayvalues (salt and pepper noise) in uence the average of all neighboring pixels badly ² Arithmetic and geometric mean lter are not suitable for salt and pepper noise Original Salt and pepper noise Mean filtering 21
Order-statistics filter Pixel underneath filter mask get sorted New value will be determined as follows: Median: Max: b y a x g y x f S b a median b y a x g y x f S b a max 22
Order-Statistics Filter (con d) Min: Midpoint: Alpha-trimmed mean: Remove the smallest and highest values from the sorted list (d number of values to remove) New value is the average of the remaining values b y a x g y x f S b a min b y a x g b y a x g y x f S b a S b a min max 2 1 d mn y x g y x f r 23
Example: Order-statistics filter Iterative application of the median filter Corrupted by pepperand-salt noise 1 st time 2 nd time 3 rd time 24
Example: Order-statistics filter original Corrupted by pepper noise Max filter?? Min filter (for salt noise) 25
Properties Produce no new grayvalues Edge-preserving Works well for salt and pepper noise Rather slow because of sorting the pixel values (especially for large filter masks) Runtime-improvement: Use a running sort window. Don t sort everything from scratch. Remove old pixels from sorted list and add new pixels to sorted list. 26
Adaptive filtering Mean filter that adapts it s behaviour based on statistics of the grayvalues under the filter mask. Use of mean and variance g m g m 2 new( x y) f f 2 2 f g ( x y) f Mean under the mask Variance of the image Current grayscale Variance under the mask 27
Adaptive filtering m g m 2 f f 2 2 f g ( x y) f 2 f If is high then the fraction is close to 1; the output is close to the original value g. 2 f High implies significant detail such as edges. If the local variance is low such as the background the fraction is close to 0; the output is close to m f 28
Example: Adaptive filtering original Corrupted by Gaussian noise with variance=1000 Mean filter (7x7 window) Adaptive Filter (7x7 window) 29