Vous êtes sur la page 1sur 16

Gianni Ramponi University of Trieste http://www.units.

it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Image degradation model

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise models


Typical pdfs of independent noise

g ( x, y ) = h ( x, y ) f ( x, y ) + n ( x, y ) G (u, v) = H (u, v) F (u, v) + N (u, v)

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise models

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise models

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

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise models

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise models

In general, the noise distribution is not recognizable by image inspection.

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise models

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise models

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise models

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise-only degradation. Nonlinear mean filters


g ( x, y ) = f ( x, y ) + n( x, y ) ; G (u , v) = F (u , v) + N (u , v)

Noise estimation from a locally uniform area of the image

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

Arithmetic mean Geometric mean Contraharmonic mean


Q

( s ,t )Sxy

g ( s, t )

Q=0 Q>0 Q<0

arithmetic mean; good for pepper noise good for salt noise

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise-only degradation. Nonlinear mean filters

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise-only degradation. Nonlinear mean filters

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise-only degradation. Nonlinear mean filters

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise-only degradation. Order Statistics filters


f ( x, y ) = median{g ( s, t )}
( s ,t )Sxy

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:

Useful for short-tailed noise

f ( x, y ) = max {g ( s, t )} + min {g ( s, t )} 2 ( s ,t )Sxy ( s ,t )Sxy

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise-only degradation. Order Statistics filters

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise-only degradation. Order Statistics filters

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise-only degradation. Order Statistics filters

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise-only degradation. Order Statistics filters

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

where gW is obtained from g by duplication of its elements:

6 74 4k 8 gW ( s) = [ w1 g (1), w2 g (2), ... , wN g ( N )] , and k g = g , g , ... , g

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

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise-only degradation. Order Statistics filters


c d

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise-only degradation. Order Statistics filters


e f

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise-only degradation. Adaptive linear filter

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise-only degradation. Adaptive linear filter

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!)

The output is (Wiener filter concept!):

f ( x, y ) = g ( x, y ) n [ g ( x, y ) mL ] 2
2

Note: it is reasonable to suppose that it is everywhere

2 2 L n

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise-only degradation. Adaptive median filter

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise-only degradation. Adaptive median filter

Define:

mi = min {g ( s, t )} ; ma = max {g ( s, t )} ; md = median{g ( s, t )} ;


( s ,t )Sxy ( s ,t )Sxy ( s ,t )Sxy

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.

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise only. Frequency-selective filters

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

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):

Butterworth and Gaussian

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

D(u,v) < D0 W / 2 D0 W / 2 D(u,v) D0 + W / 2 D(u,v) > D0 + W / 2

band-reject filters:

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise only. Frequency-selective filters

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise only. Frequency-selective filters


H BP (u, v) = 1 H BR (u, v)

Band-pass filter:

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise only. Frequency-selective filters

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise only. Frequency-selective filters

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

Ideal, Butterworth, Gaussian notch filters:

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

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise only. Frequency-selective filters

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise only. A locally optimum filter

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

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Notch-pass filter:

Chapter 5 Image Restoration: Noise only. A locally optimum filter H (u, v)


n( x, y ) = 1{H (u, v) G (u, v)}

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise only. A locally optimum filter


( s, t ) Sxy

Assume that w(x,y) does not vary within the neighborhood. We have:

Estimated noise-only image:

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 eq. above becomes:

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 ) =

1 [ g ( x + s, y + t ) w( x + s, y + t )n( x + s, y + t ) g ( x, y) + w( x, y)n( x, y)]2 ab ( s ,t )Sxy

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.

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise only. A locally optimum filter

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Noise only. A locally optimum filter


(image size:512x512; Sxy size:31x31)

Fourier spectrum (not shifted) of the noisy image and estimated noise spectrum

estimated interference image (inverse FT of previous image)

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Image degradation model

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Estimating the PSF

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

H [af1 + bf 2 ] = aH [ f1 ] + bH [ f 2 ] H [ ( x , y )] = h( x , y ) g ( x, y ) = h ( x, y ) f ( x, y ) + n ( x, y ) G (u, v) = H (u, v) F (u , v) + N (u, v)

H[]: generic description H(): freq. response

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Estimating the PSF

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Estimating the PSF


H (u , v) = exp[k (u 2 + v 2 )5 / 6 ]

By mathematical modelling:
1. lens defocus (should be shift-variant useful also for depth-from-focus algorithms) [Pentland 1987]

2. atmospheric turbulence: (similar to a Gaussian)

10

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Estimating the PSF

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Estimating the PSF

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

G (u , v) = F (u , v) exp[ j 2 [ux0 (t ) + vy0 (t )]] dt = F (u , v) H (u , v)


0

e.g. uniform horizontal motion:

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 ]

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Inverse filtering

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: Inverse filtering

Suppose we know H. The most obvious restoration operator is

G (u, v) = H (u, v) F (u, v) + N (u, v)

G (u, v) N (u , v) F (u, v) = = F (u, v) + H (u, v) H (u, v)

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

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: The Wiener filter

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: The Wiener filter


rab ( x; s) = rab ( x s)
,

Wiener filter: 1-D derivation (Jain)


Given two zero-mean random sequences f(x) and g(x), it is desired to obtain from g(x) an estimate of f(x) which minimizes the MSE. The best linear estimate is obtained from a filter hw(k) able to satisfy the orthogonality condition between the error and data sequences:

If the sequences are jointly stationary,

the optimal filter is space-invariant and the Wiener equation becomes:

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 )

e 2 = E{[ f ( x) f ( x)]2 } E{[ f ( x) f ( x)] g ( y )} = 0

with x, y

f ( x) =

s =

( x; s ) g ( s)

Taking its Fourier transform and solving for hw:

Now, if the usual model is taken for the corruption mechanism

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

hW ( x; s) rgg (s; y) = rfg ( x; y)

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: The Wiener filter

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: The Wiener filter

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.

In the 2-D case:

H W (u , v) =

H * (u , v) S ff (u , v) H (u, v) S ff (u , v) + S nn (u , v)
2

H (u, v) 1 H (u , v) H (u, v) 2 + S nn (u, v) S ff (u, v)

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

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: The Wiener filter

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: The Wiener filter

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: The Wiener filter

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: The Constrained Least Squares filter

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 ) ||

subject to the constraint

|| 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

In the Fourier domain: minimize subject to

J = || P(u , v) F (u, v) ||2 2 || G (u, v) H (u, v) F (u, v) || = || N (u, v) ||2

13

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: The Constrained Least Squares filter


H (u , v) 1 H (u , v) H (u, v) 2 + P(u , v) 2
2

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: The Constrained Least Squares filter

A solution can be obtained via the Lagrange multiplier method: H (u , v) = LS

Gamma can be set iteratively: compute and increase gamma if Notes:

D < || N (u, v) ||2

D = || G (u, v) H (u, v) F (u, v) ||2 2 , decrease it if D > || N (u , v) ||

|| N (u, v) ||2

is the noise power (the variance if the noise is zero-mean)

The LS filter is equivalent to the Wiener filter if we specify

S nn (u , v) =

and S ff (u , v) = 1 | P(u, v) |2

LS is better than Wiener when the noise is high or medium.

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5 Image Restoration: The Constrained Least Squares filter

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5: Geometric transformations

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

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5: Geometric transformations Spatial transformation

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5: Geometric transformations Spatial transformation

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

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5: Geometric transformations Interpolation

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5: Geometric transformations Interpolation

[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:

1 1 / 2 x 1 / 2 R0 ( x) = elsewhere 0 x + 1 1 x 0 R1 ( x) = 1 x 0 x 1 ... 2 + 1 | x |3 x 2 0 x 1 R3 ( x) = 3 1 2 3 1 x 2 6 (2 | x |) (cubic B spline)

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

Gianni Ramponi University of Trieste http://www.units.it/ramponi

Digital Image Processing

Images R.C.Gonzalez & R.E.Woods

Chapter 5: Geometric transformations Transformation + Interpolation: example

16

Vous aimerez peut-être aussi