Академический Документы
Профессиональный Документы
Культура Документы
Lecture 13
Copyright
Amitabh Varshney
Sampling
Occurs when the sampling inherent in rendering does not
contain enough information for an accurate image.
Original Scene
Scanline Luminosity
Slide 2
Sampled Signal
Rendered Image
Luminosity Signal
Lecture 13
Copyright
Amitabh Varshney
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
Amitabh Varshney
Jaggies
Slide 5
Lecture 13
Copyright
Amitabh Varshney
Copyright
Amitabh Varshney
Moire Patterns
Slide 6
Lecture 13
Moire Patterns
Image Courtesy:
Chen, Dachille, Kaufman
Slide 7
Lecture 13
Copyright
Amitabh Varshney
Moire Patterns
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
Amitabh Varshney
Temporal Aliasing
A
A
A
A A
Lecture 13
Copyright
Amitabh Varshney
Image as a 2D Signal
Slide 11
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
P=(x,y) means P = x(1,0)+y(0,1)
Similarly:
f( ) a
a cos( ) a sin( )
a cos(2) a sin(2)
00
11
12
21
Slide 13
22
Amitabh Varshney
Fourier Analysis
Represent a function as a weighted sum of sines
Lecture 13
Copyright
Amitabh Varshney
Example
c, a , a such that :
c) a cos a sin
1
cos(
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()
eg:
cos While,
sin d
0
Slide 16
cos d
2
cos cos 2 d 0
Lecture 13
Copyright
Amitabh Varshney
x ( x, y ) (1,0)
( x, y ) x(1,0)
2
ai ,1
f
Slide 17
y ( x, y ) (0,1)
y (0,1)
cos i
f*
ai , 2
d
cos i
ai ,1
cos i
cos i
2
sin i
f*
d
sin i
ai , 2
sin i
sin i
a0 , 0
Lecture 13
Copyright
Amitabh Varshney
Copyright
Amitabh Varshney
2D Example
Slide 18
Lecture 13
Slide 19
Slide 20
Lecture 13
Copyright
Amitabh Varshney
Copyright
Amitabh Varshney
Lecture 13
10
Aliasing is caused by
sampling frequencies that
are too high
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
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
Slide
Amitabh Varshney
12
Examples
Transform of
box filter is
sinc.
Transform of
Gaussian is
Gaussian.
Slide 25
Lecture 13
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
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
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
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
Lecture 13
Copyright
Amitabh Varshney
16
Smoothing with a
Gaussian
Slide 33
Lecture 13
Copyright
Amitabh Varshney
Lecture 13
Copyright
Amitabh Varshney
17
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
Slide 37
Prefiltering
Lecture 13
Copyright
Amitabh Varshney
Increasing Resolution
Physically increase the display resolution
Not always possible
n , sample on a sm
sn virtual display
s ) virtual sub-pixels to
Lecture 13
Copyright
Amitabh Varshney
19
Averaging with
supersampling
Slide 39
Slide 40
Matlab Lecture 13
Copyright
Amitabh Varshney
Copyright
Amitabh Varshney
Lecture 13
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
Regular
Slide 42
1
16
1
8
1
16
1
8
1
4
1
8
1
16
1
8
1
16
Lecture 13
Copyright
Amitabh Varshney
21
Filtering Example
Slide 43
Lecture 13
Copyright
Amitabh Varshney
Slide 44
Lecture 13
Copyright
Amitabh Varshney
22
Antialiasing Examples
Slide 45
Lecture 13
Copyright
Amitabh Varshney
Antialiasing Examples
Slide 46
Lecture 13
Copyright
Amitabh Varshney
23
Antialiasing Examples
Slide 47
Lecture 13
Copyright
Amitabh Varshney
Antialiasing Examples
Slide 48
Lecture 13
Copyright
Amitabh Varshney
24