Upload
others
View
8
Download
0
Embed Size (px)
Citation preview
Slide 1
CS 112 - Sampling and Aliasing
Slide 2
Analog vs Digital
n Nature is analog signal n We discretize to create digital signals
Slide 3
Analog signalsn Function dependent on single or multiple variablesn Defined at any value of the independent variables
t
Ampl
itude
1D: A = f ( t )
x
y
2D: I = f ( x, y )
x
y
z
3D: S = f ( x, y, z )
Slide 4
Digital Signals
n Defined at only few values of t
Sampling Correct Reconstructiont
Slide 5
Digital Signalsn Whether you can reconstruct correctly depends
on how you sample – sampling rate
Sampling Incorrect Reconstructiont
Slide 6
Nyquist Rate
n Consider only sine wavesn If you sample at least at twice the
frequency (2 samples per cycle), signal can be reconstructed correctlyn More the sampling rate, better the
reconstructionn If less than twice the frequency, cannot
reconstruct correct
Slide 7
Nyquist Rate Sampling
Sampling Correct Reconstructiont
Slide 8
Aliasingn Aliasing: Incorrect representation of some entity
A much lower frequency Zero frequency
Slide 9
How does sinusoids help?
n Any signal can be expressed as a sum of sinusoids of different frequenciesn Amplituden Phase
Slide 10
Spectral Analysis
Time Domain Frequency Domain
Slide 11
For 2D images
n Any signal can be expressed as a sum of sinusoids of different frequenciesn Amplituden Phasen Orientation
Slide 12
Extending it to 2D
Amplitude
Phase
Slide 13
Frequency Contentn Lower frequencies : Global Patternn Higher frequencies : Detailsn Required sampling rate lower for low frequency
image (lower number of pixels, lower resolution)
Slide 14
Amplituden Amplitude
n How much details?n Sharper details signify higher frequenciesn Will deal with this mostly
Slide 15
Phase
n Where are the details?
n Though we do not use it much, it is important, especially for perception
Slide 16
Reducing Frequency contentn Filtering: Applying mathematical function over a window
around every pixeln Simplest: Averaging pixels (Box Filter)
n Other sophisticated methods n Size of the window usedn Mathematical function used is more complicated
Slide 17
How does it help?
Input (256 x 256)
Subsampled(128 x 128) Subsampled from filtered image(128 x 128)
Insufficient sampling.Hence, aliasing.
Filtering reduces frequency content.
Hence, lower sampling is sufficient.
Filtered (256 x 256)ANTI-ALIASING
Slide 18
Aliasing in Scan Conversion
n Rasterized line segments and edges of polygons look jagged
Slide 19
Aliasing in Scan Conversionn 1-pixel wide ideal line span partial pixelsn Scan conversion method forces us to choose
exactly one pixel for every value of x
Slide 20
Aliasing in Scan Conversionn Supersampling and Filtering: Render a super-
sampled image and then filtern Area Averaging: Shade each pixel by gray value
= the percentage of the actual line crossing it at x
Slide 21
Aliasing in Scan Conversionn Very expensive – Usually not implemented for real-
time renderingn Only when you have lot of time to render each
frame – Like in animation movies
Slide 22
Aliasing during z-buffering
n A pixel shared by three primitivesn Z intersection – identified in an integer leveln Front-most gets drawn
n Same technique: Area weighted average
Slide 23
Temporal Aliasing
n Animationn Speed of the object too fastn Jittered Motion