Antialiasing CptS 548 Advanced Computer Graphics John C. Hart
Aliasing Aliasing occurs when signals are poorly sampled, giving the illusion of a lower frequency signal
Images Analog image –2-D region of varying color –e.g. optical image, electrical monitor signal Symbolic image –Any function of two real variables –e.g. sin(x 2 + y 2 ) Digital image –2-D array of uniformly spaced color values –e.g. framebuffer
Image Transformations Symbolic Image Rendering Digital Image Analog Image Display System Analog Image Scanning Digital Image Analog Image Display System
Sampling and Reconstruction Symbolic Image Sampling Continuous Image Discrete Samples Reconstruction
1-D Fourier Transform Makes any signal I(x) out of sine waves Converts time domain into frequency domain Yields spectrum F(u) of frequencies F(0) = “DC term,” average of signal F(-u) = F(u) I x F u 0 p 1/p
Convolution Convolution of square wave with square wave yields triangle wave f*g FG fg F*G
Low Pass Filtering Fourier transform of a box function is a sinc function Convolution with a sinc function is an ideal low pass filter Multiplies high frequencies by zero
Sampling p 1/p I(x)I(x) s(x)s(x) (Is)(x) (Is’)(x) s’(x) F(u)F(u) S(u)S(u) (F*S)(u) S’(u) (F*S’)(u)
Shannon Sampling Theorem A signal whose spectrum has no energy above frequency f can be recovered with samples at a rate of 2f or more
2-D Fourier Transform fyfy fxfx I(x,y)
Perfect Sampling
Imperfect Sampling
Antialiasing Strategies Prefiltering –Decrease the image frequency –Remove image frequencies higher than one-half the sampling frequency –Blur the image before sampling Postfiltering –Increase the sampling frequency –Take more samples than pixels –Blur the image after sampling
Antialiased Ray Tracing Cast a fat ray Cast a ray into a blurred object Cast lots of rays
Cone Tracing Amanatides SIGGRAPH 84 Replace rays with cones Cone samples pixel area Intersect cone with objects Analytic solutions similar to ray tracing Expensive
Beam Tracing Heckbert & Hanrahan SIGGRAPH 84 Replace rays with pyramids Intersection with polygonal scenes –Plane-plane intersections easy, fast –Existing scan conversion antialiasing Can perform some recursive beam tracing –Scene transformed to new viewpoint –Result clipped to reflective polygon
Covers
Uniform Sampling Trace at higher resolution, average results Does not eliminate Moire patterns Pushed aliases into higher frequencies
Jitter Sampling Pick n random points in pixel Disguises aliases as noise Inhibits Moire patterns Distribution uneven, biased Reintroduces high frequencies Sampling function adds energy to spectum
Uniform Jitter Subdivide pixel into uniform regions Pick random location within region Sampling function adds little energy to spectrum Distribution retains some order Reintroduces some Moire effects
Poisson Random points a given distance (or farther) apart Inhibits Moire patterns Sampling function adds little energy to spectrum Works well for the monkeys Poisson disk – use dart throwing algorithm
Adaptive Stochastic Sampling Add more samples in high variance regions Add any number of jitter samples Uniform jitter a quadtree Uniform jitter a k-d tree (subdivide larger region) Add Poisson samples (slow) Precompute multiple-res Poisson patterns
Reconstruction g(x1)g(x1) g(x2)g(x2) g(x3)g(x3) g(x4)g(x4) k Sampled image product of sampling function and image function Convolve a kernel function with the sampled image