0% found this document useful (0 votes)
35 views24 pages

Aliasing

kvuy u

Uploaded by

nidharshan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views24 pages

Aliasing

kvuy u

Uploaded by

nidharshan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Sampling and Aliasing

Sects. 4.17-18 in H&B Display is discrete and world is continuous


(at least at the level we perceive)

Sampling: Convert continuous to discrete Reconstruction: Converting from discrete to continuous Aliasing: Artifacts arising from sampling and consequent loss of information Anti-aliasing: Attempts to overcome aliasing
Slide 1 Lecture 13
Copyright

Amitabh Varshney

Sampling
Occurs when the sampling inherent in rendering does not contain enough information for an accurate image.
Original Scene Sampling Pixel Centres Rendered Image

Scanline Luminosity

Sampled Signal

Luminosity Signal

Slide 2

Lecture 13
Copyright

Images from SIGGRAPH 93 Educators Slide Set

Amitabh Varshney

Some Aliasing Artifacts


Spatial: Jaggies, Moire

Temporal: Strobe lights, Wrong wheel rotations

Spatio-Temporal: Small objects appearing and disappearing

Slide 3

Lecture 13
Copyright

Amitabh Varshney

Effects of Aliasing
Common aliasing errors (called artefacts) are: jagged profiles, disappearing or improper fine detail, and disintegrating textures.
Jagged Profiles

Loss of Detail

Slide 4

Lecture 13
Copyright

Images from SIGGRAPH 93 Educators Slide Set

Amitabh Varshney

Jaggies

Slide 5

Lecture 13
Copyright

Amitabh Varshney

Moire Patterns

Slide 6

Lecture 13
Copyright

Amitabh Varshney

Moire Patterns

Image Courtesy: Chen, Dachille, Kaufman


Slide 7 Lecture 13
Copyright

Amitabh Varshney

Moire Patterns

Image from http://www.daube.ch/docu/glossary/moiree.html Slide 8 Lecture 13


Copyright

Amitabh Varshney

Disintegrating Texture
The checkers on a plane should become smaller with distance. But aliasing causes them to become larger and/or irregular. Increasing resolution only moves the artefact closer to the horizon.

Slide 9

Lecture 13
Copyright

Images from SIGGRAPH 93 Educators Slide Set

Amitabh Varshney

Temporal Aliasing
A A A A A

The wheel appears to be moving backwards at about angular frequency: http://lite.bu.edu/lite1/perception/anamorphic/wade.html


Slide 10 Lecture 13
Copyright

Amitabh Varshney

Image as a 2D Signal

Slide 11

Image from Computer Graphics: Principles and Practice by Foley, van Dam, Feiner, and Hughes Lecture 13
Copyright

Amitabh Varshney

Fourier Series
Analytic geometry gives a coordinate system for describing geometric objects. Fourier series gives a coordinate system for functions.

Slide 12

Lecture 13
Copyright

Amitabh Varshney

Basis

f( ) a a cos( ) a sin( ) a cos(2) a sin(2)


00 11 12 21 22
Slide 13

P=(x,y) means P = x(1,0)+y(0,1) Similarly:

Note, Im showing non-standard basis, these are from basis using Lecture 13 complex functions.
Copyright

Amitabh Varshney

Fourier Analysis
Represent a function as a weighted sum of sines

Image from Computer Graphics: Principles and Practice by Foley, van Dam, Feiner, and Hughes Slide 14 Lecture 13
Copyright

Amitabh Varshney

c, a , a such that : cos( c) a cos a sin


1 2 1 2

Example

Slide 15

Lecture 13
Copyright

Amitabh Varshney

Orthonormal Basis
||(1,0)||=||(0,1)||=1 (1,0).(0,1)=0 Similarly we use normal basis elements eg:

cos( ) cos( )

cos()

cos d
2 2 0

While, eg:     cos sin d 0


Slide 16

Lecture 13

    cos cos 2 d  0
Copyright

Amitabh Varshney

x ( x, y ) (1,0) ( x, y ) x(1,0)
2

Coordinates with Inner Products


y ( x, y ) (0,1) y (0,1)
2 sin i f* d sin i

ai ,1 f
Slide 17

cos i f* ai , 2 d cos i

ai ,1

cos i cos i

ai , 2
Lecture 13

sin i sin i

a0 , 0
Copyright Amitabh Varshney

2D Example

Slide 18

Lecture 13

Copyright Amitabh Varshney

Slide 19

Lecture 13

Copyright Amitabh Varshney

Slide 20

Lecture 13

Copyright Amitabh Varshney

10

Aliasing is caused by sampling frequencies that are too high

The Fourier basis allows us to see which part of the image is causing trouble. The high frequency harmonics. Well get rid of these.
Slide 21 Lecture 13
Copyright Amitabh Varshney

Convolution
This is a very general concept But in this class, well just talk about convolutions that perform smoothing. Averaging: replace each pixel by the average in its neighborhood.
This can be done for continuous images with an integral

Can take a weighted average.


The most common uses a normal (Gaussian) function for weights.
Slide 22 Lecture 13
Copyright Amitabh Varshney

11

Weighted Average
We define a set of weights, w-k, w-k+1, , w-1,w0, w1,, wk. Then, smooth g by: k wi g ( x i ) This set of weights is a filter. i k For simple average, all w = 1/(2k+1) Other common alternative is to pick w from Normal (Gaussian) distribution.

Slide 23

Lecture 13

Copyright Amitabh Varshney

Convolution Theorem

g T F *G
1

f is a description of the weights in the weighted average (the filter), g is the image. F,G are transform of f,g That is, F contains coefficients, when we write f as linear combinations of harmonic basis. This says convolution is equivalent to multiplication in the transform domain. 24 Lecture 13

Slide

Copyright Amitabh Varshney

12

Examples
Transform of box filter is sinc. Transform of Gaussian is Gaussian.

Slide 25

Lecture 13

(Trucco and Verri)


Copyright Amitabh Varshney

Implications
Smoothing a sine or cosine just scales it (reduces amplitude). Smoothing a high frequency sine or cosine reduces its amplitude more than smooth a low frequency one. Smoothing an image reduces high frequencies more than low ones. Sinc function explains artifacts. Need smoothing before subsampling to avoid aliasing.
Slide 26 Lecture 13
Copyright Amitabh Varshney

13

Sampling

Every sample gives a linear equation in ai,j. Need two samples for every frequency.
Slide 27 Lecture 13
Copyright Amitabh Varshney

Previous examples
Disintegrating Texture
As squares get small, frequency grows. At some point, sampling is slower than frequency of changes.

Wagon wheel.
As wheel moves fast, we cannot sample world that fast.
Slide 28 Lecture 13

Copyright Amitabh Varshney

14

Anti-aliasing: Fixing Aliasing


Nyquist Frequency: Need at least twice the highest frequency in the signal to correctly reconstruct Example
Phone: 700 Hz at 8 bits per sample CD Player: 44.1 kHz at 16 bits per sample

Solutions:
Prefiltering: Lower the maximum frequency (filter out high frequencies) Super Sampling: Raise the sampling frequency Stochastic Sampling: Sample randomly instead of uniformly
Slide 29 Lecture 13

Copyright Amitabh Varshney

Strategy for anti-aliasing


Remove high frequencies
Intuitively, we do this by averaging. High frequency = rapid change Averaging slows down the changes This can be made more rigorous

Then sample Demo


Slide 30 Lecture 13
Copyright Amitabh Varshney

15

Example: Smoothing by Averaging

Slide 31

Lecture 13

Copyright Amitabh Varshney

Gaussian Averaging
Rotationally symmetric. Weights nearby pixels more than distant ones.
This makes sense as probabalistic inference.
Slide 32

A Gaussian gives a good model of a fuzzy blob


Copyright Amitabh Varshney

Lecture 13

16

Smoothing with a Gaussian

Slide 33

Lecture 13

Copyright Amitabh Varshney

Lowering the Max Frequency

Image from http://www.lunaloca.com/tutorials/antialiasing/ Slide 34 Lecture 13


Copyright Amitabh Varshney

17

Lowering the Max Frequency

Image from http://www.lunaloca.com/tutorials/antialiasing/ Slide 35 Lecture 13


Copyright Amitabh Varshney

Prefiltering
Blur the images by some low-pass filters Easy for 2D text, images, and 2D graphics Difficult for 3D graphics (visibility is an issue since translucency is expensive)

Slide 36

Lecture 13

Copyright Amitabh Varshney

18

Prefiltering

+ No Antialiasing Prefiltering

Slide 37

Lecture 13

Images from SIGGRAPH 93 Educators Slide Set

Copyright Amitabh Varshney

Increasing Resolution
Physically increase the display resolution
Not always possible

Perform Postfiltering / Supersampling


Actual display is m n , sample on a sm sn virtual display Then average several (typically s s ) virtual sub-pixels to yield one actual pixel Averaging
unweighted (simple average) weighted (more importance to virtual sub-pixels closer to the center)
Slide 38 Lecture 13
Copyright Amitabh Varshney

19

Averaging with supersampling

Slide 39

Matlab Lecture 13

Copyright Amitabh Varshney

Slide 40

Lecture 13

Copyright Amitabh Varshney

20

Stochastic Sampling
Sample at a random place within the pixel to determine its color (Jittering) Pick a random point and keep it if its nearest neighbor is > r units away (Poisson Disk Sampling) Often use stochastic sampling with supersampling (eg: 16 stochastic samples/pixel) Reduces aliasing at the cost of added noise.
Slide 41 Lecture 13
Copyright Amitabh Varshney

Sampling: take n x n jittered, regular or random samples.


Jittered Regular

Averaging: use an n x n filter to assign weights to each sample. Sum all the weighted samples to obtain a pixel.
Slide 42 Lecture 13

1 16 1 8 1 16

1 8 1 4 1 8

1 16 1 8 1 16

Images from SIGGRAPH 93 Educators Slide Set

Copyright Amitabh Varshney

21

Filtering Example

Slide 43

Lecture 13

Images from SIGGRAPH 93 Educators Slide Set

Copyright Amitabh Varshney

Anti-aliasing for Geometric Objects


Use gray value proportional to area of intersection
Overcomes jagged edges Gives equal orientation lines same brightness Equivalent to supersampling with averaging in the limit of infinite supersampling.

Slide 44

Lecture 13

Copyright Amitabh Varshney

22

Antialiasing Examples

Slide 45

Lecture 13

Images from SIGGRAPH 93 Educators Slide Set

Copyright Amitabh Varshney

Antialiasing Examples

Slide 46

Lecture 13

Images from SIGGRAPH 93 Educators Slide Set

Copyright Amitabh Varshney

23

Antialiasing Examples

Slide 47

Lecture 13

Images from SIGGRAPH 93 Educators Slide Set

Copyright Amitabh Varshney

Antialiasing Examples

Slide 48

Lecture 13

Images from SIGGRAPH 93 Educators Slide Set

Copyright Amitabh Varshney

24

You might also like