Authors: Craig Rykal, Jeff Swanson, John Rivera, Justin Malaise, and

advertisement
Authors: Craig Rykal, Jeff Swanson,
John Rivera, Justin Malaise, and
Ben Rougier
Convolutions are a part of life, especially in the computer age. Convolutions can be used
in the smoothing of functions for integration, computer graphics, and, as in this case,
finding the diameter of stars. This paper will go over the basic definitions of functions,
the definition and reasons for convolutions, applying convolutions to computer graphics,
the relationship of convolutions to Fourier transforms, and then showing how
convolutions can help us to find the true diameter of stars.
Before we get into the exiting world of convolutions, we will first do a quick review of
functions. Functions are the basic building block of advanced mathematics. They can be
looked at as having three different definitions.
First, functions can be looked at as associating the elements in two different sets. To be a
true function each point in the domain set can only be associated with one point in the
range set. ( See Figure 1)
1
Figure 1
Figure 2
Input
f(x)
X
x
Domain
f(x
)
f
Output
f(x
)
Range
Second, functions can be looked at as a machine that takes values of x as inputs and
performs an operation on it and spits out a different value. This is what is called a logical
machine. (See Figure 2)
Third, if we use a Cartesian coordinate system, we can look at a function as a series of
points and write them as an ordered pair, i.e. (x,f(x)). This ordered pair could be placed
on a graph with axis f (x) and x as points. By linking these points we view a graphical
picture.(see Figure 3)
Figure 3
f(x)
(x3,f(x3))
(x2,f(x2))
(x1,f(x1)
)
x
2
Using a coordinate plane and using a rule to make each point on the plane a specific color
we get the basis for computer graphics. Having defined functions, we can proceed to
applications with convolutions.
Convolutions hold important properties in computer graphics, signal processing, and
image processing. For an example of what convolutions do think about numerical sets of
data, to be specific, test scores at different high schools. To compare different schools’
test scores you wouldn’t compare individual tests together because single tests do not
represent the school. Certain test scores may be very high and other tests may be very
low. Therefore an effective way to be able to compare the test scores of different schools
would be to compare the average test scores of the schools together. Therefore by
averaging the test scores you are effectively removing the unruly tests scores.
Convolutions can be thought of as a method of averaging or smoothing unruly functions.
Examples of unruly functions include functions that are not continuous or functions that
have sharp or jagged edges. These functions may need to be averaged to remove areas of
functions that are not differentiable or areas where tangent lines to that point do not exist.
By starting with the function for weighted averages (
n
j =1
λjyj
) and manipulating the
variables within the function you can receive the function for a convolution. Through this
process the weighted average function’s output is change from a numeric value to a
3
function (
n
j =1
λ j f ( x − x j ) ) and from a discrete function to a continuous function
( g (t ) f ( x − t )dt ).
R
Now take a look of a simple convolution at work. Let f be the simple function
0 for x < -h
f ( x) = 1 for − h ≤ x ≤ h
0 for h > x
0
After one convolution the function is F (t ) =
t < −2 h
for
t + 2h for − 2h ≤ t < 0
2h − t for
0 ≤ t ≤ 2h
0
2h < t
for
t < −3h
0
(t + 3h) 2 / 2
One more convolution yields the function G (t ) = − t + 3h
2
2
(t − 3h) / 2
2
0
− 3h ≤ t < − h
−h≤t <h
h ≤ t ≤ 3h
3h < t
G(t) is a continuous function. So after three convolutions the original function f(t)
becomes a continuous function G(t).
One application of the convolution is in computer graphics. When a convolution is
applied to a graphic its effect is a blurring. At times this blurring can be beneficial and
improve the quality of the graphic. At other times the blurring can be a bad thing. It can
make the graphic less clear and decrease the quality of the graphic.
4
A common problem in computer graphics is called aliasing. A computer screen is made
up of many dots called pixels. A graphic appears on the screen because the color values
of the pixels are set to represent it. Since the pixels are dots a graphic appears to have a
jagged or rough edge (see Figure 4). This is aliasing. If a convolution is applied to this
graphic the jagged edges can be blurred into looking smooth. This effect is called
antialiasing and can improve the quality of the graphic by making edges smooth (see
Figure 5).
Figure 4
Figure 5
The convolution can also lessen the quality of a graphic or image on a computer screen.
When taking a picture of space from the Earth the atmosphere performs a convolution on
the image that we see. In other words the atmosphere blurs the image (see Figure 6). A
deconvolution can be applied to the graphic to get rid of the blurring caused by the
atmosphere’s convolution. The resulting graphic is much clearer (see Figure 7).
5
Figure 6
Figure 7
The Fourier Transform can be used as an analog for functions that are not periodic, like
the Taylor Series. It also has a great importance in regard to convolutions. A Fourier
Transform of a function can be defined as a function f(t) as a line, then the Fourier
Transform of f(t) would be:
fˆ ( x ) =
∞
f (t )
−∞
e
− 2 itx π
dt
Where you calculate the integral from negative infinity to positive infinity of f(t) times e
to the negative two itxPi times dt.
The Fourier Transform can also be used to solve convolutions of a function. First a
function h must be defined as:
h ( t ) = ( f ∗ g )( t )
6
Where h(t) is equal to f convolved with g of t. Then if you perform the Fourier
Transform on h it would equal:
hˆ ( x ) = ( fˆ • gˆ )( x )
Where the Fourier Transform of h is equal the Fourier Transform of f times the Fourier
Transform of g of x.
Finally we must define the a function in the plane as f(s,t). Then the Fourier
Transform of f would be:
f ( s , t ) = fˆ ( x , y ) =
∞ ∞
−∞−∞
f (s, t) e
− 2 i(sx + ty)
dsdt
Where the s and t are substituted by x and y and the rest is same as before.
7
The idea of Convolutions can be used in a wide variety of ways.
One interesting
application is their use toward finding the diameter of a star using a photographic image.
The question is how? Well, we can all observe that when looking at a star, it appears to
be “twinkling” or maybe even “sparkly.” (see Figure 8a.) However, in reality, stars are
shaped as tiny discs. (see Figure 8b.) And the effects that cause them to look blurry are
caused by the Earth’s atmosphere. For this example, we will consider not just looking at
a star but actually considering a photograph of it. We can find the true diameter from this
photograph alone.
Figure 8a.
Image of the Star: The image that we see.
Figure 8b.
Image of the Star: The “true” image.
Studying the true image of the star is an important and integral part of this application.
The star, as stated earlier, can be viewed as a circular disc. (see Figure 9.) We’ll let x0
represent the center, and ε be the radius(1/2 the diameter). And we can represent this
circular disc with a piecewise equation:
f ( x) =
λ (x inside disc)
0
otherwise.
8
Figure 9.
ε
x0
We can also represent this disc with the following radial function:
f ( x) = λ D(
x − x0
ε
)
We use D(x) within this function that we call f(x), so it seems only generous, but to
define D(x) as the unit circle. It can be written as follows:
D( x) = 1
for x ≤ 1,
D( x) = 0
for x > 1
At this point, it is important to note that f has radial symmetry, and thus it follows that the
Fourier Transform of f has radial symmetry also.
Figure 10 describes the general “Picture.” In other words, what do we see when we look
at a photograph. Note that the center is a point source of light. Using the rays extending
from the center to represent light, we see that the further away from the point source we
get, the further apart the rays get. This represents how objects are lit with a lesser
luminous intensity the further from the light they get. In our picture, this makes x less
“bright” than y.
9
Figure 10.
Center: Point
source of light.
X
Y
This makes point
X less “bright”
than Y.
The further from the
point source you get,
the less luminous
intensity their is.
Now lets consider the photographic plate. Suppose that we photograph a point source at
time t and suppose that, without atmospheric effects, it would appear at 0 on our
photographic plate. We’ll let the picture whose “brightness” at point X on the plate is
λKt(X), be effected by the atmosphere. (here, λ is the “brightness” of our original point
source) Now lets consider that we have a second point source which has “brightness” λ’
and would appear as point Y on the plate in absence of atmospheric effects. If |Y| is very
small (i.e. the second point source is very close to the first in the sky) we would expect
light coming from it to be affected in the same way as from the first. Therefore, we
would expect a picture with “brightness” λ’Kt(X-Y).
At any time t, we’ll let Kt(X) be the apparent brightness over the true brightness. To
generalize this, lets say we have n point sources of light, λ1, λ2, … , λn, whose images
would lie at Y1, Y2, … , Yn in absence of atmospheric effects. Then we expect an image
of the form:
A(x) = " Brightness at x" =
n
j=1
λ K (X
j
t
− Y j)
10
Since we all think of light as a continuous or infinite entity, we can easily change the sum
from above to a double integral. This would replace the ‘true’ image with an ‘actual’
image. The integral is as follows:
f (Y ) K t ( X − Y )dA(Y )
Looking closely at this integral shows us a few important things. First, it is written in the
form of a Convolution, and therefore we can write it as f*Kt. We see that f(Y) is the
brightness at point Y, and Kt(X-Y) is the kernel of the convolution which can also be
considered the blurring effect of the atmosphere at some time t.
Before we find our “average” picture, we must note that Kt is NOT fixed, but actually
random due to atmospheric effects being random. Therefore, if we try to extract f from
f*Kt where Kt is random, we expect no solution. So how can we extract f from Kt?
Our first solution is to average the image received at various times. This solution will
give us the average blur. To do this, we’ll calculate Kt at various times t1, t2, …, tn. This
~
K=
1
K t( j)
j =1 n
will allow us to obtain the average blur. In particular,
n
And when we average the convolutions, we get:
1
n
n
~
1
f * K t ( j) = f *
K t( j) = f * K
j =1 n
n
j =1
Thus giving us a Convolution that we can easily extract f from.
Our second solution comes from Laybeyrie. His idea was to take the Fourier transform
of our image f*Kt which we will call φt. As stated earlier in this paper, we know from the
Convolution Theorem for Fourier Transforms that Convolutions become a multiplication.
Thus giving us the function:
∧
φ
t
∧
=f
∧
K
t
Furthermore, we’ll take a sequence of images taken at different times,
∧
φ
∧
t (1)
,φ
∧
t (2)
,φ
∧
t ( 3)
,...,φ
t (n)
11
Now we can see that the Fourier Transform of φt(j) is random due to Kt being random.
Therefore, the only zeros(roots) the Fourier Transforms of φt(j)’s will have in common
with other φt(j)‘s are the zeros of the Fourier Transform of f. In particular, let’s
superimpose the absolute value of all Fourier Transforms of φt(j). This will yield yet
another function:
n
Ω( ) =
∧
j =1
φ
t( j)
( )=
n
∧
f( )
j =1
∧
K
t( j)
Where ζ is an ordered pair in the s-t plane (s,t). Clearly, the zeros of the Fourier
Transform of f(ζ) will stand out as the zeros of Ω(ζ). Taking the absolute value
guarantees that our values are real and NOT complex.
∧
λ D(
f( )=
ℜ
x − x0
) e− 2
i x
dA( x)
2
Substitute y = x – x0,
∧
λ D(
f( )=
y
) e− 2
i ( y + x0 )
dA( y )
2
ℜ
Move out the constants,
∧
f( )=λ
− 2 i x0
e
ℜ
2
y −2
D( ) e
i y
dA( y )
Substitute w = y/ε
y = ε/w,
Notice, this is where the ε comes back into the equation. ε is what we’re looking
for!
12
∧
2
f( )=λ
−2 i x0
−2 i
e
D ( w) e
2
w
dA( w)
ℜ
You’ll notice, by the definition of Fourier Transforms defined earlier in this
paper,
ℜ
2
D( w) e
−2 i
w
∧
dA( w) = D( )
Therefore,
∧
2
f( )=λ
−2 i x0 ∧
e
D( )
Now it’s easy to see that the zeros of the Fourier Transform of f are the same as the zeros
of the Fourier Transform of D(εζ). So in order to compute the true and accurate value of
ε, we need to know the location of the rings of zeros of the Fourier Transform of D(εζ).
For the Fourier Transform of D(εζ), we’ll notice visually from our Ω picture that the
zeros occur on the circle of radius ζ = r0. However, the Fourier Transform of D(ζ) is a
well known function:
∧
D( ) =
2
J
1
( )
- where J1 is the first order Bessel function
The zeros of this function occur on the radius of ζ = r1 which can be easily found
analytically in a textbook that covers Fourier Transforms.
To finally find ε, we’ll put it all together. Since the Fourier Transform of D(εr0) is zero,
and the Fourier Transform of D(r1) is zero, it shows that εr0 = r1. Thus, our solution:
=
Is the radius of our star!
r
r
1
0
13
References
• “Fourier Analysis” by T.W. Korner, Cambridge
University Press, 1988
•
“Convolutions and Computer Graphics” by Anne M.
Burns
•
Dr. Steve Deckelman
14
Download