Two-dimensional Convolution Coefficients
Two-dimensional smoothing and differentiation can also be applied to tables of data values, such as intensity values in a photographic image which is composed of a rectangular grid of pixels. The trick is transform part of the table into a row by a simple ordering of the indices of the pixels. Whereas the one-dimensional filter coefficients are found by fitting a polynomial in the subsidiary variable, z to a set of m data points. the two-dimensional coefficient are found by fitting a polynomial in subsidiary variables v and w to a set of m × m data points. The following example, for a bicubic polynomial and m = 5, illustrates the process, which parallels the process for the one dimensional case, above.
The square of 25 data values, d0 - d24
-
v -2 -1 0 1 2 w −2 d0 d1 d2 d3 d4 −1 d5 d6 d7 d8 d9 0 d10 d11 d12 d13 d14 1 d15 d16 d17 d18 d19 2 d20 d21 d22 d23 d24
becomes a vector when the rows are placed one after another.
- d=(d0, d0 ... d24)T
The Jacobian has 10 columns, one for each of the parameters a00 - a03 and 25 rows, one for each pair of v and w values. Each row has the form
The convolution coefficients are calculated as
The first row of C contains 25 convolution coefficients which can be multiplied with the 25 data values to provide a smoothed value for the central data point of the 25.
A Matlab routine for computing the coefficients is available. 3-dimensional filters can be obtained with a similar procedure.
Read more about this topic: Numerical Smoothing And Differentiation