Sampling Theorem & Antialiasing

Slides:



Advertisements
Similar presentations
Sampling, Aliasing.
Advertisements

Sampling and Reconstruction
Technische Universität München Fakultät für Informatik Computer Graphics SS 2014 Sampling Rüdiger Westermann Lehrstuhl für Computer Graphik und Visualisierung.
Computer Graphics Viewing, Rendering, Antialiasing گرد آوري و تاليف: دكتر احمد رضا نقش نيل چي دانشگاه اصفهان گروه مهندسي كامپيوتر.
David Luebke1/19/99 CS 551/651: Antialiasing David Luebke
MIT EECS 6.837, Durand and Cutler Sampling, Aliasing, & Mipmaps.
Anti-Aliasing Jian Huang, CS594, Fall 2008 This set of slides references our text book and the slides used at Ohio State by Prof. Roger Crawfis.
Medical Image Analysis Image Formation Figures come from the textbook: Medical Image Analysis, by Atam P. Dhawan, IEEE Press, 2003.
CS 551 / CS 645 Antialiasing. What is a pixel? A pixel is not… –A box –A disk –A teeny tiny little light A pixel is a point –It has no dimension –It occupies.
Advanced Computer Graphics CSE 190 [Spring 2015], Lecture 5 Ravi Ramamoorthi
Aliasing & Antialiasing
School of Computing Science Simon Fraser University
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Texture Mapping II April 10, 2003.
Sampling, Aliasing, & Mipmaps
General Functions A non-periodic function can be represented as a sum of sin’s and cos’s of (possibly) all frequencies: F(  ) is the spectrum of the function.
Immagini e filtri lineari. Image Filtering Modifying the pixels in an image based on some function of a local neighborhood of the pixels
Advanced Computer Graphics (Spring 2006) COMS 4162, Lecture 3: Sampling and Reconstruction Ravi Ramamoorthi
CS5520 Image-Based Rendering © Chun-Fa Chang, Spring 2003 Sampling Theorem & Antialiasing April 15, 2003.
Advanced Computer Graphics (Spring 2005) COMS 4162, Lecture 7: Review, Reconstruction Ravi Ramamoorthi
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Sampling Week 7, Fri 17 Oct 2003 p1 demos sampling.
Advanced Texture Mapping May 10, Today’s Topics Mip Mapping Projective Texture Shadow Map.
1 Images and Transformations Images by Pawan SinhaPawan Sinha.
Advanced Computer Graphics (Spring 2005) COMS 4162, Lecture 3: Sampling and Reconstruction Ravi Ramamoorthi
CIS 681 Distributed Ray Tracing. CIS 681 Anti-Aliasing Graphics as signal processing –Scene description: continuous signal –Sample –digital representation.
Transforms: Basis to Basis Normal Basis Hadamard Basis Basis functions Method to find coefficients (“Transform”) Inverse Transform.
Basic Image Processing January 26, 30 and February 1.
CSC418 Computer Graphics n Aliasing n Texture mapping.
Sampling and Antialiasing CMSC 491/635. Abstract Vector Spaces Addition –C = A + B = B + A –(A + B) + C = A + (B + C) –given A, B, A + X = B for only.
Advanced Computer Graphics CSE 190 [Spring 2015], Lecture 3 Ravi Ramamoorthi
Filtering theory: Battling Aliasing with Antialiasing Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
Sampling theorem In order to accurately reconstruct a signal from a periodically sampled version of it, the sampling frequency must be at least twice the.
CS 431/636 Advanced Rendering Techniques
G52IIP, School of Computer Science, University of Nottingham 1 Image Transforms Fourier Transform Basic idea.
© Chun-Fa Chang Sampling Theorem & Antialiasing. © Chun-Fa Chang Motivations “ My ray traced images have a lot more pixels than the TV screen. Why do.
Antialiasing CptS 548 Advanced Computer Graphics John C. Hart.
David Luebke 1 9/4/2015 CS 551/651: Advanced Computer Graphics Antialiasing Continued: Prefiltering and Supersampling.
Antialiasing CAP4730: Computational Structures in Computer Graphics.
Filtering Robert Lin April 29, Outline Why filter? Filtering for Graphics Sampling and Reconstruction Convolution The Fourier Transform Overview.
CS 450: COMPUTER GRAPHICS ANTIALIASING SPRING 2015 DR. MICHAEL J. REALE.
09/19/2002 (C) University of Wisconsin 2002, CS 559 Last Time Color Quantization Dithering.
Image Processing Basics. What are images? An image is a 2-d rectilinear array of pixels.
CMSC 635 Sampling and Antialiasing. Aliasing in images.
MIT EECS Sampling, Aliasing, & Mipmaps. MIT EECS Last Time? Global illumination “physically accurate light transport” The rendering equation.
02/05/2002 (C) University of Wisconsin 2002, CS 559 Last Time Color Quantization Mach Banding –Humans exaggerate sharp boundaries, but not fuzzy ones.
Sampling Pixel is an area!! – Square, Rectangular, or Circular? How do we approximate the area? – Why bother? Color of one pixel Image Plane Areas represented.
2D Sampling Goal: Represent a 2D function by a finite set of points.
Fourier Transform.
1 Dr. Scott Schaefer Antialiasing. 2/70 What is aliasing?
David Luebke 3/17/2016 Advanced Computer Graphics Antialiasing David Luebke
CIS 681 Distributed Ray Tracing. CIS 681 Anti-Aliasing Graphics as signal processing –Scene description: continuous signal –Sample –digital representation.
University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Sampling and Reconstruction.
Antialiasing. What is alias? Alias - A false signal in telecommunication links from beats between signal frequency and sampling frequency (from dictionary.com)
Sampling Week 7, Fri 17 Oct 2003 p1 demos sampling.
Advanced Computer Graphics
Advanced Computer Graphics
Distributed Ray Tracing
Sampling Theorem & Antialiasing
(C) 2002 University of Wisconsin, CS 559
Sampling and Antialiasing
Antialiasing Dr. Scott Schaefer.
General Functions A non-periodic function can be represented as a sum of sin’s and cos’s of (possibly) all frequencies: F() is the spectrum of the function.
Sampling Theorem told us …
Joshua Barczak CMSC435 UMBC
Sampling and Reconstruction
© University of Wisconsin, CS559 Spring 2004
Distributed Ray Tracing
Basic Image Processing
Intensity Transformation
CSC418 Computer Graphics Aliasing Texture mapping.
Distributed Ray Tracing
Presentation transcript:

Sampling Theorem & Antialiasing

Motivations “My ray traced images have a lot more pixels than the TV screen. Why do they look like @#$%?” How to compute the pixel colors for the following pattern? Antialiasing with Line Samples Rendering Techniques '00 (Proceedings of the 11th Eurographics Workshop on Rendering), pp. 197-205 Thouis R. Jones, Ronald N. Perry

Part I: Sampling Theorem

Example of Aliasing in Computer Graphics

Examples of Aliasing in 1D See Figure 14.2 (p.394) of Watt’s book for other examples.

An Intuition – Using a Single Frequency It’s easy to figure out for a sin wave. What about any signal (usually a mixture of multiple frequencies)? Enter Fourier Transform…

Sampling 1D Signal: x  f(x) becomes i  f(i) 2D Image: x, y  f(x, y) For grayscale image, f(x, y) is the intensity of pixel at (x, y).

Reconstruction If the samples are “dense” enough, then we can recover the original signal. Question is: How dense is enough?

Fourier Transform Can we separate signal into a set of signals of single frequencies? t w w

Basis Functions An example: X=[x1, x2, …, xn] U=[u1, u2, …, un] V=[v1, v2, …, vn] Let X = a*U + b*V, how to find a and b? If U and V are orthogonal, then a and b are the projection of X onto U and V.

Compared to Fourier Transform Consider a continuous signal as a infinite-dimensional vector [ f(e), f(2e), f(3e),….. ] Consider each frequency w a basis, then F(w) is the projection of f(x) onto that basis. t

Sampling Spatial domain: multiply with a pulse train. Frequency domain: convolution!

Convolution To start with, image that f(x) is nonzero only in the range of [-a, a]. Then we only need to consider g(x) in the range of [x-a, x+a] Multiplication in spatial domain results in convolution in frequency domain (and vice versa).

An Intuition for Convolution Does it make sense to you that multiplication in one domain becomes convolution in the other domain? Look at this example: What are the coefficients of P1*P2?

Consider xn, …, x2, x1, x 0 as basis. Projections of P1 and P2 to the basis are (a1, b1, c1, d1) and (a2, b2, c2, d2) P1(x)*P2(x) results in: (a1, b1, c1, d1)  (a2, b2, c2, d2) in the transformed space.

The fact is: you have been doing convolution since elementary school! Example: 222*111 is computed as (2,2,2)  (1,1,1)

Reconstruction Frequency domain: Spatial domain: convolve with Sinc function

Reconstruction Kernel For perfect reconstruction, we need to convolve with the sinc function. It’s the Fourier transform of the box function. It has infinite “support” May be approximated by Gaussian, cubic, or even triangle “tent” function.

Nyquist Limit Nyquist Limit = 2 * max_frequency Undersampling: sampling below the Nyquist Limit.

Part II: Antialiasing

Changes within a Pixel A lot can change within a pixel: Shading Edge Texture Point sampling at the center often produces undesirable result.

Pixel Coverage What should be the pixel colors for these? Can we simply use the covered areas of blue and white? (Hint: convolve with box filter.) Do we have enough data to compute the coverage?

Antialiasing Consider a ray tracer. Is it often impossible to find the partial coverage of an edge. Each ray is a point sample. We may use many samples for each pixel  slower performance.

Antialiasing – Uniform Sampling Also called supersampling Wasteful if not much changes within a pixel.

Filtering How do we reduce NxN supersamples into a pixel? Average? More weight near the center? Let’s resort to the sampling theorem.

Reconstruction Frequency domain: Spatial domain:

A Few Observations In theory, a sample influences not only its pixel, but also every pixels in the image. What does it mean by removing high frequencies?

Other Than Uniform Sampling? So far, the extra samples are taken uniformly in screen space. Other ways to take extra samples: Adaptive sampling Stochastic (or randomized) sampling

Antialiasing – Adaptive Sampling Feasible in software, but difficult to implement in hardware. Increase samples only if necessary. But how do we know when is “necessary”? Check the neighbors.

Antialiasing – Stochastic Sampling Keep the same number of samples per pixel. Replace the aliasing effects with noise that is easier to ignore.

EWA for Texture Mapping Paul Heckbert, “Survey of Texture Mapping” IEEE CG&A, Nov. 1986. (Figures) Green & Heckbert, “Creating Raster Omnimax Images from Multiple Perspective Views Using The Elliptical Weighted Average Filter” IEEE CG&A, 6(6), pp. 21-27, June 1986.