aliasing and antialiasing - unc charlotteanti-aliasing techniques prefiltering (unweighted/weighted...
TRANSCRIPT
Aliasing and Antialiasing
ITCS 4120/5120 1 Aliasing and Antialiasing
What is Aliasing?
“Errors and Artifacts arising during rendering, due to the conversionfrom a continuously defined illumination field to a discrete rastergrid of pixels”
ITCS 4120/5120 2 Aliasing and Antialiasing
What is Aliasing?
ITCS 4120/5120 3 Aliasing and Antialiasing
What is Aliasing?
ITCS 4120/5120 4 Aliasing and Antialiasing
What is Aliasing?
ITCS 4120/5120 5 Aliasing and Antialiasing
Effects of Aliasing
ITCS 4120/5120 6 Aliasing and Antialiasing
Effects of Aliasing
ITCS 4120/5120 7 Aliasing and Antialiasing
Effects of Aliasing
ITCS 4120/5120 8 Aliasing and Antialiasing
Effects of Aliasing
ITCS 4120/5120 9 Aliasing and Antialiasing
Anti-aliasing
ITCS 4120/5120 10 Aliasing and Antialiasing
Anti-aliasing Techniques
� Prefiltering (unweighted/weighted area sampling)
� Postfiltering (supersampling, jittering)
ITCS 4120/5120 11 Aliasing and Antialiasing
Area Sampling Techniques
ITCS 4120/5120 12 Aliasing and Antialiasing
Area Sampling Techniques
ITCS 4120/5120 13 Aliasing and Antialiasing
Area Sampling Techniques
ITCS 4120/5120 14 Aliasing and Antialiasing
Area Sampling Techniques
ITCS 4120/5120 15 Aliasing and Antialiasing
Area Sampling Techniques
ITCS 4120/5120 16 Aliasing and Antialiasing
Unweighted Area Sampling� Pixel intensity is varied in proportion to the area of the pixel inter-
cepted by the primitive.
� Unweighted – equivalent to a box filter of unit height over pixel.
Properties
� Intensity of pixel decreases as the distance between the pixel centerand primitive increases.
� A primitive cannot influence a pixel’s intensity if it does not intersectit.
� Equal areas (intersected) contribute equal intensity – not a desirableproperty.
ITCS 4120/5120 17 Aliasing and Antialiasing
Weighted Area Sampling
� Equal areas can contribute unequally in terms of pixel intensity.
� Areas closer to the pixel center contribute more.
� Essentially results in filtering with a mask that is centered over thepixel with decreasing radial influence.
� Cone filters are a compromise between computational expense andoptimality.
ITCS 4120/5120 18 Aliasing and Antialiasing
Postfiltering Techniques
ITCS 4120/5120 19 Aliasing and Antialiasing
Supersampling (Regular Sampling)
� Very expensive.
� Not very satisfactory.
ITCS 4120/5120 20 Aliasing and Antialiasing
Regular vs. Jittered Sampling
ITCS 4120/5120 21 Aliasing and Antialiasing
Filtering
ITCS 4120/5120 22 Aliasing and Antialiasing
Filtering
ITCS 4120/5120 23 Aliasing and Antialiasing
Filtering Example
ITCS 4120/5120 24 Aliasing and Antialiasing
Filtering Example
ITCS 4120/5120 25 Aliasing and Antialiasing
Filtering Example
ITCS 4120/5120 26 Aliasing and Antialiasing
Filtering Example
ITCS 4120/5120 27 Aliasing and Antialiasing
Aliasing from a Sampling Theory Viewpoint
Sampling(Spatial Domain)
ITCS 4120/5120 28 Aliasing and Antialiasing
Sampling(Spatial Domain)
� Image is a spatial signal
ITCS 4120/5120 29 Aliasing and Antialiasing
Frequency Domain
� X axis (position): frequency
� Y axis (height): strength of each frequency
� Examples: sine wave: impulse, square wave: infinite train of im-pulses
ITCS 4120/5120 30 Aliasing and Antialiasing
How do we get to the Frequency Domain?
� Use the Fourier Transform
Let φ(x) be a continuous function of a real variable x. Then
={φ(x)} = φ(ω) =
∫ ∞
−∞φ(x)e−j2πωx dx
is the Fourier Transform of φ(x), with j =√−1 and,
=−1{φ(ω)} = φ(x) =
∫ ∞
−∞φ(ω)ej2πωx dω
is the Inverse Fourier Transform.
◦ φ(x) is continuous and integrable
◦ φ(ω) is integrable
◦ x (spatial domain), ω (frequency domain)ITCS 4120/5120 31 Aliasing and Antialiasing
What does the Fourier Transform Do to ASpatial Signal?
◦ Signal in frequency domain is an integration of individual sinusoids.ITCS 4120/5120 32 Aliasing and Antialiasing
How does this related to Graphics?
◦ Images are just a 2D signal and jagged edges are due to the pixelsampling rate not being high enough to capture the “real signal.
ITCS 4120/5120 33 Aliasing and Antialiasing
Sampling Theorem
“Continuous-time signal can be completely recovered from its sam-ples iff the sampling rate is greater than twice the maximum fre-quency present in the signal.”
— Claude Shannon
◦ Also known as the Nyquist rate
ITCS 4120/5120 34 Aliasing and Antialiasing
Nyquist Rate
ITCS 4120/5120 35 Aliasing and Antialiasing
Nyquist Rate:Undersampling
� The lower signal is undersampled and results in an aliased wave(dotted curve).
ITCS 4120/5120 36 Aliasing and Antialiasing
Comb Function
� Application: Used to digitize continuous functions.
� Series of impulses (delta functions)
� Identity element of convolution: reproduces an indentical copy of thefunction f(x)
� FT of a comb function is another comb functionITCS 4120/5120 37 Aliasing and Antialiasing
Comb Function(contd)
� Multiplying f (x) with a comb in image space ⇐⇒ convolving theirFourier transforms, resulting in multiple identical copies of ={f (x)}
� Can result in aliasing if copies overlap
� Maximum allowable frequency is the Nyquist Frequency, which ishalf the sampling frequency.
ITCS 4120/5120 38 Aliasing and Antialiasing
Reconstruction Example(Adequate Sampling)
ITCS 4120/5120 39 Aliasing and Antialiasing
Reconstruction Example(Inadequate Sampling)
ITCS 4120/5120 40 Aliasing and Antialiasing
Box Filter
� Reconstruction filter for nearest neighbor interpolation.
� Resampling images/volumes to a higher resolution using nearestneighbor values.
� FT of a box filter is the Sinc function (sinπxπx
)
� Large side lobes continuing at regular intervals will cause aliasing.
� Aliasing in images manifests itself as “jaggies”ITCS 4120/5120 41 Aliasing and Antialiasing
Pyramid Filter
� Reconstruction filter used in linear interpolation
� Computationally more expensive, but more accurate
� FT is much better behaved (side lobes much smaller)
� Less tendency to produce aliasing
ITCS 4120/5120 42 Aliasing and Antialiasing
Gaussian Filter
� The optimal filter in terms of avodiding side lobes
� FT of a Gaussian is another Gaussian
� Widely used to blur images and the basis for scale space
ITCS 4120/5120 43 Aliasing and Antialiasing
ITCS 4120/5120 44 Aliasing and Antialiasing