Image Processing Reference
In-Depth Information
This is illustrated in Figure 3.11 where a new image is calculated from an original one,
by template convolution. The calculation obtained by template convolution for the centre
pixel of the template in the original image becomes the point in the output image. Since the
template cannot extend beyond the image, the new image is smaller than the original image
since a new value cannot be computed for points in the border of the new image. When the
template reaches the end of a line, it is repositioned at the start of the next line. For a 3 ×
3 neighbourhood, nine weighting coefficients w t are applied to points in the original image
to calculate a point in the new image. To calculate the value in new image N at point with
co-ordinates x , y , the template in Figure 3.12 operates on an original image O according to:
w
O
+
w
O
+
w
O
+
0
xy
-1, -1
1
xy
, -1
2
xy
+1, -1
(3.17)
N =
w
O
+
w
O
+
w
O
+
xy
,
2,
N
- 1
xy
,
3
xy
-1,
4
xy
,
5
xy
+1 ,
w
O
+
w
O
+
w
O xy
+
6
xy
-1, +1
7
xy
,+1
8
+1, +1
X
X
Original image
New image
Figure 3.11
Template convolution process
w 0
w 1
w 2
w 3
w 4
w 5
w 6
w 7
w 8
Figure 3.12
3 ×
3 template and weighting coefficents
Note that we cannot ascribe values to the picture's borders. This is because when we place
the template at the border, parts of the template fall outside the image and we have no
information from which to calculate the new pixel value. The width of the border equals
half the size of the template. To calculate values for the border pixels, we now have three
choices:
1.
set the border to black (or deliver a smaller picture);
2.
assume (as in Fourier) that the image replicates to infinity along both dimensions and
calculate new values by cyclic shift from the far border; or
3.
calculate the pixel value from a smaller area.
Search WWH ::




Custom Search