Sampling and Reconstruction

Slides:



Advertisements
Similar presentations
Sampling, Aliasing.
Advertisements

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.
David Luebke 1 4/28/2015 Aliasing & Antialiasing.
David Luebke1/19/99 CS 551/651: Antialiasing David Luebke
MIT EECS 6.837, Durand and Cutler Sampling, Aliasing, & Mipmaps.
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.
Aliasing & Antialiasing
Antialiasing CS 319 Advanced Topics in Computer Graphics John C. Hart.
Cis 782 Advanced Computer Graphics Raghu Machiraju
Advanced Computer Graphics (Fall 2010) CS 283, Lecture 3: Sampling and Reconstruction Ravi Ramamoorthi Some slides.
Sampling, Aliasing, & Mipmaps
CS248 Midterm Review. CS248 Midterm Mon, November 4, 7-9 pm, Terman Aud Mostly “short answer” questions – Keep your answers short and sweet! Covers lectures.
CSCE 641 Computer Graphics: Image Sampling and Reconstruction Jinxiang Chai.
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.
Advanced Computer Graphics (Spring 2006) COMS 4162, Lecture 3: Sampling and Reconstruction Ravi Ramamoorthi
CS248 Midterm Review. CS248 Midterm Mon, November 3, 7-9 pm, Gates B01 Mostly “short answer” questions – Keep your answers short and sweet! Covers lectures.
CSCE 641 Computer Graphics: Fourier Transform Jinxiang Chai.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Sampling Week 7, Fri 17 Oct 2003 p1 demos sampling.
CS248 Midterm Review Michael Green and Sean Walker (based on the work of previous TAs)
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Scan Conversion Week 6, Fri 10 Oct 2003 sampling.
Fourier Theory and its Application to Vision
Advanced Computer Graphics (Spring 2005) COMS 4162, Lecture 3: Sampling and Reconstruction Ravi Ramamoorthi
Computational Photography: Fourier Transform Jinxiang Chai.
CIS 681 Distributed Ray Tracing. CIS 681 Anti-Aliasing Graphics as signal processing –Scene description: continuous signal –Sample –digital representation.
Leo Lam © Signals and Systems EE235. Transformers Leo Lam ©
CSC418 Computer Graphics n Aliasing n Texture mapping.
Leo Lam © Signals and Systems EE235. Leo Lam © Futile Q: What did the monsterous voltage source say to the chunk of wire? A: "YOUR.
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
CS 431/636 Advanced Rendering Techniques
… Representation of a CT Signal Using Impulse Functions
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.
Image Processing 고려대학교 컴퓨터 그래픽스 연구실 cgvr.korea.ac.kr.
Antialiasing CptS 548 Advanced Computer Graphics John C. Hart.
Leo Lam © Signals and Systems EE235 Lecture 28.
David Luebke 1 9/4/2015 CS 551/651: Advanced Computer Graphics Antialiasing Continued: Prefiltering and Supersampling.
Chapter 9 Basic Signal Processing. Motivation Many aspects of computer imagery differ from aspects of conventional imagery Computer representations are.
University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell Image processing.
09/19/2002 (C) University of Wisconsin 2002, CS 559 Last Time Color Quantization Dithering.
Lecture 7: Sampling Review of 2D Fourier Theory We view f(x,y) as a linear combination of complex exponentials that represent plane waves. F(u,v) describes.
Image Processing Basics. What are images? An image is a 2-d rectilinear array of pixels.
CMSC 635 Sampling and Antialiasing. Aliasing in images.
Leo Lam © Signals and Systems EE235 Leo Lam.
MIT EECS Sampling, Aliasing, & Mipmaps. MIT EECS Last Time? Global illumination “physically accurate light transport” The rendering equation.
2D Sampling Goal: Represent a 2D function by a finite set of points.
Leo Lam © Signals and Systems EE235. Leo Lam © Fourier Transform Q: What did the Fourier transform of the arbitrary signal say to.
Sampling Theorem & Antialiasing
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.
Sampling Week 7, Fri 17 Oct 2003 p1 demos sampling.
Advanced Computer Graphics
… Sampling … … Filtering … … Reconstruction …
Distributed Ray Tracing
Sampling Theorem & Antialiasing
(C) 2002 University of Wisconsin, CS 559
Sampling and Antialiasing
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: Image Sampling and Filtering
CSCE 643 Computer Vision: Thinking in Frequency
Sampling and Reconstruction
Cis 782 Advanced Computer Graphics Raghu Machiraju
Distributed Ray Tracing
Chapter 3 Sampling.
CSC418 Computer Graphics Aliasing Texture mapping.
Distributed Ray Tracing
Color Perception of color Color spaces
Presentation transcript:

Sampling and Reconstruction The sampling and reconstruction process Real world: continuous Digital world: discrete Basic signal processing Fourier transforms The convolution theorem The sampling theorem Aliasing and antialiasing Uniform supersampling Nonuniform supersampling University of Texas at Austin CS395T - Advanced Image Synthesis Fall 2007 Don Fussell

Camera Simulation Sensor response Lens Shutter Scene radiance University of Texas at Austin CS395T - Advanced Image Synthesis Fall 2007 Don Fussell

Imagers = Signal Sampling All imagers convert a continuous image to a discrete sampled image by integrating over the active “area” of a sensor. Examples: Retina: photoreceptors CCD array Virtual CG cameras do not integrate, they simply sample radiance along rays … University of Texas at Austin CS395T - Advanced Image Synthesis Fall 2007 Don Fussell

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: DACs: sample and hold Cathode ray tube: phosphor spot and grid DAC CRT University of Texas at Austin CS395T - Advanced Image Synthesis Fall 2007 Don Fussell

Sampling in Computer Graphics Artifacts due to sampling - Aliasing Jaggies Moire Flickering small objects Sparkling highlights Temporal strobing Preventing these artifacts - Antialiasing University of Texas at Austin CS395T - Advanced Image Synthesis Fall 2007 Don Fussell

Jaggies Retort sequence by Don Mitchell Staircase pattern or jaggies University of Texas at Austin CS395T - Advanced Image Synthesis Fall 2007 Don Fussell

Basic Signal Processing

Fourier Transforms Spectral representation treats the function as a weighted sum of sines and cosines Each function has two representations Spatial domain - normal representation Frequency domain - spectral representation The Fourier transform converts between the spatial and frequency domain Spatial Domain Frequency Domain University of Texas at Austin CS395T - Advanced Image Synthesis Fall 2007 Don Fussell

Spatial and Frequency Domain Spatial Domain Frequency Domain Pictures of Fourier transforms Square Rotated square Smaller and larger squares Get coordinates of frequency space right Check out optical transforms book University of Texas at Austin CS395T - Advanced Image Synthesis Fall 2007 Don Fussell

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. University of Texas at Austin CS395T - Advanced Image Synthesis Fall 2007 Don Fussell

The Sampling Theorem

Sampling: Spatial Domain What is the spacing? Is it unit spacing or is it T University of Texas at Austin CS395T - Advanced Image Synthesis Fall 2007 Don Fussell

Sampling: Frequency Domain Magic fact 1: Fourier transform of a sequence of pulses is a sequence of pulses University of Texas at Austin CS395T - Advanced Image Synthesis Fall 2007 Don Fussell

Reconstruction: Frequency Domain Overlay box University of Texas at Austin CS395T - Advanced Image Synthesis Fall 2007 Don Fussell

Reconstruction: Spatial Domain Magic fact 2: The Fourier transform of a box is a sinc Step by step Long discussion about interpolating functions and properties of the sinc University of Texas at Austin CS395T - Advanced Image Synthesis Fall 2007 Don Fussell

Sampling and Reconstruction If the reconstruction is not perfect, can get artifacts. Thus, even though no aliasing, this is often referred to as post-aliasing. University of Texas at Austin CS395T - Advanced Image Synthesis Fall 2007 Don Fussell

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 samples without 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 University of Texas at Austin CS395T - Advanced Image Synthesis Fall 2007 Don Fussell

Aliasing

Undersampling: Aliasing University of Texas at Austin CS395T - Advanced Image Synthesis Fall 2007 Don Fussell

Sampling a “Zone Plate” y Zone plate: Sampled at 128x128 Reconstructed to 512x512 Using a 30-wide Kaiser windowed sinc x Interesting question that confused me. Does the zone pattern plate repeat? I was confused and thought I was in the Fourier domain. And hence I thought the zone plate would repeat in the spatial domain. Does it In fact repeat? Can you prove it? Someone answered that the reason why was that the frequency was coupled to position. Left rings: part of signal Right rings: prealiasing University of Texas at Austin CS395T - Advanced Image Synthesis Fall 2007 Don Fussell

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, The sinc has infinite extent and we must use simpler filters with finite extents. Physical processes in particular do not reconstruct with sincs The sinc may introduce ringing which are perceptually objectionable Properties of the display and visual system ClearType example of designing the filter assuming properties of the display University of Texas at Austin CS395T - Advanced Image Synthesis Fall 2007 Don Fussell

Sampling a “Zone Plate” y Zone plate: Sampled at 128x128 Reconstructed to 512x512 Using optimal cubic x Reconstructed using Mitchell’s cubic filter (1/3,1/3) Left rings: part of signal Right rings: prealiasing Middle rings: postaliasing University of Texas at Austin CS395T - Advanced Image Synthesis Fall 2007 Don Fussell

Mitchell Cubic Filter Properties: From Mitchell and Netravali (1,0) cubic b-spline (0,C) cardinal cubics; (0,.5) catmull-rom (B,0) duff’s tensioned b-splines From Mitchell and Netravali University of Texas at Austin CS395T - Advanced Image Synthesis Fall 2007 Don Fussell

Antialiasing

Antialiasing by Prefiltering Need to explain why this is a good idea. Aliases are annoying: They move around depending on the sampling rate The are very noticable because they show up at all frequencies The beat against themselves to form patterns like Moires Boxes in frequency space Boxes in the spatial domain And vice versa Asymmetry is confusing. Color code diagrams showing whether they are in the spatial domain or frequency space Frequency Space University of Texas at Austin CS395T - Advanced Image Synthesis Fall 2007 Don Fussell

Antialiasing Antialiasing = Preventing aliasing Analytically prefilter the signal Solvable for points, lines and polygons Not solvable in general e.g. procedurally defined images Uniform supersampling and resample Nonuniform or stochastic sampling Only for polygons with constant or intensity varying as a polynomial Not solvable for perspective-correct polygons, or texture-mapped polygons, … Complex when geometry intersects within a pixel University of Texas at Austin CS395T - Advanced Image Synthesis Fall 2007 Don Fussell

Uniform Supersampling Increasing the sampling rate moves each copy of the spectra further apart, potentially reducing the overlap and thus aliasing Resulting samples must be resampled (filtered) to image sampling rate NVIDIA shows in 2D frequency space Samples Pixel University of Texas at Austin CS395T - Advanced Image Synthesis Fall 2007 Don Fussell

Point vs. Supersampled Point 4x4 Supersampled Checkerboard sequence by Tom Duff University of Texas at Austin CS395T - Advanced Image Synthesis Fall 2007 Don Fussell

Analytic vs. Supersampled How to compute the exact area. Compute the intersection of the polygon with the area corresponding. Exact Area 4x4 Supersampled University of Texas at Austin CS395T - Advanced Image Synthesis Fall 2007 Don Fussell

Distribution of Extrafoveal Cones Two properties The energy should be evenly distributed and not concentrated into spikes The spectrum should be deficient in low energt This is called blue noise. The maximal response to noise is about 4.5 cycles per degree [Mitchell 87] Monkey eye cone distribution Fourier transform Yellot theory Aliases replaced by noise Visual system less sensitive to high freq noise University of Texas at Austin CS395T - Advanced Image Synthesis Fall 2007 Don Fussell

Non-uniform Sampling Intuition Uniform sampling Non-uniform sampling The spectrum of uniformly spaced samples is also a set of uniformly spaced spikes Multiplying the signal by the sampling pattern corresponds to placing a copy of the spectrum at each spike (in freq. space) Aliases are coherent, and very noticable Non-uniform sampling Samples at non-uniform locations have a different spectrum; a single spike plus noise Sampling a signal in this way converts aliases into broadband noise Noise is incoherent, and much less objectionable University of Texas at Austin CS395T - Advanced Image Synthesis Fall 2007 Don Fussell

Jittered Sampling Add uniform random jitter to each sample University of Texas at Austin CS395T - Advanced Image Synthesis Fall 2007 Don Fussell

Jittered vs. Uniform Supersampling 4x4 Jittered Sampling 4x4 Uniform University of Texas at Austin CS395T - Advanced Image Synthesis Fall 2007 Don Fussell

Analysis of Jitter Non-uniform sampling Jittered sampling University of Texas at Austin CS395T - Advanced Image Synthesis Fall 2007 Don Fussell

Poisson Disk Sampling Dart throwing algorithm Very expensive Mitchell87 and lrt describe a better algorithm. Poisson disk version of the checkerboard Also, the reason this gets pushed out is that there is more white space in the jittered pattern. This means that the effective sampling rate is actually less because of this extra empty space. The Fourier transform of an irregularly space set of pulses is not necessarily a set of pulses. Can efficiently compute Fourier transform of a set of pulses. Have not described explicitly. That we are multiplying the samples times the image and this corresponds To convolving the FT of the image with the spectral. Dart throwing algorithm University of Texas at Austin CS395T - Advanced Image Synthesis Fall 2007 Don Fussell