![]() |
Архитектура Аудит Военная наука Иностранные языки Медицина Металлургия Метрология Образование Политология Производство Психология Стандартизация Технологии |
Interpolation in Fourier Space
Interpolation reduces to a simple operation in the Fourier domain. As shown by Eq. (10.45), the transfer function of an ideal interpolation ker- nel is a rectangular (box) function which is zero outside the wave num- bers that can be represented. This basic fact suggests the following interpolation procedure in Fourier space: 1.
M∆ k → M'∆ k ◦ • ∆ x = 1 → ∆ x' = 1
(10.48) M∆ k M'∆ k 2. Fill the padded area in the Fourier space with zeroes and compute an inverse Fourier transform. Theoretically, this procedure results in a perfectly interpolated im- age. Unfortunately, it has three serious drawbacks. 1. The Fourier transform of a fi nite image implies a cyclic repetition of the image both in the spatial and Fourier domain. Thus, the convo- lution performed by the Fourier transform is also cyclic. This means that at the right or left edge of the image, convolution continues with the image at the opposite side. As the real world is not periodic and interpolation masks are large, this may lead to signifi cant distortions of the interpolation even at quite large distances from the edges of the image. 2.
3. As the Fourier transform is a global transform, it can be applied only to scaling. In principle, it could also be applied to rotation and affi ne 272 10 Pixel Processing
1 g-1/2
g1/2
linear interpolation kernel
g3/2 g-2/3 b
g-1/2
g1/2
g3/2
-3/2
-1/2
1/2
-3/2
-1/2
1/2
3/2
Figure 10.17: Illustration of linear interpolation: a at x = 0, the mean of g1/2 and g− 1/2 is taken, b at x = 1/2, g1/2 is replicated.
transforms. But then the interpolation problem is only shifted from the spatial domain to the wave number domain.
Linear Interpolation Linear interpolation is the classic approach to interpolation. The inter- polated points lie on pieces of straight lines connecting neighboring grid points. In order to simplify the expression, we use in the following nor- malized spatial coordinates x˜ = x/∆ x. We locate the two grid points at − 1/2 and 1/2. This yields the interpolation equation
.g1/2 − g− 1/2Σ x˜ for |x˜ |≤ 1/2. (10.49)
By comparison of Eq. (10.49) with Eq. (10.43), we can conclude that the continuous interpolation mask for linear interpolation is
. (10.50)
Its interpolatory nature is illustrated in Fig. 10.17. The transfer function of the interpolation mask for linear interpolation, the triangle function h1(x) Eq. (10.50), is the squared sinc function (± R5)
hˆ 1 (k˜ ) = sin2 π k˜ /2. (π k˜ /2)2
1.
10.6 Interpolation† 273 2. Since hˆ 1(k˜ ) is not zero at wave numbers k˜ > 1, some spurious high wave numbers are introduced. If the continuously interpolated image is resampled, this yields moderate aliasing. The fi rst sidelobe has an amplitude of (2/3π )2 ≈ 0.045.
Hˆ 1(k˜ ) = cos π k˜ /2. (10.52)
hˆ 1(H, k˜ ) = cos π k˜ /2 + 2iH sin π k˜ /2. (10.53) In order to estimate the error in the phase shift, it is useful to compen- sate for the linear phase shift ∆ ϕ = Hπ k˜ caused by the displacement H. According to the shift theorem (Theorem 3, p. 52, ± R4), it is required to multiply Eq. (10.53) by exp(− iHπ k˜ ): Then we obtain
phase shift remains, as illustrated in Fig. 10.18. The phase shift ∆ ϕ is expressed as the position shift ∆ x of the corresponding periodic struc- ture, i. e., ∆ x = ∆ ϕ λ /2π = ∆ ϕ /(π k˜ ). Polynomial Interpolation Given the signifi cant limitations of linear interpolation as discussed in Section 10.6.3, we ask whether higher-order interpolation schemes per- form better. The basic principle of linear interpolation was that a straight line was drawn to pass through two neighboring points. In the same way, we can use a polynomial of degree P that must pass through P + 1 points with P + 1 unknown coeffi cients ap:
gr (x˜ ) = apx˜ p. (10.55) p=0 274 10 Pixel Processing
a
0.8
0.6
0.4
0.2
0
c
0.95
0.9
0.85
0.8
0.75
0.7 b
0.05
0
-0.05
-0.1
d 0.06
0.04
0.02
0
-0.02
-0.04
-0.06
-0.4 -0.2 0 0.2 0.4 e
For symmetry reasons, in case of an even number of grid points, we set their position at half-integer values
g0 1 − P /2 P 2/4 − P 3/8 ···
a0
g 1 − 1/2 1/4 − 1/8 ··· . (P− 1)/2
(10.57)
. . gP . 1 P /2 P 2/4 P 3/8 ··· aP
from which we can determine the coeffi cients of the polynomial. For a cubic polynomial (P = 3), the equations system is 10.6 Interpolation† 275 A b
0.8
0.6
0.4
0.99 1 3 0.98 5 7 0.97
0.2
0
0.96
0.95 0 0.2 0.4 0.6 0.8 ~ 1 k Figure 10.19: Transfer function of discrete polynomial interpolation fi lters to interpolate the value between two grid points. The degree of the polynomial (1 = linear, 3 = cubic, etc.) is marked on the graph. The dashed line marks the transfer function for cubic B-spline interpolation (Section 10.6.5). a The full range, b a 5 % margin below the ideal response hˆ (k˜ ) = 1.
g0 1 − 3/2 9/4 − 27/8 a0
(10.58) g2 g3 1 1/2 1/4 1/8 a2
with the solution a0
− 3 27 27 − 3 g0
. (10.59)
12 − 12 − 12 12 g2 a3 − 8 24 − 24 8 g3
Figure 10.19 shows the transfer functions for a polynomial interpo- lation of various degrees. With increasing degree P of the interpolating polynomial, the transfer function approaches the box function better. However, convergence is slow. For an accurate interpolation, we must take a large interpolation mask.
10.6.5 Spline-Based Interpolation‡ Besides its limited accuracy, polynomial interpolation has another signifi cant disadvantage. The interpolated curve is not continuous at the grid points al- ready in its fi rst derivative. This is due to the fact that for each interval between grid points another polynomial is taken. Thus, only the interpolated function is continuous at the grid points but not the derivatives. Splines avoid this disadvantage by additional constraints for the continuity of derivatives at the grid points. From the wide classes of splines, we will here dis- cuss only one class, the B-splines. As B-splines are separable, it is suffi cient to 276 10 Pixel Processing
a
0.8
0.6
0.4
0.2
0
-0.2 -2 -1 0 1 2 b 1 0.8 0.6 0.4 0.2 0 -0.2
Figure 10.20: a B-spline interpolation kernels generated by cascaded convolu- tion of the box kernel of order 0 (nearest neighbor), 1 (linear interpolation), 2 (quadratic B-spline), and 3 (cubic B-spline); b corresponding transfer functions.
β P (x˜ ) = Π ( x ˜ ) ∗. . . ∗ Π ( x ˜ ). (10.60) (P+1˛ )¸ times r
β ˆ P (kˆ ) = . si n π k/ 2 Σ . (10.61)
Figure 10.20b shows that the B-spline function does not make a suitable inter- polation function. The transfer function decreases too early, indicating that B-spline interpolation performs too much averaging. Moreover, the B-spline kernel does not meet the interpolation condition Eq. (10.46) for P > 1. B-splines can only be used for interpolation if fi rst the discrete grid points are transformed in such a way that a following convolution with the B-spline kernel restores the original values at the grid points. This transformation is known as the B-spline transformation and constructed from the following condition:
If centered around a grid point, the B-spline interpolation kernel is unequal to zero only for three grid points. The coeffi cients β 3( 1) β − 1, β 3(0) β 0, and β 3(1) β 1 are 1/6, 2/3, and 1/6. The convolution of this kernel with the unknown B-spline transform values cn should result in the original values gn at the grid points. Therefore,
g = c ∗ β 3 or gn =
1 n'.=− 1
cn+n' β n'. (10.63) 10.6 Interpolation† 277 Equation (10.63) constitutes the sparse linear equation system g0 4 1 0 ... 0 1
c0 1 .. ....
. . .. . . 1 4 1 0 cN − 1
using cyclic boundary conditions. The determination of the B-spline transfor- mation thus requires the solution of a linear equation system with N unknowns. The special form of the equation system as a convolution operation, however, allows for a more effi cient solution. In Fourier space, Eq. (10.63) reduces to
β ˆ − 1(k˜ ) = β ˆ T (k˜ ) = 1 . (10.66) 3 2/3 + 1/3 cos π k˜
Such a transfer function is a kind of recursive fi lter (Section 4.2.10) that is ap- plied fi rst in the forward and then in the backward direction with the following recursion [187]: √ ' gn' = gn − (2 − √ 3)(gn− 1 − gn)
(10.67) cn' = gn' − (2 − 3)(cn+1 − gn' ). The whole operation takes only two multiplications and four additions. The B-spline interpolation is applied after the B-spline transformation. In the continuous case, using Eqs. (10.61) and (10.66), this yields the eff ective transfer function β ˆ I (k˜ ) = sin4(π k˜ /2)/(π k˜ /2)4
We investigate this compensation at the grid points and at the intermediate points. From the equation of the cubic B-spline interpolating kernel Eq. (10.60) (see also Fig. 10.20a) the interpolation coeffi cients for the grid points and inter- mediate grid points are 1/6 [14 1] and 1/48 [1 23 23 1], (10.69) 278 10 Pixel Processing
respectively. Therefore, the transfer functions are 2/3 + 1/3 cos π k˜ and 23/24 cos(π k˜ /2) + 1/24 cos(3π k˜ /2), (10.70) respectively. At the grid points, the transfer function exactly compensates — as expected — the application of the B-spline transformation Eq. (10.66). Thus, the interpolation curve goes through the values at the grid points. At the interme- diate points the eff ective transfer function for the cubic B-spline interpolation is then β ˆ (1/2, k˜ ) = 23/24 cos(π k˜ /2) + 1/24 cos(3π k˜ /2). (10.71)
I 2/3 + 1/3 cos π k˜
It is still signifi cant with a maximum of about 0.13. This value is much too high for algorithms that ought to be accurate in the 1/100 pixel range. If no better interpolation technique can be applied, this means that the maximum wave number should be lower than 0.5. Then, the maximum shift is lower than 0.01 and the amplitude damping less than 3 %. Note that these comments on phase shifts only apply for arbitrary fractional shifts. For pixels on the intermediate grid, no position shift occurs at all. In this special case — which often occurs in image processing, for instance for pyramid computations (Chapter 5) — optimization of interpolation fi lters is quite easy because only the amplitude damping must be minimized over the wave number range of interest.
10.6.6 Optimized Interpolation‡ Filter design for interpolation — like any fi lter design problem — can be treated in a mathematically more rigorous way as an optimization problem. The general idea is to vary the fi lter coeffi cients in such a way that the derivation from the ideal transfer function reaches a minimum. For non-recursive fi lters, the transfer function is linear in the coffi cients hr:
hˆ (k˜ ) = hr fˆ r (k˜ ). (10.72) r=1 Let the ideal transfer function be hˆ I (k˜ ). Then the optimization procedure should minimize the integral
w(k˜ ). . hr fˆ r (k˜ ) − hˆ I (k˜ ). dk˜. (10.73) . r=1 . In this expression, a weighting function w(k˜ ) has been introduced which allows control over the optimization for a certain wave number range. In equation 10.6 Interpolation† 279
a 1 0.8 0.6 0.4 0.2 0
b
1.005
1
0.995
0.99
Figure 10.21: Transfer function of interpolation kernels optimized with the weighted least squares technique of Eq. (10.76) and Eq. (10.77) with R = 3 (solid line) and of Eq. (10.78) for R = 2 (dashed line). The weighting function used for the optimization is shown in a as a thin solid line; b shows a narrow sector of the plot in a for a better estimation of small deviations from ideal values.
Eq. (10.73) an arbitrary Ln-norm is included. Mostly the L2-norm is taken, which minimizes the sum of squares. For the L2-norm, the minimization problem results in a linear equation system for the R coeffi cients of the fi lter which can readily be solved: Mh = d (10.74)
ˆ 2 fˆ 1fˆ 2 ···
fˆ 1fˆ R d = hIfˆ 2 . and M = fˆ 1fˆ 2 . ˆ 2 ···
fˆ 2fˆ R
.
. .
hIfˆ R where the abbreviation 1 fˆ 1fˆ R fˆ 2fˆ R ··· ˆ 2
w(k˜ ) · eˆ (k˜ )dk˜ (10.75) for an arbitrary function e(k˜ ) has been used.
two approaches: hˆ (k˜ ) =. hr cos. 2 r − 1 π k˜ Σ (10.76)
and r=1 2 R hˆ (k˜ ) = cos. 1 π k˜ Σ +. hr cos. 2 r − 3 π k˜ Σ − cos. 1 π k˜ Σ . (10.77) 2 r=2 2 2
280 10 Pixel Processing
be one minus the sum of all others. Equation Eq. (10.76) does not apply this constraint. Figure 10.21 compares the optimal transfer functions with both approaches for R = 3. The fi lters are signifi cantly better than those obtained by polynomial and cu- bic B-spline interpolation (Fig. 10.19). The additional degree of freedom for Eq. (10.76) leads to signifi cantly better solutions for the wave number range where the weighting function is maximal. Even better interpolation masks can be obtained by using a combination of non- recursive and recursive fi lters, as with the cubic B-spline interpolation: R cos.1/2 π k˜ Σ +. hr Σ cos.(2r − 3)/2 π k˜ Σ − cos.1/2 π k˜ Σ Σ
hˆ (k˜ ) = r=2 1 − α + α cos.π k˜ Σ . (10.78)
With recursive fi lters, the least squares optimization becomes nonlinear be- cause hˆ (k˜ ) in Eq. (10.78) is nonlinear in the parameter α of the recursive fi lter. Then, iterative techniques are required to solve the optimization problem. Fig- ure 10.21c, d shows the transfer functions for R = 2. A more detailed discussion of interpolation fi lters including tables with optimized fi lters can be found in Jä hne [81].
10.6.7 Fast Algorithms for Geometric Transforms‡ With the extensive discussion on interpolation we are well equipped to devise fast algorithms for the diff erent geometric transforms. Basically, all fast in- terpolation algorithms use the following two principles: effi cient computation employing the interpolation coeffi cients and partition into 1-Dgeometric trans- forms. First, many computations are required to compute the interpolation coeffi cients for fractional shifts. For each shift, diff erent interpolation coeffi cients are re- quired. Thus we must devise the transforms in such a way that we need only constant shifts for a certain pass of the transform. If this is not possible, it might still be effi cient to precompute the interpolation coeffi cients for diff erent fractional shifts and to save them for later usage. Second, we learnt in Section 10.6.1 that interpolation is a separable procedure. Taking advantage of this basic fact considerably reduces the number of opera- tions. In most cases it is possible to separate the two- and higher dimensional geometric transforms into a series of 1-Dtransforms.
10.7 Further Readings‡ Holst [70, 72] and Biberman [7] deal with radiometric calibration of sensors and cameras in the visible and infrared. A detailed discussion of interpola- tion fi lters including tables with fi lter coeffi cients and effi cient algorithms for geometric transforms can be found in Jä hne [81, Chap. 8]. Readers interested in the mathematical background of interpolation are referred to Davis [25] and Lancaster and Salkauskas [103]. Wolberg [200] expounds geometric transforms.
Part III Feature Extraction
Averaging Introduction In this chapter we will discuss neighborhood operations for performing the elementary task of averaging. This operation is of central importance for low-level image processing. It is one of the building blocks for the more complex feature extraction operators discussed in Chapters 13–15. In the simplest case, objects are identifi ed as regions of constant radiance, i. e., gray values. Then, averaging gives adequate mean values of the gray values within the object. This approach, of course, implies a simple model of the image content. The objects of interest must indeed be characterized by constant gray values that are clearly diff erent from the background and/or other objects. However, this assumption is seldom met in real-world applications. The intensities will generally show some variations. These variations may be an inherent feature of the object or could be caused by the image formation process. Typical cases are noise, a non-uniform illumination, or inhomogeneous background. In complex cases, it is not possible to distinguish objects from the background with just one feature. Then it may be a valid approach to compute more than one feature image from one and the same image. This results in a multicomponent or vectorial feature image. The same situation arises when more than one image is taken from a scene as with color images or any type of multispectral image. There- fore, the task of averaging must also be applied to vectorial images. In image sequences, averaging is extended into the time coordinate to a spatiotemporal averaging.
|
Последнее изменение этой страницы: 2019-05-04; Просмотров: 239; Нарушение авторского права страницы