Académique Documents
Professionnel Documents
Culture Documents
it/ramponi
Gaussian noise is typical in sensors, especially in low lighting conditions Salt-and-pepper [impulse] noise comes from faulty switching devices Silver halide grains in photographic films yield lognormal distributions Rayleigh noise arises in range images Exponential noise is present in laser imaging For simulation purposes, a noise having a specified cdf Fz can be generated starting from a uniform random field w by the inverse function mapping: z = F 1 ( w) (like in the case of histogram specification) (Matlab: use rand and randn, or imnoise)
z
We are looking for the best compromise between noise attenuation and detail preservation. Let Sxy be an mxn neighborhood of (x,y); define the mean filters:
1 f ( x, y ) = g ( s, t ) mn ( s ,t )Sxy f ( x, y ) = g ( s , t ) ( s ,t )Sxy Q +1 ( x, y ) = f g ( s, t )
( s ,t )Sxy 1 mn
( s ,t )Sxy
g ( s, t )
arithmetic mean; good for pepper noise good for salt noise
Median filter:
Good for unipolar or bipolar impulse noise, long-tailed noise Max filter:
f ( x, y ) = max {g ( s, t )}
( s ,t )Sxy
Finds the brightest points; useful for pepper noise Min filter:
f ( x, y ) = min {g ( s, t )}
( s ,t )Sxy
Finds the darkest points; useful for salt noise Midpoint filter:
Weighted median (WM) filters The output of the WM filter of span N associated with the integer weights w= [w1,w2,...,wN] is given by Alpha-trimmed mean filter: Sort the pixels in Sxy and delete the first d/2 and the last d/2; let Sxy be the set of the remaining pixels. The output is:
f ( x) = median{gW ( s)}
s Sx
f ( x, y ) =
I.e.: duplicate each sample g(i) to the number of the corresponding weight wi, and choose the median value from the new sequence. Example: length-5 WM filter with integer weights [1, 2, 3, 2, 1]. Apply the filter to the sequence g= [-1, 5, 8, 11, -2], so that the window is centered at the sample value 8. After sorting and duplication, gW=[11, 11, 8, 8, 8, 5, 5, -1, -2]. The filter output is 8, whereas the 5-point median would have produced the result 5.
1 mn d
( s ,t )S ' xy
g ( s, t )
Defaults to the arithmetic mean filter when d=0 and to the median filter when d=mn-1. Good for mixed short- and long-tailed noise
The response of the filter changes according to the local properties of the image. Used features:
mL
2 L 2 n
local average of the pixels in Sxy local variance of the pixels in Sxy variance of the noise corrupting f(x,y) (to be estimated!)
f ( x, y ) = g ( x, y ) n [ g ( x, y ) mL ] 2
2
2 2 L n
Define:
Algorithm: while (window size < maxsize) do if (md=mi or md=ma) increase window size; end do; if (mi<g(x,y)<ma) output g(x,y), else output md; Useful for images corrupted by heavy impulse noise.
Let D(u,v) be the distance from the origin of a given frequency. Ideal band-reject filter (reject center frequency D0, reject bandwidth W):
Chapter 5 Image Restoration: Noise only. Frequency-selective filters D(u, v) W 2 n H (u, v) = 1 1 + 2 2 D (u, v) D0
1 D 2 (u , v) D 2 2 0 H (u, v) = 1 exp 2 D(u, v) W
1 H (u, v) = 0 1
if if if
band-reject filters:
Band-pass filter:
Let
D1 (u, v) = (u M / 2 u0 ) 2 + (v N / 2 v0 ) 2 D2 (u, v) = (u M / 2 + u0 ) 2 + (v N / 2 + v0 ) 2
if D1(u,v) D0 or D2(u,v) D0 0 H (u, v) = 1 otherwise n D02 H (u, v) = 1 1 + D1 (u, v) D2 (u, v) 1 D (u, v) D (u, v) 2 H (u, v) = 1 exp 1 D02 2
Note: for the filter coeff. to be real, notch areas must always be defined in symmetric pairs
notch-pass filter:
Hnp(u,v)=1-Hnr(u,v)
Problem: design a locally optimum filter for the interference noise above Approach: interactively determine a suitable notch-pass filter, then subtract a locally weighted fraction of its output from the data
Notch-pass filter:
Assume that w(x,y) does not vary within the neighborhood. We have:
w( x + s, y + t ) = w( x, y )
Subtracting the noise image would damage the image details; it is advisable to use a weighted subtraction:
and
w( x, y )n( x, y ) = w( x, y )n ( x, y )
1 [ g ( x + s, y + t ) w( x, y)n( x + s, y + t ) g ( x, y) + w( x, y)n ( x, y)]2 ab ( s ,t )Sxy
2
f ( x, y) = g ( x, y ) w( x, y )n( x, y )
(A)
The weighting function w(x,y) can be determined by minimizing the local variance of the output image. Let Sxy be an axb neighborhood of (x,y); define the local variance:
2 ( x, y ) =
= ... = w2 (n 2 n ) + 2 w( gn gn)
Minimize the local variance:
Where
1 (B) [ f ( x + s, y + t ) f ( x, y)]2 ab ( s ,t )Sxy f is the local average of f ( x, y ) in Sxy. Substitute (A) in (B):
2 ( x, y ) =
2 w = 0 w = ( gn gn ) ( n 2 n )
2 ( x, y ) =
Note: the minimum variance criterion is arguable; w has to be normalized; it is smaller if the noise variance is high; it is zero if the signal and the estimated interference are not correlated.
Fourier spectrum (not shifted) of the noisy image and estimated noise spectrum
By image observation:
Look at a detail of the degraded image, in a high SNR area, and construct its estimated version f est .Then, H (u , v) = G (u , v ) Fest (u , v)
By experimentation:
Linear, space-invariant degradation model with impulse response h (Pointspread function, PSF): Suppose that equipment similar to the one used for acquisition be available; then it is possible to obtain an accurate estimation of the degradation by imaging an impulse using the same system settings. Then, H (u , v) = G (u , v) A
By mathematical modelling:
1. lens defocus (should be shift-variant useful also for depth-from-focus algorithms) [Pentland 1987]
10
By mathematical modelling:
3. linear planar motion, described by the components x0(t) and y0(t), in the acquisition interval [0,T]:
g ( x, y ) = f [ x x0 (t ), y y0 (t )] dt
0
x0 (t ) = at T ;
T 0
y0 (t ) = 0 T
H (u , v) = exp[ j 2 u at T ] dt =
ua
sin( ua ) exp[ j ua ]
Note: where the degradation is small, noise can dominate. This happens if H has zeros. It also typically happens at high frequencies truncate H at a given distance from the origin. E.g., starting from Fig.5.25b, and even considering that the atmospheric turbulence PSF does not have zeros:
11
f ( x) =
s =
( x s) g ( s)
s =
( x s ) rgg ( s; y ) = rfg ( x; y )
1 HW (u ) = S fg (u ) S gg (u )
with x, y
f ( x) =
s =
( x; s ) g ( s)
g ( x) = h( x) f ( x) + n( x) G (u ) = H (u ) F (u ) + N (u )
the needed power spectra are obtained from:
Using the definition of cross-correlation between two real-valued sequences a(x), b(x): rab ( x; s ) = E{a ( x)b( s )} and substituting from above, the orthogonality condition becomes the Wiener filter equation:
s =
S gg (u ) = H (u ) S ff (u ) + S nn (u ) ;
And the Wiener filter is expressed as:
S fg (u ) = H * (u ) S ff (u ) HW (u ) = H * (u ) S ff (u ) H (u ) S ff (u ) + S nn (u )
2
If nonzero-mean sequences must be processed, and the noise is zeromean, the simplest approach is to subtract the average from the available data, perform the filtering, and then add the average back.
H W (u , v) =
H * (u , v) S ff (u , v) H (u, v) S ff (u , v) + S nn (u , v)
2
Note: if the noise is zero, the Wiener filter becomes the inverse filter Note: when both noise and blur are present, the Wiener filter seeks a compromise between lowpass noise smoothing and highpass deblurring. The result is a bandpass filter. Note: if the spectrum of the original image is not known, one can use:
H W (u , v) =
H (u, v) 1 H (u, v) H (u , v) 2 + K
12
An extension to the simplified Wiener filter seen last. Suppose we know the noise mean and variance.
2 Approach: (~Jain) minimize a cost function J = || p ( x, y ) * f ( x, y ) ||
|| g ( x, y ) h( x, y ) f ( x, y ) ||2 = || n( x, y ) ||2
Let p be an operator that measures the roughness of the estimated image, e.g. its Laplacian:
0 1 0 p( x, y ) = 1 4 1 0 1 0
13
|| N (u, v) ||2
S nn (u , v) =
and S ff (u , v) = 1 | P(u, v) |2
The image to be restored may be affected by geometric distortions. An inverse transformation should be found which brings each pixel to its correct position. This is actually performed in two steps, through a spatial transformation followed by an interpolation Note1: spatial transformations are important today in particular for image matching and retrieval applications 5.25-b Note2: interpolation techniques are also fundamental for image zooming applications
Similar to Fig.5.28(c)
14
The geometric distortion may be represented by the pair of eqs: x=r(x,y), y=s(x,y). If they were analytically known, one could obtain f(x,y) from the distorted image g(x,y). In general, however, a single description for the distortion process in the whole image plane is not achievable. A set of reference pixels (tiepoints) whose correct location can be determined is found, and all pixels in a polygon determined by such set are moved accordingly.
A typical model used to describe geometric distortions is the bilinear one x = r(x,y) = ax + by + cxy + d y = s(x,y) = ex + fy + gxy + h If eight tiepoints are known, such eqs. can be solved; then, all the pixels in the enclosed quadrilateral region are transformed. To this purpose, we determine the distorted position (x,y) of each point (x,y) in the original image via the eqs. above, and we set f(x,y)=g(x,y). But the point (x,y) in general will not be located on the sampling grid. We need an interpolator
[Pratt 113][interp_1D.m]
Only the sinc function would allow perfect interpolation, but it is not practically realizable. We can approximate it via several linear operators (n-th order interpolators), the coefficients of which are determined by successive convolutions:
Another different 3rd-order interpolator can be defined, based on the general expression:
A | x |3 + Bx 2 + C | x | + D RC ( x) = 3 2 E | x | + Fx + G | x | + H
0 | x | 1
1 | x | 2
with the constraints that R=1 at 0, R=0 at -2,-1,1,2 (like a sinc), and that its first derivative is zero at -2,2 7 constraints, 8 unknowns 1 d.o.f.: 3 2
( A + 2) | x | ( A + 3) x + 1 RC ( x) = 3 2 A | x | 5 Ax + 8 A | x | 4 A
0 | x | 1
1 | x | 2
If A=-1/2 is selected, the solution achieved is the one with mmse for a power series expansion (Keys).
2-D separable interpolators are derived from the ones above: R0 nearest-neighbor; R1 bilinear; Keys bicubic interpolators
15
16