Page 1 CS348B Lecture 7 Pat Hanrahan, Spring 2000 Sampling and Reconstruction The sampling and reconstruction process n Real world: continuous n Digital world: discrete Basic signal processing n Fourier transforms n The convolution theorem n The sampling theorem Aliasing and antialiasing n Uniform supersampling n Nonuniform supersampling CS348B Lecture 7 Pat Hanrahan, Spring 2000 Imagers = Signal Sampling All imagers convert a continuous image to a discrete sampled image by integrating over the active “area” of a sensor. Examples: n Retina: photoreceptors n CCD array n Vidicon: phosphors Virtual “computer graphics” cameras do not integrate, instead they simply sample ... ∫∫∫∫∫ = t A dt d dA t S x P t x L R w w q w cos ) ( ) ( ) , , (
16
Embed
Sampling and Reconstruction - Computer Graphicsgraphics.stanford.edu/courses/cs348b-00/lectures/lecture07/sampling.I.pdfCS348B Lecture 7 Pat Hanrahan, Spring 2000 Sampling Theorem
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1
CS348B Lecture 7 Pat Hanrahan, Spring 2000
Sampling and Reconstruction
The sampling and reconstruction processn Real world: continuous
n Digital world: discrete
Basic signal processing
n Fourier transforms
n The convolution theorem
n The sampling theoremAliasing and antialiasing
n Uniform supersampling
n Nonuniform supersampling
CS348B Lecture 7 Pat Hanrahan, Spring 2000
Imagers = Signal Sampling
All imagers convert a continuous image to a discrete sampled image by integrating over the active “area” of a sensor.
Virtual “computer graphics” cameras do not integrate,instead they simply sample ...
∫ ∫∫ ∫∫=t A
dtddAtSxPtxLRω
ωθω cos)()(),,(
Page 2
CS348B Lecture 7 Pat Hanrahan, Spring 2000
Displays = Signal Reconstruction
All physical displays recreate a continuous image from a discrete sampled image by using a finite sized source of light for each pixel.
Examples:
n DAC’s: sample and holdn Cathode ray tube: phosphor spot and grid
DAC CRT
CS348B Lecture 7 Pat Hanrahan, Spring 2000
Sampling in Computer Graphics
Artifacts due to sampling - Aliasingn Jaggies
n Moire
n Flickering small objects
n Sparkling highlights
n Temporal strobing
Preventing these artifacts - Antialiasing
Page 3
CS348B Lecture 7 Pat Hanrahan, Spring 2000
Jaggies
Retort sequence by Don Mitchell
Staircase pattern or jaggies
CS348B Lecture 7 Pat Hanrahan, Spring 2000
Spectral Analysis / Fourier Transforms
Spectral representation treats the function as a weighted sum of sines and cosines
Each function has two representations
n Spatial (time) domain - normal representationn Frequency domain - spectral representation
The Fourier transform converts between the spatial and frequency domain
SpatialDomain
FrequencyDomain
∫
∫∞
∞−
∞
∞−
−
=
=
ωωπ
ω
ω
ω
deFxf
dxexfF
xi
xi
)(21
)(
)()(
Page 4
CS348B Lecture 7 Pat Hanrahan, Spring 2000
Spatial and Frequency Domain
Spatial Domain Frequency Domain
CS348B Lecture 7 Pat Hanrahan, Spring 2000
Convolution
Definition
Convolution Theorem: Multiplication in the frequency domain is equivalent to convolution in the space domain.
Symmetric Theorem: Multiplication in the space domain is equivalent to convolution in the frequency domain.
GFgf ×↔⊗
GFgf ⊗↔×
∫ ′′−′=⊗= xdxxgxfgfxh )()()(
Page 5
CS348B Lecture 7 Pat Hanrahan, Spring 2000
Sampling: Spatial Domain
× =
∑∞=
−∞=
−=n
n
nTxx )()III( δ Tf
Tf sss
ππω
22
1===
CS348B Lecture 7 Pat Hanrahan, Spring 2000
Sampling: Frequency Domain
⊗
∑∞=
−∞=
−=n
nsn )()III( ωωδω
=
Page 6
CS348B Lecture 7 Pat Hanrahan, Spring 2000
Reconstruction: Frequency Domain
× =
>≤
=2
1
21
01
)II(xx
x
CS348B Lecture 7 Pat Hanrahan, Spring 2000
Reconstruction: Spatial Domain
=⊗
xx
xπ
πsinsinc =
Page 7
CS348B Lecture 7 Pat Hanrahan, Spring 2000
Sampling and Reconstruction
×⊗
= =
CS348B Lecture 7 Pat Hanrahan, Spring 2000
Sampling Theorem
This result if known as the Sampling Theorem and is due to Claude Shannon who first discovered it in 1949
A signal can be reconstructed from its sampleswithout loss of information, if the original signal
has no frequencies above 1/2 the sampling
frequency
For a given bandlimited function, the rate at which it must be sampled is called the Nyquist Frequency
Page 8
CS348B Lecture 7 Pat Hanrahan, Spring 2000
Undersampling: Aliasing
⊗ ×
= =
CS348B Lecture 7 Pat Hanrahan, Spring 2000
Sampling a “Zone Plate”
22sin yx +y
x
Zone plate:
Sampled at 128x128Reconstructed to 512x512
Left rings: part of signalRight rings: prealiasingMiddle rings: postaliasing
Page 9
CS348B Lecture 7 Pat Hanrahan, Spring 2000
Ideal Reconstruction
Ideally, use a perfect low-pass filter - the sinc function -to bandlimit the sampled signal and thus remove all copies of the spectra introduced by sampling
Unfortunately,
n The sinc has infinite extent and we must use simpler filters with finite extents. Physical processes in particular do not reconstruct with sincs
n The sinc may introduce ringing which are perceptually objectionable
CS348B Lecture 7 Pat Hanrahan, Spring 2000
Mitchell Cubic Filter
otherwise
xx
CBxCBxCBxCBBxCBxCB
xh 211
0
)248()4812()306()6()26()61218()6912(
61)( 23
23
<<<
++−−+++−−
−+++−+−−=
Properties:
1)( =∑∞=
−∞=
n
n
xh
From Mitchell and NetravaliLook at other figures in that paper
)3/1,3/1(:Good
)2/1,0(:Rom-Catmull)0,1(:spline-B
Page 10
CS348B Lecture 7 Pat Hanrahan, Spring 2000
Aliasing and Antialiasing
If the scene contains frequencies greater than theNyquist Frequency, then we have a aliasing problem
Results of aliasing:n Jaggiesn Moiren Flickering small objectsn Sparkling highlightsn Temporal strobing
Preventing aliasing or antialiasing:1. Analytically prefilter the signal2. Uniform supersampling and resample3. Nonuniform or stochastic sampling
CS348B Lecture 7 Pat Hanrahan, Spring 2000
Antialiasing by Prefiltering
⊗ ×
= =
Page 11
CS348B Lecture 7 Pat Hanrahan, Spring 2000
Antialiasing by Prefiltering
Ideally, low-pass with a perfect filter (a sinc function) tobandlimit the function to the Nyquist sampling rate.
Unfortunately, the sinc has infinite extent and we must use simpler filters (like a box filter, or area average).