0% found this document useful (0 votes)
157 views11 pages

11 Sampling and Aliasing

1. The document discusses an exam on rendering algorithms, sampling and aliasing that will take place on Friday May 29 from 13:15-15:00. 2. It provides an introduction to concepts like continuous signals, sampling, reconstruction, and aliasing in digital images. Sampling means defining an image only at discrete pixel locations. 3. Aliasing occurs because of the processes of sampling and reconstruction. It can create visual artifacts like moire patterns. Fourier analysis is used to understand sampling and aliasing from a mathematical perspective by representing signals in the spatial and frequency domains.
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)
157 views11 pages

11 Sampling and Aliasing

1. The document discusses an exam on rendering algorithms, sampling and aliasing that will take place on Friday May 29 from 13:15-15:00. 2. It provides an introduction to concepts like continuous signals, sampling, reconstruction, and aliasing in digital images. Sampling means defining an image only at discrete pixel locations. 3. Aliasing occurs because of the processes of sampling and reconstruction. It can create visual artifacts like moire patterns. Fourier analysis is used to understand sampling and aliasing from a mathematical perspective by representing signals in the spatial and frequency domains.
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/ 11

Exam

• Friday May 29, 13:15-15:00


Rendering Algorithms: • This room
Sampling and Aliasing • 2 pages A4 handwritten notes
• No electronic devices of any kind
• 60% of final grade
Spring 2009
Matthias Zwicker

Today Introduction
Sampling and aliasing • Conceptually, an image is a continuous
• Introduction signal describing the radiance arriving at
• Fourier analysis the image plane
• Understanding sampling and aliasing using • Signal is synonymous for function
Fourier analysis
• Antialiasing in graphics

Introduction Introduction
• Digital images are sampled representations Continuous pixel Sampled pixel
of these continuous signals Sample
• Sampled means “defined only at discrete
locations”, pixel centers
locations
Reconstruct
• Sampling: How to compute the value of
the sampled pixel
• Reconstruction: How to obtain a
continuous image from a set of samples

1
Aliasing Aliasing

• Aliasing occurs because of sampling and


reconstruction

Aliasing Aliasing
• Moire patterns

Aliasing Sampling and aliasing


Continuous pixel Discrete pixel
Sufficiently Sample
sampled

Reconstruct
Insufficiently
• Is it possible to perfectly sample and
sampled
reconstruct an image?
• If yes, under what circumstances?
[R. Cook ]

2
Sampling and aliasing Fourier analysis
• Fourier series: all periodic signals can be
• Goal: understanding sampling and aliasing represented as a summation of sinusoidal
from a „mathematical“ perspective waves
• Tool: Fourier analysis • Sinusoidal wave defined by
– Frequency
– Phase
– Amplitude

[http://axion.physics.ubc.ca/341-02/fourier/fourier.html]

Fourier analysis Fourier analysis


• Fourier transform: generalization of • Signals can be represented in the spatial
Fourier series to non-periodic functions or the frequency domain
– Given input signal/function f, frequency ω
– Computes
p amplitude
p and pphase of sinusoidal Fourier transform
wave at that frequency

Frequency
Complex amplitude
Sinusoidal wave Inverse Fourier transform

Fourier analysis Fourier analysis


Fourier transform Fourier transform

Inverse Fourier transform Inverse Fourier transform

Spatial domain Frequency domain, Spatial domain Frequency domain,


power spectrum power spectrum

• Power spectrum: squared amplitude of • Band-limited signal: no frequencies above


Fourier transform a certain threshold

3
Fourier transform example Duality
Spatial Frequency
Spatial domain Frequency domain domain domain

sinc ←⎯→
F
box

box ←⎯→
F
sinc

Duality

Fourier transform example Dirac delta function


Spatial Frequency
• Definition
domain domain

cosine (even)
cos(-ωt) =cos(ωt)
• Sifting property

sine (odd)
sin(-ωt) =-sin(ωt)

Dirac delta function Impulse train


Fourier transform
Spatial Frequency
domain domain
Spatial Frequency
d
domain
i d
domain
i Impulse train
(shah, comb function)
Dirac delta ΙΙΙΤ(x)
IIIT ( x) = ∑ δ ( x − kT ) IIIω (ω ) =
1
δ(x) 0
2π ω0
∑ δ (ω − kω )
k
0
k

Period T Period ω0 = 2π / T

4
Convolution Convolution
• In the spatial domain • In the spatial domain

Convolution kernel, filter


Filtered signal

Convolution Convolution
Spatial domain
• In the spatial domain
Convolution

• Convolution theorem: “convolution


corresponds to multiplication in the Frequency domain
frequency domain”
Multiplication
• Convolution leads to the same result as
Fourier transform, multiplication, inverse
Fourier transform

Low-pass filters Low-pass filters


• Low pass filter: remove high frequencies • The larger the support in the spatial
from signal domain, the smaller the support in the
• Shape of low pass filter in spatial and frequency domain
frequency domain?
Spatial
domain

Frequency
domain

5
High-pass filter High-pass filter
• High pass filter: remove low frequencies from
signal
• Shape of high pass filter in spatial and
frequency
q y domain?

Sampling Sampling
• Spatial domain: multiply signal with • Spatial domain: multiply signal with
impulse train impulse train

• Frequency domain: convolve signal with


Fourier transform of impulse train

Sampling and reconstruction Sampling and reconstruction


Sampling Reconstruction Sampling Reconstruction
Spatial Domain Frequency Domain Spatial Domain Frequency Domain Spatial Domain Frequency Domain Spatial Domain Frequency Domain

6
Sampling and reconstruction Sampling and reconstruction
Sampling Reconstruction Sampling Reconstruction
Spatial Domain Frequency Domain Spatial Domain Frequency Domain Spatial Domain Frequency Domain Spatial Domain Frequency Domain

Sampling Theorem (Shannon 1949) Anti-aliasing in graphics


• A signal can be reconstructed exactly if it Image signals are not band-limited to half
is sampled, at least, at twice its the pixel frequency in general
maximum frequency • Prefiltering
• The minimum sampling frequency is • Supersampling
S li
called the Nyquist frequency

Prefiltering Prefiltering
• Band-limit the continuous signal to the • Not applicable as a general solution in
Nyquist frequency before sampling graphics, since continuous image signal is
• Theoretically the way to go not known
Continuous pixel Sampled pixel • Useful for fexture filtering (mip-mapping)
(mip mapping)

Band-limit Sample

7
Supersampling Supersampling
• Compute several intermediate samples per pixel • Sampling patterns
• Reconstruct final pixel sample from • Reconstruction filters
intermediate samples

Continuous pixel Sampled pixel

Sample Reconstruct

Sampling patterns Uniform supersampling


• Two perspectives to assess quality of • Increases Nyquist limit
sampling patterns • Disadvantage
– Avoid aliasing – Spectrum of uniform sampling grid is uniform
– Efficient Monte Carlo integration grid of Dirac impulses
• Today: focus on aliasing – Aliases are copies of continuous spectrum
– Coherent and very noticeable
• Can aliasing be made “less visually
disturbing”?

Distribution of extrafoveal cones Blue noise characteristics


• Least conspicuous form of aliasing is
produced by sampling grids with blue
noise properties
– Spectrum should be noisy and lack any
concentrated spikes of energy
– Spectrum should have a deficiency of low-
monkey eye cone distribution Fourier transform frequency energy
• Studied by Yellot (1983) • Aliasing is converted into broadband noise
• Visual system is less sensitive to high frequency • Noise is incoherent and less objectionable
noise

8
Jittered Sampling Jittered vs. Uniform Supersampling

4x4 jittered sampling 4x4 uniform sampling

[Hanrahan] [Hanrahan]
Spatial domain Frequency domain [Hanrahan] [Hanrahan]

• Add uniform random jitter to each sample

Poisson Disk Sampling Poisson Disk Sampling

2x2 Poisson sampling 2x2 uniform sampling

[Hanrahan] [Hanrahan]
[Dippe 85] [Dippe 85]
Spatial domain Frequency domain

• Random sampling with minimum distance constraint


• Dart throwing algorithm

Reconstruction Box Filter


• Reconstruction filters are weighting functions to • Pretending pixels
compute a weighted average of the samples are little squares
Continuous pixel Sampled pixel • Take the average
of samples in each spatial

pixel

Sample Reconstruct
frequency

9
Box filter The Ideal Reconstruction Filter
• Ideal reconstruction = ideal low pass filter
• Pixels are not little squares… • Unfortunately, has infinite spatial extent
– Every sample contributes
to every interpolated point
• Expensive/impossible
to compute
• Ringing (Gibbs phenomenon) spatial

Original high- Down-sampled with


resolution image a 5x5 box filter
(uniform weights)
Horizontal banding
artifacts
frequency frequency

Problems with Reconstruction Filters Mitchell-Netravali Filters [1988]


• Excessive pass-band attenuation results in blurry images
• Perceptual studies to determine visually best filter
• Excessive high-frequency leakage can accentuate the
• Investigated family of parameterized filters
sampling grid
• Filters with a small support in the spatial domain have a
Parameterized filters
large
g support
pp in the frequency
q y domain

frequency

Reconstruction from non-uniform samples Adaptive sampling


• Requires normalization • Idea: use more samples (eye rays) where
image is complex, fewer where image is
simple
– „adapt local sampling rate to local bandwidth“
• Generic approach
1. Distribute initial samples
Samples 2. Evaluate refinement criterion based on current
Reconstruction kernel samples
Non-uniform positions 3. Either execute refinement strategy and go back
to 2, or go to 4
4. Reconstruct image

10
Contrast based refinement Refinement strategies
• Refinement if contrast of samples is above • Multi-level sampling
threshold – Use same sampling strategy in each step, but
– Mitchell 1988, http://doi.acm.org/10.1145/37401.37410 increase density
• Perceptually
p y motivated – May repeat two or multiple times
• Contrast Imax − Imin – Mitchell proposes two-stage approach
C=
Imax + Imin
• Use different thresholds for red, green, blue
– Mitchell proposes (0.4, 0.3, 0.6)
– Overly sensitive in dark regions (division by zero)
[Mitchell‚ 1987]

Reconstruction Adaptive sampling


• Equation above for reconstruction not • Pros
suitable for nonuniform sampling densities – Can reduce number of samples dramatically
– Dense areas contribute too much • Cons
– Sparse areas contribute too little – R
Requires
i parameter
t ttuning
i
• Need multi-stage filter – Introduces bias
– Reconstruct in fine-to-coarse fashion – Is not really appropriate for pure path tracing
– May always miss small image features

Next time
• Last lecture

11

You might also like