Antialiasing. CS 319 Advanced Topics in Computer Graphics John C. Hart

Similar documents
Aliasing, Image Sampling and Reconstruction

Image Processing and Computer Graphics. Rendering Pipeline. Matthias Teschner. Computer Science Department University of Freiburg

INTRODUCTION TO RENDERING TECHNIQUES

Summed-Area Tables for Texture Mapping

An Extremely Inexpensive Multisampling Scheme

EECS 556 Image Processing W 09. Interpolation. Interpolation techniques B splines

Linear Filtering Part II

CHAPTER 3: DIGITAL IMAGING IN DIAGNOSTIC RADIOLOGY. 3.1 Basic Concepts of Digital Imaging

Scan-Line Fill. Scan-Line Algorithm. Sort by scan line Fill each span vertex order generated by vertex list

Computer Networks and Internets, 5e Chapter 6 Information Sources and Signals. Introduction

Sampling and Interpolation. Yao Wang Polytechnic University, Brooklyn, NY11201

ANALYZER BASICS WHAT IS AN FFT SPECTRUM ANALYZER? 2-1

To determine vertical angular frequency, we need to express vertical viewing angle in terms of and. 2tan. (degree). (1 pt)

SGN-1158 Introduction to Signal Processing Test. Solutions

Lecture 14. Point Spread Function (PSF)

Visualization and Feature Extraction, FLOW Spring School 2016 Prof. Dr. Tino Weinkauf. Flow Visualization. Image-Based Methods (integration-based)

Specular reflection. Dielectrics and Distribution in Ray Tracing. Snell s Law. Ray tracing dielectrics

How To Understand The Nyquist Sampling Theorem

A Short Introduction to Computer Graphics

The Limits of Human Vision

Analog Representations of Sound

SIGNAL PROCESSING FOR EFFECTIVE VIBRATION ANALYSIS

Analog and Digital Signals, Time and Frequency Representation of Signals

The continuous and discrete Fourier transforms

Image Synthesis. Transparency. computer graphics & visualization

Introduction to Digital Audio

Computational Foundations of Cognitive Science

Sampling Theorem Notes. Recall: That a time sampled signal is like taking a snap shot or picture of signal periodically.

Correlation and Convolution Class Notes for CMSC 426, Fall 2005 David Jacobs

Sampling Theory For Digital Audio By Dan Lavry, Lavry Engineering, Inc.

PCM Encoding and Decoding:

Dynamic Resolution Rendering

Basics of Digital Recording

5 Signal Design for Bandlimited Channels

TDS5000B, TDS6000B, TDS/CSA7000B Series Acquisition Modes

T = 1 f. Phase. Measure of relative position in time within a single period of a signal For a periodic signal f(t), phase is fractional part t p

The Calculation of G rms

Doppler. Doppler. Doppler shift. Doppler Frequency. Doppler shift. Doppler shift. Chapter 19

Advanced Computer Graphics. Rendering Equation. Matthias Teschner. Computer Science Department University of Freiburg

USB 3.0 CDR Model White Paper Revision 0.5

Digital Transmission of Analog Data: PCM and Delta Modulation

Enhanced LIC Pencil Filter

Understand the effects of clock jitter and phase noise on sampled systems A s higher resolution data converters that can

CBS RECORDS PROFESSIONAL SERIES CBS RECORDS CD-1 STANDARD TEST DISC

Vector storage and access; algorithms in GIS. This is lecture 6

Agilent Creating Multi-tone Signals With the N7509A Waveform Generation Toolbox. Application Note

Workstation Applications for Windows. NVIDIA MAXtreme User s Guide

CASTING CURVED SHADOWS ON CURVED SURFACES. Lance Williams Computer Graphics Lab New York Institute of Technology Old Westbury, New York 11568

Analysis/resynthesis with the short time Fourier transform

COMP175: Computer Graphics. Lecture 1 Introduction and Display Technologies

1995 Mixed-Signal Products SLAA013

Time series analysis Matlab tutorial. Joachim Gross

Line and Polygon Clipping. Foley & Van Dam, Chapter 3

1. Oscilloscope is basically a graph-displaying device-it draws a graph of an electrical signal.

1. (Ungraded) A noiseless 2-kHz channel is sampled every 5 ms. What is the maximum data rate?

CUBE-MAP DATA STRUCTURE FOR INTERACTIVE GLOBAL ILLUMINATION COMPUTATION IN DYNAMIC DIFFUSE ENVIRONMENTS

Admin stuff. 4 Image Pyramids. Spatial Domain. Projects. Fourier domain 2/26/2008. Fourier as a change of basis

High Performance GPU-based Preprocessing for Time-of-Flight Imaging in Medical Applications

Spike-Based Sensing and Processing: What are spikes good for? John G. Harris Electrical and Computer Engineering Dept

chapter Introduction to Digital Signal Processing and Digital Filtering 1.1 Introduction 1.2 Historical Perspective

ε: Voltage output of Signal Generator (also called the Source voltage or Applied

Module 13 : Measurements on Fiber Optic Systems

Lab 5 Getting started with analog-digital conversion

Lecture 3: Signaling and Clock Recovery. CSE 123: Computer Networks Stefan Savage

Department of Electrical and Computer Engineering Ben-Gurion University of the Negev. LAB 1 - Introduction to USRP

Acceleration levels of dropped objects

Multi Channel software

Assessment of Camera Phone Distortion and Implications for Watermarking

Point Lattices in Computer Graphics and Visualization how signal processing may help computer graphics

RF Measurements Using a Modular Digitizer

Spectral Analysis Using a Deep-Memory Oscilloscope Fast Fourier Transform (FFT)

07 SAMPLING AND RECONSTRUCTION

MSB MODULATION DOUBLES CABLE TV CAPACITY Harold R. Walker and Bohdan Stryzak Pegasus Data Systems ( 5/12/06) pegasusdat@aol.com

Bildverarbeitung und Mustererkennung Image Processing and Pattern Recognition

Important Question with Answer

Application Note Noise Frequently Asked Questions

Consolidated Visualization of Enormous 3D Scan Point Clouds with Scanopy

Number Sense and Operations

Touchstone -A Fresh Approach to Multimedia for the PC

Chapter 8 - Power Density Spectrum

Electrical Resonance

Outdoor beam tracing over undulating terrain

H.Calculating Normal Vectors

Determining the Resolution of Scanned Document Images

Timing Errors and Jitter

CONFOCAL LASER SCANNING MICROSCOPY TUTORIAL

Signal to Noise Instrumental Excel Assignment

Introduction to Medical Imaging. Lecture 11: Cone-Beam CT Theory. Introduction. Available cone-beam reconstruction methods: Our discussion:

FFT Algorithms. Chapter 6. Contents 6.1

TCOM 370 NOTES 99-4 BANDWIDTH, FREQUENCY RESPONSE, AND CAPACITY OF COMMUNICATION LINKS

The Whys, Hows and Whats of the Noise Power Spectrum. Helge Pettersen, Haukeland University Hospital, NO

Lectures 6&7: Image Enhancement

Broadband Networks. Prof. Dr. Abhay Karandikar. Electrical Engineering Department. Indian Institute of Technology, Bombay. Lecture - 29.

MODULATION TRANSFER FUNCTION MEASUREMENT METHOD AND RESULTS FOR THE ORBVIEW-3 HIGH RESOLUTION IMAGING SATELLITE

SIGNAL PROCESSING & SIMULATION NEWSLETTER

Recent Advances and Future Trends in Graphics Hardware. Michael Doggett Architect November 23, 2005

The Fourier Analysis Tool in Microsoft Excel

Introduction to Computer Graphics

Computer Graphics Hardware An Overview

Fundamentals of modern UV-visible spectroscopy. Presentation Materials

Transcription:

Antialiasing CS 319 Advanced Topics in Computer Graphics John C. Hart

Aliasing Aliasing occurs when signals are sampled too infrequently, giving the illusion of a lower frequency signal alias noun (c. 1605) an assumed or additional name f(t) = sin 1.9πt Plotted for t [1,20] Sampled at integer t Reconstructed signal appears to be f(t) = sin 0.1πt

Zone Plate f(x,y) = sin(x 2 + y 2 ) Gray-level plot above Evaluated over [-10,10] 2 1000 1000 samples (more than needed) Frequency = (x 2 + y 2 )/2π About 30Hz (cycles per unit length) in the corners Poorly sampled version below Only 100 100 samples Moire patterns in higher frequency areas Moire patterns resemble center of zone plate Low frequency features replicated in under-sampled high frequency regions

Image Functions Analog image 2-D region of varying color Continuous e.g. optical image Symbolic image Any function of two real variables Continuous e.g. sin(x 2 + y 2 ), theoretical rendering Digital image 2-D array of uniformly spaced color pixel values Discrete e.g. framebuffer

Photography Scanning Display Analog Image Digital Image Analog Image

Graphics Rendering Display Symbolic Image Digital Image Analog Image

Sampling and Reconstruction Continuous Image Sampling Discrete Samples Reconstruction Continuous Image 1 1 p Sampling Function p Reconstruction Kernel

1-D Fourier Transform Makes any signal I(x) out of sine waves Converts spatial domain into frequency domain Yields spectrum F(u) of frequencies u u is actually complex Only worried about amplitude: u DC term: F(0) = mean I(x) Symmetry: F(-u) = F(u) I Spatial p x F Frequency 0 1/p u

Product and Convolution Product of two functions is just their product at each point Convolution is the sum of products of one function at a point and the other function at all other points E.g. Convolution of square wave with square wave yields triangle wave Convolution in spatial domain is product in frequency domain, and vice versa f*g FG fg F*G

Sampling Functions Sampling takes measurements of a continuous function at discrete points Equivalent to product of continuous function and sampling function Uses a sampling function s(x) Sampling function is a collection of spikes Frequency of spikes corresponds to their resolution Frequency is inversely proportional to the distance between spikes Fourier domain also spikes Distance between spikes is the frequency s(x) S(u) Spatial Domain Frequency Domain 1/p p

Sampling I(x) F(u) s(x) (Is)(x) p 1/p S(u) (F*S)(u) s (x) S (u) (Is )(x) (F*S )(u) Aliasing, can t retrieve original signal

Shannon s Sampling Theorem Sampling frequency needs to be at least twice the highest signal frequency Otherwise the first replica interferes with the original spectrum Sampling below this Nyquist limit leads to aliasing Conceptually, need one sample for each peak and another for each valley max {u : F(u) > ε} 1/p > 2 max u

Prefiltering Aliases occur at high frequencies Sharp features, edges Fences, stripes, checkerboards Prefiltering removes the high frequency components of an image before it is sampled Box filter (in frequency domain) is an ideal low pass filter Preserves low frequencies Zeros high frequencies Inverse Fourier transform of a box function is a sinc function sinc(x) = sin(x)/x Convolution with a sinc function removes high frequencies Spatial Domain sinc(x) I(x) (I*sinc)(x) Frequency Domain DC Term box(u) F(u) (F box)(u)

Prefiltering Can Prevent Aliasing s (x) S (u) (Is )(x) (F*S )(u) I = (I*sinc) F = (F box) (I s )(x) (F *S )(u) (sinc)*(i s )(x) (box)(f *S )(u)

2-D Fourier Transform Converts spatial image into frequency spectrum image Distance from origin corresponds to frequency Angle about origin corresponds to direction frequency occurs diag. \ freq. vert. freq. diag. / freq. hor. freq. diag. / freq. DC vert. freq. hor. freq. diag. \ freq.

Analytic Diamond Example: a Gaussian diamond function I(x,y) = e -1 e- x y Fourier transform of I yields -1 0 1 I(x,y) < 0 Spectrum has energy at infinitely high horizontal and vertical frequencies Limited bandwidth for diagonal frequencies Dashed line can be placed arbitrarily close to tip of diamond, yielding a signal with arbitrarily high frequencies F(u,v)

Sampled Diamond Sample every 0.1 units: Sampling frequency is 10 Hz (samples per unit length) Frequencies overlap with replicas of diamond s spectrum centered at 10Hz Aliasing causes blocking quantization artifacts Frequencies of staircase edge include ~10 Hz and ~20 Hz copies of diamond s analytical spectrum centered about the DC (0Hz) term -2-1 0 1 2-20 -10 0 10 20

Diamond Edges Plot one if I(x,y) 0, otherwise zero Aliasing causes jaggy staircase edges Frequencies of staircase edge include ~10 Hz and ~20 Hz copies of diamond s analytical spectrum centered about the DC (0Hz) term 1-20 -10 0 10 20

Antialiasing Strategies Pixel needs to represent average color over its entire area 1. Prefiltering averages the image function so a single sample represents the average color Limits bandwidth of image signal to avoid overlap 2. Supersampling Supersampling averages together many samples over pixel area Moves the spectral replicas farther apart in frequency domain to avoid overlap Prefiltering Supersampling

Cone Tracing Amanatides SIGGRAPH 84 Replace rays with cones Cone samples pixel area Intersect cone with objects Analytic solution of cone-object intersection similar to ray-object intersection Expensive Images courtesy John Amanatides

Beam Tracing Heckbert & Hanrahan SIGGRAPH 84 Replace rays with generalized pyramids Intersection with polygonal scenes Plane-plane intersections easy, fast Existing scan conversion antialiasing Can perform some recursive beam tracing Scene transformed to new viewpoint Result clipped to reflective polygon

Covers

Supersampling Trace at higher resolution, average results Adaptive supersampling trace at higher resolution only where necessary Problems Does not eliminate aliases (e.g. moire patterns) Makes aliases higher-frequency Due to uniformity of samples

Stochastic Sampling Eye is extremely sensitive to patterns Remove pattern from sampling Randomize sampling pattern Result: patterns -> noise Some noises better than others Jitter: Pick n random points in sample space Easiest, but samples cluster Uniform Jitter: Subdivide sample space into n regions, and randomly sample in each region Easier, but can still cluster Poisson Disk: Pick n random points, but not too close to each other Samples can t cluster, but may run out of room

Adaptive Stochastic Sampling Proximity inversely proportional to variance How to generate patterns at various levels? Cook: Jitter a quadtree Dippe/Wold: Jitter a k-d tree Dippe/Wold: Poisson disk on the fly - too slow Mitchell: Precompute levels - fast but granular

Reconstruction g(x 1 ) g(x 2 ) g(x 3 ) g(x 4 ) k

OpenGL Aliases Aliasing due to rasterization Opposite of ray casting New polygons-to-pixels strategies Prefiltering Edge aliasing Analytic Area Sampling A-Buffer Texture aliasing MIP Mapping Summed Area Tables Postfiltering Accumulation Buffer

Analytic Area Sampling Ed Catmull, 1978 Eliminates edge aliases Clip polygon to pixel boundary Sort fragments by depth Clip fragments against each other Scale color by visible area Sum scaled colors

A-Buffer Loren Carpenter, 1984 Subdivides pixel into 4x4 bitmasks Clipping = logical operations on bitmasks Bitmasks used as index to lookup table

Texture Aliasing Image mapped onto polygon Occur when screen resolution differs from texture resolution Magnification aliasing Screen resolution finer than texture resolution Multiple pixels per texel Minification aliasing Screen resolution coarser than texture resolution Multiple texels per pixel

Magnification Filtering Nearest neighbor Equivalent to spike filter Linear interpolation Equivalent to box filter

Minification Filtering Multiple texels per pixel Potential for aliasing since texture signal bandwidth greater than framebuffer Box filtering requires averaging of texels Precomputation MIP Mapping Summed Area Tables

MIP Mapping Lance Williams, 1983 Create a resolution pyramid of textures Repeatedly subsample texture at half resolution Until single pixel Need extra storage space Accessing Use texture resolution closest to screen resolution Or interpolate between two closest resolutions

Summed Area Table Frank Crow, 1984 Replaces texture map with summed-area texture map S(x,y) = sum of texels <= x,y Need double range (e.g. 16 bit) Creation Incremental sweep using previous computations S(x,y) = T(x,y) + S(x-1,y) + S(x,y-1) - S(x-1,y-1) Accessing Σ T([x 1,x 2 ],[y 1,y 2 ]) = S(x 2,y 2 ) S(x 1,y 2 ) S (x 2,y 1 ) + S(x 1,y 1 ) Ave T([x 1,x 2 ],[y 1,y 2 ])/((x 2 x 1 )(y 2 y 1 )) x-1,y-1 x 1,y 1 x,y x 2,y 2

Accumulation Buffer Increases OpenGL s resolution Render the scene 16 times Shear projection matrices Samples in different location in pixel Average result Jittered, but same jitter sampling pattern in each pixel