AntialiasingAntialiasing
CptS 548
Advanced Computer Graphics
John C. Hart
AliasingAliasing
Aliasing occurs when signals are poorly sampled, giving the illusion of a lower frequency signal
ImagesImages
• 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(x2 + y2)
• Digital image– 2-D array of uniformly spaced color values– e.g. framebuffer
Image TransformationsImage Transformations
SymbolicImage
RenderingDigitalImage
AnalogImage
DisplaySystem
AnalogImage
ScanningDigitalImage
AnalogImage
DisplaySystem
Sampling and ReconstructionSampling and Reconstruction
SymbolicImage
SamplingContinuous
ImageDiscreteSamples
Reconstruction
1-D Fourier1-D FourierTransformTransform• 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)
dujuxuFxI
dxjuxxIuF
)exp()(2
1)(
)exp()(2
1)(
)/arctan(arg
sincos)exp(
1
22
2
abbja
babja
uxjuxjux
j
I
x
F
u0
p 1/p
ConvolutionConvolution
• Convolution of square wave with square wave yields triangle wave
• f*g FG
• fg F*G
dssthsgthg )()())(*(
Low Pass FilteringLow 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
SamplingSampling
p 1/p
I(x)
s(x)
(Is)(x)
(Is’)(x)
s’(x)
F(u)
S(u)
(F*S)(u)
S’(u)
(F*S’)(u)
Shannon Sampling TheoremShannon 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 Transform2-D Fourier Transform
dxdyvyuxjvuFyxI
dxdyvyuxjyxIvuF
))(exp(),(2
1),(
))(exp(),(2
1),(
fy
fx
I(x,y)
Perfect SamplingPerfect Sampling
Imperfect SamplingImperfect Sampling
Antialiasing StrategiesAntialiasing 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 TracingAntialiased Ray Tracing
• Cast a fat ray
• Cast a ray into a blurred object
• Cast lots of rays
Cone TracingCone Tracing
• Amanatides SIGGRAPH 84
• Replace rays with cones
• Cone samples pixel area
• Intersect cone with objects
• Analytic solutions similar to ray tracing
• Expensive
Beam TracingBeam 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
CoversCovers
Uniform SamplingUniform Sampling
• Trace at higher resolution, average results
• Does not eliminate Moire patterns
• Pushed aliases into higher frequencies
Jitter SamplingJitter 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 JitterUniform 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
PoissonPoisson
• 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 SamplingAdaptive 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
ReconstructionReconstruction
nn
nnn
xxk
xgxxkxg
)(
)()()(
g(x1)
g(x2)g(x3)
g(x4)
k
Sampled image product ofsampling function and imagefunction
Convolve a kernel functionwith the sampled image
Top Related