MIT EECS 6.837, Durand and Cutler Sampling, Aliasing, & Mipmaps.

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.
3-D Computational Vision CSc Image Processing II - Fourier Transform.
Advanced Computer Graphics CSE 190 [Spring 2015], Lecture 4 Ravi Ramamoorthi
Computer Graphics Viewing, Rendering, Antialiasing گرد آوري و تاليف: دكتر احمد رضا نقش نيل چي دانشگاه اصفهان گروه مهندسي كامپيوتر.
David Luebke1/19/99 CS 551/651: Antialiasing David Luebke
Ted Adelson’s checkerboard illusion. Motion illusion, rotating snakes.
Real-Time Rendering TEXTURING Lecture 02 Marina Gavrilova.
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 (Fall 2010) CS 283, Lecture 3: Sampling and Reconstruction Ravi Ramamoorthi Some slides.
Sampling, Aliasing, & Mipmaps
CSCE 641 Computer Graphics: Image Sampling and Reconstruction Jinxiang Chai.
Sampling and Pyramids : Rendering and Image Processing Alexei Efros …with lots of slides from Steve Seitz.
Edges and Scale Today’s reading Cipolla & Gee on edge detection (available online)Cipolla & Gee on edge detection Szeliski – From Sandlot ScienceSandlot.
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.
CSCE 641 Computer Graphics: Image Sampling and Reconstruction Jinxiang Chai.
Image Sampling Moire patterns
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.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Sampling Week 7, Fri 17 Oct 2003 p1 demos sampling.
Lecture 3: Image Resampling CS4670: Computer Vision Noah Snavely Nearest-neighbor interpolation Input image 3x upsample hq3x interpolation (ZSNES)
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.
Image Sampling Moire patterns -
Computer Graphics Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
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.
© 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.
Computer Graphics Inf4/MSc Computer Graphics Lecture 9 Antialiasing, Texture Mapping.
MIT EECS Sampling and Monte-Carlo Integration.
Antialiasing CAP4730: Computational Structures in Computer Graphics.
Image Resampling CS4670: Computer Vision Noah Snavely.
Image Resampling CS4670: Computer Vision Noah Snavely.
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.
Computing & Information Sciences Kansas State University Lecture 10 of 42CIS 636/736: (Introduction to) Computer Graphics CIS 636/736 Computer Graphics.
Image Processing Basics. What are images? An image is a 2-d rectilinear array of pixels.
Computer Vision Spring ,-685 Instructor: S. Narasimhan Wean 5403 T-R 3:00pm – 4:20pm.
Lecture Fall 2001 From S. Zeki, Inner Vision.
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.
Sampling Theorem & Antialiasing
Lecture 5: Fourier and Pyramids
1 Dr. Scott Schaefer Antialiasing. 2/70 What is aliasing?
CIS 681 Distributed Ray Tracing. CIS 681 Anti-Aliasing Graphics as signal processing –Scene description: continuous signal –Sample –digital representation.
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
Image Resampling & Interpolation
Advanced Computer Graphics
Texture Mapping Sung-Eui Yoon (윤성의) CS380: Computer Graphics
… Sampling … … Filtering … … Reconstruction …
Texture Mapping cgvr.korea.ac.kr.
Sampling Theorem & Antialiasing
(C) 2002 University of Wisconsin, CS 559
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.
Joshua Barczak CMSC435 UMBC
CSCE 643 Computer Vision: Thinking in Frequency
Distributed Ray Tracing
Image Resampling & Interpolation
Resampling.
CSC418 Computer Graphics Aliasing Texture mapping.
Distributed Ray Tracing
Presentation transcript:

MIT EECS 6.837, Durand and Cutler Sampling, Aliasing, & Mipmaps

MIT EECS 6.837, Durand and Cutler Last Time? 2D Texture Mapping Perspective Correct Interpolation Common Texture Coordinate Projections Bump Mapping Displacement Mapping Environment Mapping

MIT EECS 6.837, Durand and Cutler Texture Maps for Illumination Quake Also called "Light Maps"

MIT EECS 6.837, Durand and Cutler Today What is a Pixel? Examples of Aliasing Signal Reconstruction Reconstruction Filters Anti-Aliasing for Texture Maps

MIT EECS 6.837, Durand and Cutler 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 no area –it cannot be seen –it can have a coordinate A pixel is more than just a point, it is a sample!

MIT EECS 6.837, Durand and Cutler More on Samples Most things in the real world are continuous, yet everything in a computer is discrete The process of mapping a continuous function to a discrete one is called sampling The process of mapping a continuous variable to a discrete one is called quantization To represent or render an image using a computer, we must both sample and quantize

MIT EECS 6.837, Durand and Cutler An Image is a 2D Function An ideal image is a function I(x,y) of intensities. It can be plotted as a height field. In general an image cannot be represented as a continuous, analytic function. Instead we represent images as tabulated functions. How do we fill this table?

MIT EECS 6.837, Durand and Cutler Sampling Grid We can generate the table values by multiplying the continuous image function by a sampling grid of Kronecker delta functions.

MIT EECS 6.837, Durand and Cutler Sampling an Image The result is a set of point samples, or pixels.

MIT EECS 6.837, Durand and Cutler Questions?

MIT EECS 6.837, Durand and Cutler Today What is a Pixel? Examples of Aliasing Signal Reconstruction Reconstruction Filters Anti-Aliasing for Texture Maps

MIT EECS 6.837, Durand and Cutler Examples of Aliasing

MIT EECS 6.837, Durand and Cutler Examples of Aliasing

MIT EECS 6.837, Durand and Cutler Examples of Aliasing

MIT EECS 6.837, Durand and Cutler Examples of Aliasing Texture Errors point sampling

MIT EECS 6.837, Durand and Cutler Questions?

MIT EECS 6.837, Durand and Cutler Today What is a Pixel? Examples of Aliasing Signal Reconstruction –Sampling Density –Fourier Analysis & Convolution Reconstruction Filters Anti-Aliasing for Texture Maps

MIT EECS 6.837, Durand and Cutler Sampling Density How densely must we sample an image in order to capture its essence? If we under-sample the signal, we won't be able to accurately reconstruct it...

MIT EECS 6.837, Durand and Cutler Nyquist Limit / Shannon's Sampling Theorem If we insufficiently sample the signal, it may be mistaken for something simpler during reconstruction (that's aliasing!) Image from Robert L. Cook, "Stochastic Sampling and Distributed Ray Tracing", An Introduction to Ray Tracing, Andrew Glassner, ed., Academic Press Limited, 1989.

MIT EECS 6.837, Durand and Cutler Examples of Aliasing Texture Errors point sampling mipmaps & linear interpolation

MIT EECS 6.837, Durand and Cutler Images from Remember Fourier Analysis? All periodic signals can be represented as a summation of sinusoidal waves.

MIT EECS 6.837, Durand and Cutler Remember Fourier Analysis? Every periodic signal in the spatial domain has a dual in the frequency domain. This particular signal is band-limited, meaning it has no frequencies above some threshold frequency domainspatial domain

MIT EECS 6.837, Durand and Cutler Remember Fourier Analysis? We can transform from one domain to the other using the Fourier Transform. spatial domainfrequency domain Fourier Transform Inverse Fourier Transform

MIT EECS 6.837, Durand and Cutler Remember Convolution? Images from Mark Meyer

MIT EECS 6.837, Durand and Cutler Remember Convolution? Some operations that are difficult to compute in the spatial domain can be simplified by transforming to its dual representation in the frequency domain. For example, convolution in the spatial domain is the same as multiplication in the frequency domain. And, convolution in the frequency domain is the same as multiplication in the spatial domain

MIT EECS 6.837, Durand and Cutler Sampling in the Frequency Domain (convolution) (multiplication) original signal sampling grid sampled signal Fourier Transform

MIT EECS 6.837, Durand and Cutler Reconstruction If we can extract a copy of the original signal from the frequency domain of the sampled signal, we can reconstruct the original signal! But there may be overlap between the copies.

MIT EECS 6.837, Durand and Cutler Guaranteeing Proper Reconstruction Separate by removing high frequencies from the original signal (low pass pre-filtering) Separate by increasing the sampling density If we can't separate the copies, we will have overlapping frequency spectrum during reconstruction → aliasing.

MIT EECS 6.837, Durand and Cutler Questions?

MIT EECS 6.837, Durand and Cutler Today What is a Pixel? Examples of Aliasing Signal Reconstruction Reconstruction Filters –Pre-Filtering, Post-Filtering –Ideal, Gaussian, Box, Bilinear, Bicubic Anti-Aliasing for Texture Maps

MIT EECS 6.837, Durand and Cutler Pre-Filtering Filter continuous primitives Treat a pixel as an area Compute weighted amount of object overlap What weighting function should we use?

MIT EECS 6.837, Durand and Cutler Post-Filtering Filter samples Compute the weighted average of many samples Regular or jittered sampling (better)

MIT EECS 6.837, Durand and Cutler Reconstruction Filters Weighting function Area of influence often bigger than "pixel" Sum of weights = 1 –Each pixel contributes the same total to image –Constant brightness as object moves across the screen. No negative weights/colors (optional)

MIT EECS 6.837, Durand and Cutler The Ideal Reconstruction Filter Unfortunately it has infinite spatial extent –Every sample contributes to every interpolated point Expensive/impossible to compute spatial frequency

MIT EECS 6.837, Durand and Cutler Gaussian Reconstruction Filter This is what a CRT does for free! spatial frequency

MIT EECS 6.837, Durand and Cutler Problems with Reconstruction Filters Many visible artifacts in re-sampled images are caused by poor reconstruction filters Excessive pass-band attenuation results in blurry images Excessive high-frequency leakage causes "ringing" and can accentuate the sampling grid (anisotropy) frequency

MIT EECS 6.837, Durand and Cutler Box Filter / Nearest Neighbor Pretending pixels are little squares. spatial frequency

MIT EECS 6.837, Durand and Cutler Tent Filter / Bi-Linear Interpolation Simple to implement Reasonably smooth spatial frequency

MIT EECS 6.837, Durand and Cutler Bi-Cubic Interpolation Begins to approximate the ideal spatial filter, the sinc function spatial frequency

MIT EECS 6.837, Durand and Cutler Why is the Box filter bad? (Why is it bad to think of pixels as squares) Down-sampled with a 5x5 box filter (uniform weights) Original high- resolution image Down-sampled with a 5x5 Gaussian filter (non-uniform weights) notice the ugly horizontal banding

MIT EECS 6.837, Durand and Cutler Questions?

MIT EECS 6.837, Durand and Cutler Today What is a Pixel? Examples of Aliasing Signal Reconstruction Reconstruction Filters Anti-Aliasing for Texture Maps –Magnification & Minification –Mipmaps –Anisotropic Mipmaps

MIT EECS 6.837, Durand and Cutler Sampling Texture Maps When texture mapping it is rare that the screen-space sampling density matches the sampling density of the texture. Original Texture Minification for DisplayMagnification for Display for which we must use a reconstruction filter 64x64 pixels

MIT EECS 6.837, Durand and Cutler Linear Interpolation Tell OpenGL to use a tent filter instead of a box filter. Magnification looks better, but blurry –(texture is under-sampled for this resolution)

MIT EECS 6.837, Durand and Cutler Spatial Filtering Remove the high frequencies which cause artifacts in minification. Compute a spatial integration over the extent of the sample Expensive to do during rasterization, but it can be precomputed

MIT EECS 6.837, Durand and Cutler MIP Mapping Construct a pyramid of images that are pre-filtered and re-sampled at 1/2, 1/4, 1/8, etc., of the original image's sampling During rasterization we compute the index of the decimated image that is sampled at a rate closest to the density of our desired sampling rate MIP stands for multium in parvo which means many in a small place

MIT EECS 6.837, Durand and Cutler MIP Mapping Example MIP Mapped (Bi-Linear)Nearest Neighbor Thin lines may become disconnected / disappear

MIT EECS 6.837, Durand and Cutler MIP Mapping Example Small details may "pop" in and out of view MIP Mapped (Bi-Linear)Nearest Neighbor

MIT EECS 6.837, Durand and Cutler Storing MIP Maps Can be stored compactly Illustrates the 1/3 overhead of maintaining the MIP map

MIT EECS 6.837, Durand and Cutler Anisotropic MIP-Mapping What happens when the surface is tilted? MIP Mapped (Bi-Linear)Nearest Neighbor

MIT EECS 6.837, Durand and Cutler Anisotropic MIP-Mapping We can use different mipmaps for the 2 directions Additional extensions can handle non axis-aligned views Images from

MIT EECS 6.837, Durand and Cutler Questions?

MIT EECS 6.837, Durand and Cutler Next Time: Last Class! Wrap Up & Final Project Review