What’s Your Function? Convolution jct. The Team: Jeff Swanson John Rivera Craig Rykal Justin Malaise Ben Rougier Brief Overview • Functions: Basic Definitions • Convolutions: Definition and reasons for • Applying Convolutions to Computer Graphics • Fourier Transforms: Uses and relationship to Convolutions • Applying Convolutions to the viewing of stars Functions: Basic Definitions f(x) x • Association f(x) Domain Range Input x f Output f(x) • Logical Machine Functions: Basic Definitions f(x) • Sets (x3,f(x3)) (x2,f(x2)) of Ordered Pairs • Graphical (x1,f(x1)) Picture x • Computer Graphics Convolutions F (t ) f ( x)k (t x)dx R Convolutions can be thought of as a method of averaging unruly functions. Unruly Functions include: • Discontinuous functions • Functions with sharp or jagged edges Origin of Convolutions Weighted Averages n y j 1 j j Substitute y f (x) into the equation to receive n j 1 j f (x j ) n We need j 1 j f ( x j ) to return a function Therefore we create a new equation n j 1 Which returns a new function f ( x x ) j j One more substitution of j g(x j ) Gives us the equation: n g(x ) f (x x ) j 1 j j This equation will give us a new discrete function Discrete Functions to Continuous For the new function to be useful to us it must be in a continuous form To accomplish this, change the function to an integration This gives us: g ( x ) f ( x x ) dt j j R Which is a Convolution! Examples Take the function 0 for x -h f ( x) 1 for h x h 0 for h x Convolve the function with itself to receive the new function 0 t 2h F (t ) 2 h t 0 for t 2h for 2h t 0 for for 0 t 2h 2h t One more convolution gives use the continuous function 0 2 ( t 3 h ) /2 G (t ) t 2 3h 2 (t 3h) 2 / 2 0 t 3h 3h t h ht h h t 3h 3h t Convolutions of multi-dimensional functions Convolutions are also useful in smoothing functions of more than one dimension The convolution of a two dimensional function is expressed as: F (s, t ) f ( x, y)k (s x, t y)dxdy RR When represented by pictures the effects of convolutions on two dimensional functions can be easily seen: Function Convolution Applying Convolutions to Computer Graphics How Convolutions Effect Graphics • Blurring of graphics •Positive Blurring •Negative Blurring Blurring Has Positive Effect • Aliasing • Antialiasing Blurring Has Negative Effect Blurred Deconvolution Fourier Transforms The Fourier Transform can be used as an Analog for functions that are not Periodic, like the Taylor Series. It also has great importance in its relation to Convolutions. Definition of a Fourier Transform Define a function f(t) then the Fourier Transform of f on R is ˆf ( x) 2 itx f (t ) e dt Fourier Transforms Related to Convolutions First define a function h as f convolved with g: h(t ) ( f g )(t ) Then the Fourier Transform of h is: ˆh( x) ( fˆ gˆ )( x) Fourier Transforms on 2 R : f(s,t) The Fourier Transform of f(s,t) on the plane would be represented by: fˆ ( x, y ) 2 πi(sx ty) f ( s, t ) e dsdt Application: The Diameter of a Star How can we find it using Convolutions? THE PROBLEM • Can we find an accurate calculation of the diameter using a photograph of the star? • Atmospheric effects cause stars to appear to us as ‘twinkling’ patches of light. • A true photograph should show them as tiny discs. Viewing the star: WE SEE: TRUE IMAGE(shape): THE STAR(true image): x0 (x inside disc) f ( x) otherwise. 0 f ( x) D( x x0 ) Where D(x) is the equation of the unit circle, And is defined as follows D( x) 1 for x 1, D( x) 0 for x 1 Since f has radial symmetry, it follows that the fourier transform of f has radial symmetry also!! Center: Point source of light. X Y The further from the point source you get, the less luminous intensity their is. This makes point X less “bright” than Y because it’s affected by less light. The Photographic Plate X-Y O || Y || X Y Let : “Brightness” at O ': “Brightness” at Y K t ( X ) : “Brightness” at X ' K t ( X Y ) : “Brightness” at X-Y K t ( X ) : Apparent Brightness (At time t) True Brightness We Get: n A(x) " Brightness at x" j K t ( X Y j ) , ,..., n 1 Y ,Y 1 j1 2 2 “Brightness” of Yj given point sources ,...,Y n Images(in absence of atmospheric effects) ||Y || ,||Y || ,...,||Y ||n 1 2 Given are very small Discrete to Continuous Since we think of light as a continuous entity, We can easily change n K ( X j 1 j t Y j) To f (Y ) K t ( X Y )dA(Y ) This replaces a ‘TRUE IMAGE’ with an ‘ACTUAL IMAGE’. TRUE IMAGE(brightness) = f(x) ACTUAL IMAGE = f*Kt Continuous form in Detail The Convolution: f *Kt = f (Y ) K t ( X Y )dA(Y ) Where f (Y ) : Kt (X Y) : dA(Y ) : Brightness at point Y Blurring effect(kernel) of the atmosphere at time t. Integrate with respect to Y THE PROBLEM i. Atmospheric Effects cause Kt to be RANDOM. ii. How can we calculate an accurate representation of this? iii. How does this Blurring Kernel tell us about ? THE SOLUTION(S) 1. Average the image received at various times. This will give us the Average Blur. 2. Use the Convolution Theorem for Fourier Transforms 1. Averaging Kt: Average the image received at various times, t (1), t (2), t (3),..., t (n) This will give a fixed Kt or the “Average Blur”: ~ 1 K K n j 1 n : AVERAGE BLUR t( j) Averaging the Convolutions, n 1 n ~ 1 f * K t( j) f * K t( j) f * K n j 1 j 1 n 2. Using the Convolution Theorem for Fourier Transforms. Laybeyrie’s idea is as follows: Take the FOURIER TRANSFORM of our image(convolution): t f * Kt The Above convolution becomes a multiplication under the Convolution Theorem for Fourier Transforms: t f K t Furthermore, if we take the sequence t (1) , t ( 2) , t ( 3) ,..., t ( n) We see t( j) is RANDOM, due to Kt being RANDOM. Therefore, the only zeros(roots) the t ( j )‘s Will have in common with all other ‘s t( j) Are the zeros of f by t f K t Superimposing t( j) forms n (ζ) j 1 n t( j) (ζ) f (ζ) j 1 K t( j) - Where z is an ordered pair in the s,t plane (s,t) Clearly the zeros of f (ζ ) Will stand out as the zeros of (ζ ) This is our “average” picture!!! ***Using the ABSOLUTE VALUE signs guarantees that our values are real and NOT complex. ^ The ZERO’s of f x x0 2 π iζ x f (ζ ) D( )e dA( x) ε 2 Substitute y = x – x0 y 2π i( y x ) f (ζ ) D( ) e dA( y ) ε 2 0 Move out the constants f (ζ ) 2 π i ζ x0 e y 2 π iζ y 2 D( ε ) e dA( y) w = y/ Substitute y = w f (ζ ) 2 π i ζ x0 εe 2 2 π iζ ε w D(w) e dA( w) 2 You’ll notice, by the definition of Fourier Transforms 2 π iζ ε w D(w) e dA( w) D(εζ) 2 So f (ζ ) 2 π i ζ x0 εe 2 D(εζ) We see that the zeros of f (ζ ) Are the same as the zeros of D(εζ) TO COMPUTE , we need to know the location of the rings of zeros of D(εζ) HOW? D(εζ) The zeros occur on the circle of radius z = r0, i.e. When z = r0 D (εζ ) 0 Which should be visually evident from our picture. It’s well known, D (ζ ) 2π J 1 ( ζ ) ζ - Where J1 is the first order Bessel function BUT! The zeros of D(ζ) Occur on the circle of radius z = r1 i.e. D (ζ ) 0 r1 can be found analytically. When z = r1 Finally finding So If D(ε r0) 0 and D(r1) 0 then ε r r 0 And thus r ε r 1 0 1 Thank you for your cooperation. References • “Fourier Analysis” by T.W. Korner, Cambridge University Press, 1988 • “Convolutions and Computer Graphics” by Anne M. Burns, • Dr. Steve Deckelman