However, if fast transformalgorithms, similar in structure to the fast Fourier transform, are employed, general-ized linear filtering will be more efficient than direct processing if the
Trang 19
LINEAR PROCESSING TECHNIQUES
Most discrete image processing computational algorithms are linear in nature; anoutput image array is produced by a weighted linear combination of elements of aninput array The popularity of linear operations stems from the relative simplicity ofspatial linear processing as opposed to spatial nonlinear processing However, forimage processing operations, conventional linear processing is often computation-ally infeasible without efficient computational algorithms because of the largeimage arrays This chapter considers indirect computational techniques that permitmore efficient linear processing than by conventional methods
9.1 TRANSFORM DOMAIN PROCESSING
Two-dimensional linear transformations have been defined in Section 5.4 in seriesform as
Digital Image Processing: PIKS Inside, Third Edition William K Pratt
Copyright © 2001 John Wiley & Sons, Inc.ISBNs: 0-471-37407-5 (Hardback); 0-471-22132-5 (Electronic)
Trang 2Figure 9.1-1 is a block diagram of the indirect computation technique called
gen-eralized linear filtering (1) In the process, the input array undergoes atwo-dimensional unitary transformation, resulting in an array of transform coeffi-cients Next, a linear combination of these coefficients is taken according
to the general relation
(9.1-3)
where represents the linear filtering transformation function.Finally, an inverse unitary transformation is performed to reconstruct the processedarray If this computational procedure is to be more efficient than directcomputation by Eq 9.1-1, it is necessary that fast computational algorithms exist forthe unitary transformation, and also the kernel must be reasonablysparse; that is, it must contain many zero elements
The generalized linear filtering process can also be defined in terms of
vector-space computations as shown in Figure 9.1-2 For notational simplicity, let N1 = N2
= N and M1 = M2 = M Then the generalized linear filtering process can be described
by the equations
(9.1-4a)(9.1-4b)(9.1-4c)
FIGURE 9.1-1 Direct processing and generalized linear filtering; series formulation.
Trang 3TRANSFORM DOMAIN PROCESSING 215
where is a unitary transform matrix, T is a linear filteringtransform operation, and is a unitary transform matrix From
Eq 9.1-4, the input and output vectors are related by
(9.1-5)
Therefore, equating Eqs 9.1-2 and 9.1-5 yields the relations between T and T given
by
(9.1-6a)(9.1-6b)
If direct processing is employed, computation by Eq 9.1-2 requires ations, where is a measure of the sparseness of T With the generalized
oper-linear filtering technique, the number of operations required for a given operator are:
Trang 4where is a measure of the sparseness of T If and direct unitarytransform computation is performed, it is obvious that the generalized linear filter-ing concept is not as efficient as direct computation However, if fast transformalgorithms, similar in structure to the fast Fourier transform, are employed, general-ized linear filtering will be more efficient than direct processing if the sparsenessindex satisfies the inequality
(9.1-7)
In many applications, T will be sufficiently sparse such that the inequality will be
satisfied In fact, unitary transformation tends to decorrelate the elements of T
caus-ing T to be sparse Also, it is often possible to render the filter matrix sparse bysetting small-magnitude elements to zero without seriously affecting computationalaccuracy (1)
In subsequent sections, the structure of superposition and convolution operators
is analyzed to determine the feasibility of generalized linear filtering in these cations
appli-9.2 TRANSFORM DOMAIN SUPERPOSITION
The superposition operations discussed in Chapter 7 can often be performed moreefficiently by transform domain processing rather than by direct processing Figure
9.2-1a and b illustrate block diagrams of the computational steps involved in direct finite area or sampled image superposition In Figure 9.2-1d and e, an alternative
form of processing is illustrated in which a unitary transformation operation is
per-formed on the data vector f before multiplication by a finite area filter matrix D orsampled image filter matrix B An inverse transform reconstructs the output vector.From Figure 9.2-1, for finite-area superposition, because
Trang 5TRANSFORM DOMAIN SUPERPOSITION 217
FIGURE 9.2-1 Data and transform domain superposition.
Trang 6Direct sampled image superposition requires on the order of operations, and
the corresponding sparseness index of B is
(9.2-3b)
Figure 9.2-1f is a block diagram of a system for performing circulant superposition
by transform domain processing In this case, the input vector kE is the extended
cor-ner of a array of zeros and then column scanning the resultant matrix ing the same reasoning as above, it is seen that
Follow-(9.2-4a)
and hence,
(9.2-4b)
As noted in Chapter 7, the equivalent output vector for either finite-area or sampled
image superposition can be obtained by an element selection operation of kE Forfinite-area superposition,
Trang 7TRANSFORM DOMAIN SUPERPOSITION 219
Also, the matrix form of the output for finite-area superposition is related to theextended image matrix KE by
(9.2-6a)
For sampled image superposition,
(9.2-6b)
The number of computational operations required to obtain kE by transform domain
processing is given by the previous analysis for M = N = J.
Direct transformation
Fast transformation:
If C is sparse, many of the filter multiplication operations can be avoided.From the discussion above, it can be seen that the secret to computationally effi-cient superposition is to select a transformation that possesses a fast computationalalgorithm that results in a relatively sparse transform domain superposition filtermatrix As an example, consider finite-area convolution performed by Fourierdomain processing (2,3) Referring to Figure 9.2-1, let
(9.2-7)
where
with
for x, y = 1, 2, , K Also, let denote the vector representation of the
extended spatially invariant impulse response array of Eq 7.3-2 for J = K The
Fou-rier transform of is denoted as
Trang 8Then, it can be shown, after considerable manipulation, that the Fourier transformdomain superposition matrices for finite area and sampled image convolution can bewritten as (4)
Now, consider circulant area convolution in the transform domain Following theprevious analysis it is found (4) that the circulant area convolution filter matrixreduces to a scalar operator
(9.2-13)
Thus, as indicated in Eqs 9.2-10 to 9.2-13, the Fourier domain convolution filtermatrices can be expressed in a compact closed form for analysis or operational stor-age No closed-form expressions have been found for other unitary transforms.Fourier domain convolution is computationally efficient because the convolution
operator C is a circulant matrix, and the corresponding filter matrix CCCC is of diagonalform Actually, as can be seen from Eq 9.1-6, the Fourier transform basis vectors
are eigenvectors of C (5) This result does not hold true for superposition in general,
nor for convolution using other unitary transforms However, in many instances, thefilter matrices D, B, and C are relatively sparse, and computational savings canoften be achieved by transform domain processing
Trang 9FAST FOURIER TRANSFORM CONVOLUTION 221
Figure 9.2-2 shows the Fourier and Hadamard domain filter matrices for the threeforms of convolution for a one-dimensional input vector and a Gaussian-shapedimpulse response (6) As expected, the transform domain representations are muchmore sparse than the data domain representations Also, the Fourier domaincirculant convolution filter is seen to be of diagonal form Figure 9.2-3 illustrates thestructure of the three convolution matrices for two-dimensional convolution (4)
9.3 FAST FOURIER TRANSFORM CONVOLUTION
As noted previously, the equivalent output vector for either finite-area or sampledimage convolution can be obtained by an element selection operation on the
extended output vector kE for circulant convolution or its matrix counterpart KE
FIGURE 9.2-2 One-dimensional Fourier and Hadamard domain convolution matrices.
(b) Sampled data convolution
Signal Fourier Hadamard
(a) Finite length convolution
(c) Circulant convolution
Trang 10This result, combined with Eq 9.2-13, leads to a particularly efficient means of volution computation indicated by the following steps:
con-1 Embed the impulse response matrix in the upper left corner of an all-zero
matrix, for finite-area convolution or for sampledinfinite-area convolution, and take the two-dimensional Fourier trans-form of the extended impulse response matrix, giving
FIGURE 9.2-3 Two-dimensional Fourier domain convolution matrices.
Spatial domain Fourier domain
(a) Finite-area convolution
(b) Sampled image convolution
(c) Circulant convolution
Trang 11FAST FOURIER TRANSFORM CONVOLUTION 223
(9.3-1)
2 Embed the input data array in the upper left corner of an all-zero matrix, and take the two-dimensional Fourier transform of the extendedinput data matrix to obtain
tion, the bottom and right-hand-side strip of output elements will be missing If the
computation is performed with J = M, the output array will be completely filled with the correct terms for D-type convolution To force J = M for B-type convolution, it is
necessary to truncate the bottom and right-hand side of the input array As a quence, the top and left-hand-side elements of the output array are erroneous
Trang 12Figure 9.3-2 illustrates the Fourier transform convolution process with properzero padding The example in Figure 9.3-3 shows the effect of no zero padding Inboth examples, the image has been filtered using a uniform impulseresponse array The source image of Figure 9.3-3 is pixels The sourceimage of Figure 9.3-2 is pixels It has been obtained by truncating the bot-tom 10 rows and right 10 columns of the source image of Figure 9.3-3 Figure 9.3-4shows computer printouts of the upper left corner of the processed images Figure
9.3-4a is the result of finite-area convolution The same output is realized in Figure 9.3-4b for proper zero padding Figure 9.3-4c shows the wraparound error effect for
no zero padding
In many signal processing applications, the same impulse response operator isused on different data, and hence step 1 of the computational algorithm need not berepeated The filter matrix HE may be either stored functionally or indirectly as acomputational algorithm Using a fast Fourier transform algorithm, the forward andinverse transforms require on the order of operations each The scalarmultiplication requires operations, in general, for a total of opera-tions For an input array, an output array, and an impulseresponse array, finite-area convolution requires operations, and sampledimage convolution requires operations If the dimension of the impulse
response L is sufficiently large with respect to the dimension of the input array N,
Fourier domain convolution will be more efficient than direct convolution, perhaps
by an order of magnitude or more Figure 9.3-5 is a plot of L versus N for equality
FIGURE 9.3-1 Wraparound error effects.
Trang 13FAST FOURIER TRANSFORM CONVOLUTION 225
FIGURE 9.3-2 Fourier transform convolution of the candy_502_luma image with
proper zero padding, clipped magnitude displays of Fourier images
Trang 14FIGURE 9.3-3 Fourier transform convolution of the candy_512_luma image with
improper zero padding, clipped magnitude displays of Fourier images
Trang 15FAST FOURIER TRANSFORM CONVOLUTION 227
between direct and Fourier domain finite area convolution The jaggedness of the
plot, in this example, arises from discrete changes in J (64, 128, 256, ) as N
increases
Fourier domain processing is more computationally efficient than direct ing for image convolution if the impulse response is sufficiently large However, ifthe image to be processed is large, the relative computational advantage of Fourierdomain processing diminishes Also, there are attendant problems of computational
process-FIGURE 9.3-4 Wraparound error for Fourier transform convolution, upper left
corner of processed image
0.006 0.011 0.017 0.023 0.028 0.034 0.040 0.045 0.051 0.056 0.062 0.062 0.062 0.061 0.061
0.007 0.014 0.020 0.027 0.034 0.041 0.048 0.054 0.061 0.068 0.074 0.074 0.074 0.074 0.074
0.008 0.016 0.024 0.032 0.040 0.048 0.056 0.064 0.071 0.079 0.087 0.086 0.086 0.086 0.086
0.009 0.018 0.027 0.036 0.045 0.054 0.064 0.073 0.081 0.090 0.099 0.099 0.099 0.098 0.098
0.010 0.021 0.031 0.041 0.051 0.061 0.072 0.082 0.092 0.102 0.112 0.111 0.111 0.110 0.110
0.011 0.023 0.034 0.046 0.057 0.068 0.080 0.091 0.102 0.113 0.124 0.124 0.123 0.123 0.122
0.013 0.025 0.038 0.050 0.063 0.075 0.088 0.100 0.112 0.124 0.136 0.136 0.135 0.135 0.134
0.013 0.025 0.038 0.051 0.063 0.076 0.088 0.100 0.112 0.124 0.137 0.136 0.135 0.135 0.134
0.013 0.026 0.038 0.051 0.063 0.076 0.088 0.100 0.112 0.125 0.137 0.136 0.135 0.135 0.134
0.013 0.026 0.039 0.051 0.064 0.076 0.088 0.100 0.113 0.125 0.137 0.136 0.135 0.135 0.134
0.013 0.026 0.039 0.051 0.064 0.076 0.088 0.101 0.113 0.125 0.137 0.136 0.135 0.134 0.134
0.006 0.011 0.017 0.023 0.028 0.034 0.040 0.045 0.051 0.056 0.062 0.062 0.062 0.061 0.061
0.007 0.014 0.020 0.027 0.034 0.041 0.048 0.054 0.061 0.068 0.074 0.074 0.074 0.074 0.074
0.008 0.016 0.024 0.032 0.040 0.048 0.056 0.064 0.071 0.079 0.087 0.086 0.086 0.086 0.086
0.009 0.018 0.027 0.036 0.045 0.054 0.064 0.073 0.081 0.090 0.099 0.099 0.099 0.098 0.098
0.010 0.021 0.031 0.041 0.051 0.061 0.072 0.082 0.092 0.102 0.112 0.111 0.111 0.110 0.110
0.011 0.023 0.034 0.046 0.057 0.068 0.080 0.091 0.102 0.113 0.124 0.124 0.123 0.123 0.122
0.013 0.025 0.038 0.050 0.063 0.075 0.088 0.100 0.112 0.124 0.136 0.136 0.135 0.135 0.134
0.013 0.025 0.038 0.051 0.063 0.076 0.088 0.100 0.112 0.124 0.137 0.136 0.135 0.135 0.134
0.013 0.026 0.038 0.051 0.063 0.076 0.088 0.100 0.112 0.125 0.137 0.136 0.135 0.135 0.134
0.013 0.026 0.039 0.051 0.064 0.076 0.088 0.100 0.113 0.125 0.137 0.136 0.135 0.135 0.134
0.013 0.026 0.039 0.051 0.064 0.076 0.088 0.101 0.113 0.125 0.137 0.136 0.135 0.134 0.134
0.479 0.452 4.426 0.399 0.374 0.350 0.326 0.301 0.275 0.247 0.218 0.216 0.213 0.209 0.204
0.407 0.385 0.365 0.344 0.324 0.305 0.286 0.266 0.246 0.225 0.202 0.200 0.198 0.195 0.192
0.334 0.319 0.304 0.288 0.274 0.260 0.246 0.232 0.218 0.203 0.186 0.185 0.183 0.181 0.179
0.260 0.252 0.243 0.234 0.225 0.217 0.208 0.200 0.191 0.182 0.172 0.171 0.169 0.168 0.166
0.187 0.185 0.182 0.180 0.177 0.174 0.172 0.169 0.166 0.163 0.159 0.158 0.157 0.156 0.155
0.113 0.118 0.122 0.125 0.129 0.133 0.136 0.139 0.142 0.145 0.148 0.147 0.146 0.145 0.144
0.040 0.050 0.061 0.071 0.081 0.091 0.101 0.110 0.119 0.128 0.136 0.136 0.135 0.135 0.134
0.036 0.047 0.057 0.067 0.078 0.088 0.098 0108 0.118 0.127 0.137 0.136 0.135 0.135 0.134
0.034 0.044 0.055 0.065 0.076 0.086 0.096 0.107 0.117 0.127 0.137 0.136 0.135 0.135 0.134
0.033 0.044 0.055 0.065 0.075 0.085 0.096 0.106 0.116 0.127 0.137 0.136 0.135 0.135 0.134
0.034 0.045 0.055 0.065 0.075 0.086 0.096 0.106 0.116 0.127 0.137 0.136 0.135 0.134 0.134
(a) Finite-area convolution
(b) Fourier transform convolution with proper zero padding
(c) Fourier transform convolution without zero padding