Graphics Reference
In-Depth Information
Inline Exercise 18.1: (a) Pause briefly and examine that definition carefully.
It's central to much of the remainder of this topic.
(b) Perform the substitution s = t
x , ds =
dx in the integral of Equation 18.8
to confirm that ( f
g )( t )=( g
f )( t ) .
We can say that image capture by our digital camera consists of convolving the
incoming light with the “flipped” sensor response function M , and then restricting
to the integer lattice Z
Z .
In almost all cases that we study, one of the functions f or g will be an even
function, and hence the negation has no consequence at all. The two-dimensional
convolution is defined very similarly. If f , g : R 2
×
R are two functions on R 2 ,
then
g )( s , t )=
−∞
( f
f ( x , y ) g ( s
x , t
y ) dx dy .
(18.9)
−∞
Convolution is also defined for two periodic functions of period P , but with
the domain of integration replaced by any interval of length P .
Convolution can also be applied to discrete signals, that is, to a pair of func-
tions f , g : Z
R ; the definition is almost identical, except for the replacement
of the integral with a summation:
( f
g )( i )=
f ( j ) g ( i
j ) ,
for i
Z ,
(18.10)
j =
−∞
with an analogous definition for functions of two variables. If f , g : Z
×
Z
R ,
then
( f
g )( i , j )=
f ( k , p ) g ( i
k , j
p ) ,
f r i , j
Z .
(18.11)
k = −∞
p = −∞
As an application of this kind of convolution, imagine that you have an image
that is in very sharp focus, but you want to use it as a background for a composition
in which it should appear out of focus, while the foreground objects should be in
focus. One way to do this is to replace each pixel with an average of itself and its
eight neighbors. Figure 18.18 shows the results on a small example. On a larger
image, you might want to “blur” with a much larger block of ones, to achieve any
noticeable effect. If we call f ( i , j ) the value of the original image pixel at ( i , j ) ,
and let g ( i , j )= 1for
111
111
111
1
i , j
1, and 0 otherwise, then the blurred-image
pixel at ( i , j ) is exactly ( f
g )( i , j ) . Notice, too, that the function g that we used
in the blurring has the property that g ( i , j )= g (
=
j ) , that is, it's symmetric
about the origin, hence the negative sign in the definition of convolution is of no
consequence.
i ,
×
Figure 18.18: A 32
32 image is
The process we've just described is usually called filtering f with the filter
g , where the function that's nonzero only on a small region is called the “filter.”
Because convolution is symmetric, the roles can be reversed, however, and we'll
have occasion to convolve with “filters” that are nonzero arbitrarily far out on the
real line or the integers.
convolved with a 3
×
3 block of 1 s
to blur the image.
 
 
Search WWH ::




Custom Search