1 / 40

Understanding Aliasing and Sampling in Graphics

Explore aliasing and sampling in graphics, from point samples to Fourier theory. Learn how aliasing affects image rendering and how to avoid jaggies. Brush up on Fourier transforms and reconstruction methods.

annelise
Download Presentation

Understanding Aliasing and Sampling in Graphics

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Sampling and Aliasing Kurt Akeley CS248 Lecture 3 2 October 2007 http://graphics.stanford.edu/courses/cs248-07/

  2. Aliasing Aliases are low frequencies in a rendered image that are due to higher frequencies in the original image.

  3. Jaggies Original: Rendered: Are jaggies due to aliasing? How?

  4. Demo

  5. What is a point sample (aka sample)? An evaluation • At an infinitesimal point (2-D) • Or along a ray (3-D) What is evaluated • Inclusion (2-D) or intersection (3-D) • Attributes such as distance and color

  6. Why point samples? Clear and unambiguous semantics Matches theory well (as we’ll see) Supports image assembly in the framebuffer • will need to resolve visibility based on distance, and this works well with point samples Anything else just puts the problem off • Exchange one large, complex scene for many small, complex scenes

  7. Fourier theory “Fourier’s theorem is not only one of the most beautiful results of modern analysis, but it may be said to furnish an indispensable instrument in the treatment of nearly every recondite question in modern physics.” -- Lord Kelvin

  8. Reference sources Marc Levoy’s notes Ronald N. Bracewell, The Fourier Transform and its Applications, Second Edition, McGraw-Hill, Inc., 1978. Private conversations with Pat Hanrahan MATLAB

  9. Ground rules You don’t have to be an engineer to get this • We’re looking to develop instinct / understanding • Not to be able to do the mathematics We’ll make minimal use of equations • No integral equations • No complex numbers Plots will be consistent • Tick marks at unit distances • Signal on left, Fourier transform on the right

  10. Dimensions 1-D • Audio signal (time) • Generic examples (x) 2-D • Image (x and y) 3-D • Animation (x, y, and time) All examples in this presentation are 1-D

  11. Fourier series Any periodic function can be exactly represented by a (typically infinite) sum of harmonic sine and cosine functions. Harmonics are integer multiples of the fundamental frequency

  12. Fourier series example: sawtooth wave 1 … … -1 1

  13. Sawtooth wave summation 1 2 3 n Harmonics Harmonic sums

  14. Sawtooth wave summation (continued) 5 10 50 n Harmonics Harmonic sums

  15. Fourier integral Any function (that matters in graphics) can be exactly represented by an integration of sine and cosine functions. Continuous, not harmonic But the notion of harmonics will continue to be useful

  16. Basic Fourier transform pairs II(s) f(x) F(s)

  17. Reciprocal property Swapped left/right from previous slide II(s) f(x) F(s)

  18. Scaling theorem II(2s) II(s/2) f(x) F(s)

  19. Band-limited transform pairs sinc(x) sinc2(x) f(x) F(s)

  20. Finite / infinite extent If one member of the transform pair is finite, the other is infinite • Band-limited  infinite spatial extent • Finite spatial extent  infinite spectral extent

  21. Convolution

  22. Convolution example * =

  23. Convolution theorem Let fand g be the transforms of f and g. Then Something difficult to do in one domain (e.g., convolution) may be easy to do in the other (e.g., multiplication)

  24. Sampling theory x * Spectrum is replicated an infinite number of times = = f(x) F(s)

  25. Reconstruction theory * x sinc = = f(x) F(s)

  26. Sampling at the Nyquist rate x * = = f(x) F(s)

  27. Reconstruction at the Nyquist rate * x = = f(x) F(s)

  28. Sampling below the Nyquist rate x * = = f(x) F(s)

  29. Reconstruction below the Nyquist rate * x = = f(x) F(s)

  30. Reconstruction error Original Signal UndersampledReconstruction

  31. Reconstruction with a triangle function * x = = f(x) F(s)

  32. Reconstruction error Original Signal TriangleReconstruction

  33. Reconstruction with a rectangle function * x = = f(x) F(s)

  34. Reconstruction error Original Signal RectangleReconstruction

  35. Sampling a rectangle x * = = f(x) F(s)

  36. Reconstructing a rectangle (jaggies) * x = = f(x) F(s)

  37. Sampling and reconstruction Aliasing is caused by • Sampling below the Nyquist rate, • Improper reconstruction, or • Both We can distinguish between • Aliasing of fundamentals (demo) • Aliasing of harmonics (jaggies)

  38. Summary Jaggies matter • Create false cues • Violate rule 1 Sampling is done at points (2-D) or along rays (3-D) • Sufficient for depth sorting • Matches theory Fourier theory explains jaggies as aliasing. For correct reconstruction: • Signal must be band-limited • Sampling must be at or above Nyquist rate • Reconstruction must be done with a sinc function

  39. Assignments Before Thursday’s class, read • FvD 3.17 Antialiasing Project 1: • Breakout: a simple interactive game • Demos Wednesday 10 October

  40. End

More Related