Aliasing, Image Sampling and Reconstruction



Similar documents
The continuous and discrete Fourier transforms

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

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

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

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

SIGNAL PROCESSING & SIMULATION NEWSLETTER

How To Understand The Nyquist Sampling Theorem

Computational Foundations of Cognitive Science

Lecture 14. Point Spread Function (PSF)

Introduction to Digital Audio

Time series analysis Matlab tutorial. Joachim Gross

SIGNAL PROCESSING FOR EFFECTIVE VIBRATION ANALYSIS

Linear Filtering Part II

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

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

5 Signal Design for Bandlimited Channels

SGN-1158 Introduction to Signal Processing Test. Solutions

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

INTRODUCTION TO RENDERING TECHNIQUES

Analog and Digital Signals, Time and Frequency Representation of Signals

Analog Representations of Sound

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

Analysis/resynthesis with the short time Fourier transform

Convolution, Correlation, & Fourier Transforms. James R. Graham 10/25/2005

Analog signals are those which are naturally occurring. Any analog signal can be converted to a digital signal.

Superresolution images reconstructed from aliased images

Design of FIR Filters

CHAPTER 6 Frequency Response, Bode Plots, and Resonance

The Fourier Analysis Tool in Microsoft Excel

Introduction to Complex Fourier Series

Short-time FFT, Multi-taper analysis & Filtering in SPM12

Electronic Communications Committee (ECC) within the European Conference of Postal and Telecommunications Administrations (CEPT)

1995 Mixed-Signal Products SLAA013

jorge s. marques image processing

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

Improving A D Converter Performance Using Dither

Digital Imaging and Multimedia. Filters. Ahmed Elgammal Dept. of Computer Science Rutgers University

Probability and Random Variables. Generation of random variables (r.v.)

Frequency Response of FIR Filters

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

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

DIGITAL IMAGE PROCESSING AND ANALYSIS

Composite Video Separation Techniques

ADC and DAC. Quantization

The front end of the receiver performs the frequency translation, channel selection and amplification of the signal.

Application of Fourier Transform to PDE (I) Fourier Sine Transform (application to PDEs defined on a semi-infinite domain)

4 Sums of Random Variables

(2) (3) (4) (5) 3 J. M. Whittaker, Interpolatory Function Theory, Cambridge Tracts

Voice---is analog in character and moves in the form of waves. 3-important wave-characteristics:

7. Beats. sin( + λ) + sin( λ) = 2 cos(λ) sin( )

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

Lectures 6&7: Image Enhancement

The Heat Equation. Lectures INF2320 p. 1/88

Digital Transmission of Analog Data: PCM and Delta Modulation

The Calculation of G rms

Lecture 7 ELE 301: Signals and Systems

Introduction to IQ-demodulation of RF-data

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

Chapter 8 - Power Density Spectrum

Appendix D Digital Modulation and GMSK

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

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

Dithering in Analog-to-digital Conversion

Function Guide for the Fourier Transformation Package SPIRE-UOL-DOC

FAST Fourier Transform (FFT) and Digital Filtering Using LabVIEW

FFT Algorithms. Chapter 6. Contents 6.1

Computational Optical Imaging - Optique Numerique. -- Deconvolution --

High Quality Image Magnification using Cross-Scale Self-Similarity

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

DDS. 16-bit Direct Digital Synthesizer / Periodic waveform generator Rev Key Design Features. Block Diagram. Generic Parameters.

Lecture 8 ELE 301: Signals and Systems

DIGITAL-TO-ANALOGUE AND ANALOGUE-TO-DIGITAL CONVERSION

Lab 1. The Fourier Transform

South Carolina College- and Career-Ready (SCCCR) Pre-Calculus

Acceleration levels of dropped objects

PHYS 39a Lab 3: Microscope Optics

Wavelet analysis. Wavelet requirements. Example signals. Stationary signal 2 Hz + 10 Hz + 20Hz. Zero mean, oscillatory (wave) Fast decay (let)

Fundamentals of modern UV-visible spectroscopy. Presentation Materials

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

Bildverarbeitung und Mustererkennung Image Processing and Pattern Recognition

Resolution Enhancement of images with Interpolation and DWT-SWT Wavelet Domain Components

Performance Verification of Super-Resolution Image Reconstruction

PHYS 331: Junior Physics Laboratory I Notes on Noise Reduction

Signal to Noise Instrumental Excel Assignment

Machine vision systems - 2

8 Filtering. 8.1 Mathematical operation

Imageprocessing. Errors of measurements

Frequency Response of Filters

How To Understand The Discrete Fourier Transform

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

Controller Design in Frequency Domain

Taking the Mystery out of the Infamous Formula, "SNR = 6.02N dB," and Why You Should Care. by Walt Kester

What the Nyquist Criterion Means to Your Sampled Data System Design. by Walt Kester

Auto-Tuning Using Fourier Coefficients

Convolution. 1D Formula: 2D Formula: Example on the web:

Transcription:

Aliasing, Image Sampling and Reconstruction Recall: a pixel is a point It is NOT a box, disc or teeny wee light It has no dimension It occupies no area It can have a coordinate More than a point, it is a SAMPLE Many of the slides are taken from Thomas Funkhouser course slides and the rest from various sources over the web Image Sampling An image is a D rectilinear array of samples o Quantization due to limited intensity resolution o Sampling due to limited spatial and temporal resolution Imaging devices area sample. In video camera the CCD array is an area integral over a pixel. The eye: photoreceptors Intensity, I Pixels are infinitely small point samples J. Liang, D. R. Williams and D. Miller, "Supernormal vision and high- resolution retinal imaging through adaptive optics," J. Opt. Soc. Am. A 4, 884-89 (997) Sampling and Reconstruction Reconstruction artefact Figure 9.9 FvDFH Slide Rosalee Nerheim-Wolfe

Sampling and Reconstruction Sampling Reconstruction Sources of Error Intensity quantization o Not enough intensity resolution Spatial aliasing o Not enough spatial resolution Temporal aliasing o Not enough temporal resolution E = ( I( x, y) P( x, y) ) ( x, y) Aliasing (in general) In general: o Artifacts due to under-sampling or poor reconstruction Specifically, in graphics: o Spatial aliasing o Temporal aliasing Under-sampling Figure 4.7 FvDFH Sampling & Aliasing Real world is continuous The computer world is discrete Mapping a continuous function to a discrete one is called sampling Mapping a continuous variable to a discrete one is called quantizaion To represent or render an image using a computer, we must both sample and quantize Spatial Aliasing Artifacts due to limited spatial resolution Can be a serious problem Slide Rosalee Nerheim-Wolfe

Spatial Aliasing Artifacts due to limited spatial resolution Temporal Aliasing Artifacts due to limited temporal resolution o Strobing o Flickering Jaggies Temporal Aliasing Artifacts due to limited temporal resolution o Strobing o Flickering Temporal Aliasing Artifacts due to limited temporal resolution o Strobing o Flickering Temporal Aliasing Artifacts due to limited temporal resolution o Strobing o Flickering Staircasing or Jaggies The raster aliasing effect removal is called antialiasing Images by Don Mitchell 3

Nearest neighbor sampling Filtered Texture: Blurring doesn t work well. Unweighted Area Sampling Removed the jaggies, but also all the detail! Reduction in resolution Weighted Area Sampling with Overlap 4

Sampling and Reconstruction Antialiasing Sample at higher rate o Not always possible o Doesn t always solve problem Pre-filter to form bandlimited signal o Form bandlimited function (low-pass filter) o Trades aliasing for blurring Must consider sampling theory! Figure 9.9 FvDFH How is antialiasing done? We need some mathematical tools to o analyse the situation. o find an optimum solution. Tools we will use : o Fourier transform. o Convolution theory. o Sampling theory. Spectral Analysis / Fourier Transforms Spectral representation treats the function as a weighted sum of sines and cosines Every function has two representations o Spatial (time) domain - normal representation o Frequency domain - spectral representation The Fourier transform converts between the spatial and frequency domains. We need to understand the behavior of the signal in frequency domain Spectral Analysis / Fourier Transforms Note the Euler formula : Spatial domain e it iωx = f ( x e dx F( ω ) ) = cos t + i sin t i f x = Π F ω e ω x ( ) ( ) dω Frequency domain. Fourier transform conventions. We will use the optical convention. F(ω) f(x) The Fourier transform converts between the spatial and frequency domain. Real and imaginary components. Forward and reverse transforms very similar. Note : spectral transform has origin in centre, and is symmetrical Low frequencies in centre, High frequencies at the edge. Note symmetry. 5

Sampling Theory How many samples are required to represent a given signal without loss of information? What signals can be reconstructed without loss for a given sampling rate? Spectral Analysis Spatial domain: o Function: f(x) o Filtering: convolution Frequency domain: o Function: F(u) o Filtering: multiplication Any signal can be written as a sum of periodic functions. -D Fourier Transform F( u) = I( x)exp( jux) dx π Makes any signal I(x) out of sine I( x) = F( u)exp( jux) du π waves j = Converts spatial domain into exp( jux) = cosux j sin ux frequency domain a + bj = a + b arg a + bj = arctan( b / a) Yields spectrum F(u) of frequencies u Spatial Frequency o u is actually complex p /p I F o Only worried about amplitude: u x u 0 DC term: F(0) = mean I(x) Symmetry: F(-u) = F(u) Fourier Transform Figure.6 Wolberg Fourier Transform Sampling Theorem A signal can be reconstructed from its samples, if the original signal has no frequencies above / the sampling frequency - Shannon The minimum sampling rate for bandlimited function is called Nyquist rate Figure.5 Wolberg A signal is bandlimited if its highest frequency is bounded. The frequency is called the bandwidth. 6

Convolution Convolution of two functions (= filtering): g ( x) = f ( x) h( x) = f ( λ) h( x λ) dλ Antialiasing in Image Processing General Strategy o Pre-filter transformed image via convolution with low-pass filter to form bandlimited signal Rationale o Prefer blurring over aliasing Convolution theorem o Convolution in frequency domain is same as multiplication in spatial domain, and vice-versa Filtering in the frequency domain Low and High Pass Filtering. Image Fourier Transform Frequency domain Filter Fourier Transform Image Low pass Lowpass filter Highpass filter High pass Low-pass Filtering Low-pass Filtering 7

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 ( gh )( x) = g( x) h( x) ( g * h)( x) = g( s) h( x s) ds Filtering in the space domain Blurring or averaging pixels together. Increment x g(y) f(x) Integrate over y h(x) h ( x) = f g = f ( x) g( x y) dy Calculate integral of one function, f(x) by a sliding second function g(x-y). Known as Convolution. Low-pass Filtering 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 /p p Sampling, the Comb function How can we represent sampling? Multiplication of the sample with a regular train of delta functions. 8

Sampling: Frequency domain. Reconstruction in frequency domain The Fourier transform of regular comb of delta functions is a comb. Spacing is inversely proportional Multiple solutions at regularly increasing values of f Original signal. Bandpass filter due to regular array of pixels. Undersampling leads to aliasing. Sampling I(x) F(u) s(x) (Is)(x) p /p S(u) (F*S)(u) Samples are too close together in f. Spurious components : Cause of aliasing. s (x) (Is )(x) S (u) (F*S )(u) Aliasing, can t retrieve original signal Shannon s Sampling Theorem The 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) > ε} p > max u This result is known as the Sampling Theorem and is due to Claude Shannon who first discovered it in 949 A signal can be reconstructed from its samples without loss of information, if the original signal has no frequencies above / the sampling frequency For a given bandlimited function, the rate at which it must be sampled is called the Nyquist Frequency 9

Prefiltering Spatial Domain Frequency Domain Prefiltering Can Prevent Aliasing 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 sinc(x) I(x) (I*sinc)(x) DC Term box(u) F(u) (F box)(u) s (x) (Is )(x) I = (I*sinc) (I s )(x) (sinc)*(i s )(x) S (u) (F*S )(u) F = (F box) (F *S )(u) (box)(f *S )(u) Aliasing in the space domain. Sampling at the Nyquist Frequency Original signal Aliased result Summary : Aliasing is the appearance of spurious signals when the frequency of the input signal goes above the Nyquist limit. Sampling Below the Nyquist Frequency How do we remove aliasing? Perfect solution - prefilter with perfect bandpass filter. No aliasing. Perfect bandpass Aliased example 0

How do we remove aliasing? How do we remove aliasing? Perfect solution - prefilter with perfect bandpass filter. o Difficult/Impossible to do in frequency domain. Convolve with sinc function in space domain o Optimal filter - better than area sampling. o Sinc function is infinite!! o Computationally expensive. Cheaper solution : take multiple samples for each pixel and average them together supersampling. Can weight them towards the centre weighted average sampling Stochastic sampling Removing aliasing is called antialiasing The Sinc function. square / iωx iωx ( x) e dx = e dx / Recall Euler s formula : e it = cos t + i sin t iωx e = iωx iω iω sin ω e e = = iω + iω ω = sinc f

The Sinc Filter Common Filters Sample-and-Hold Image Reconstruction Re-create continuous image from samples o Example: cathode ray tube Image is reconstructed by displaying pixels with finite area (Gaussian) End Adjusting Brightness Simply scale pixel components o Must clamp to range (e.g., 0 to 55) Original Brighter

Adjusting Contrast Compute mean luminance for all pixels o luminance = 0.30*r + 0.59*g + 0.*b Image Processing Consider reducing the image resolution Scale deviation from o Must clamp to range (e.g., 0 to 55) for each pixel component Original More Contrast Original image /4 resolution Image Processing Image processing is a resampling problem Resampling Thou shalt avoid aliasing! Image Processing Quantization o Uniform Quantization o Random dither o Ordered dither o Floyd-Steinberg dither Pixel operations o Add random noise o Add luminance o Add contrast o Add saturation Filtering o Blur o Detect edges Warping o Scale o Rotate o Warps Combining o Morphs o Composite Adjust Blurriness Convolve with a filter whose entries sum to one o Each pixel becomes a weighted average of its neighbors Edge Detection Convolve with a filter that finds differences between neighbor pixels Original Blur Original Detect edges 6 Filter = 6 6 6 4 6 6 6 6 6 Filter = + 8 3

Image Processing Quantization o Uniform Quantization o Random dither o Ordered dither o Floyd-Steinberg dither Pixel operations o Add random noise o Add luminance o Add contrast o Add saturation Filtering o Blur o Detect edges Warping o Scale o Rotate o Warps Combining o Morphs o Composite Scaling Resample with triangle or Gaussian filter More on this next lecture! Original /4X resolution 4X resolution Summary Image processing is a resampling problem o Avoid aliasing o Use filtering Triangle Filter Convolution with triangle filter Convolution with Gaussian filter Figure.4 Wolberg 4