Reading. 2. Fourier analysis and sampling theory. Required: Watt, Section 14.1 Recommended:

Similar documents
Fourier analysis and sampling theory

Sampling and Reconstruction

Image processing. Reading. What is an image? Brian Curless CSE 457 Spring 2017

Outline. Sampling and Reconstruction. Sampling and Reconstruction. Foundations of Computer Graphics (Fall 2012)

Motivation. The main goal of Computer Graphics is to generate 2D images. 2D images are continuous 2D functions (or signals)

Outline. Foundations of Computer Graphics (Spring 2012)

To Do. Advanced Computer Graphics. Sampling and Reconstruction. Outline. Sign up for Piazza

The main goal of Computer Graphics is to generate 2D images 2D images are continuous 2D functions (or signals)

Basics. Sampling and Reconstruction. Sampling and Reconstruction. Outline. (Spatial) Aliasing. Advanced Computer Graphics (Fall 2010)

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

Sampling: Application to 2D Transformations

Lecture 5: Frequency Domain Transformations

Aliasing and Antialiasing. ITCS 4120/ Aliasing and Antialiasing

Advanced Computer Graphics. Aliasing. Matthias Teschner. Computer Science Department University of Freiburg

Introduction to Computer Vision. Week 3, Fall 2010 Instructor: Prof. Ko Nishino

Computer Vision and Graphics (ee2031) Digital Image Processing I

Computer Graphics. Sampling Theory & Anti-Aliasing. Philipp Slusallek

Lecture 2: 2D Fourier transforms and applications

Sampling and Monte-Carlo Integration

Broad field that includes low-level operations as well as complex high-level algorithms

Lecture 4: Image Processing

Fourier Transform in Image Processing. CS/BIOEN 6640 U of Utah Guido Gerig (slides modified from Marcel Prastawa 2012)

Image Filtering, Warping and Sampling

Digital Image Processing. Lecture 6

Drawing a Triangle (and an introduction to sampling)

Computer Graphics. Texture Filtering & Sampling Theory. Hendrik Lensch. Computer Graphics WS07/08 Texturing

Image Processing. Bilkent University. CS554 Computer Vision Pinar Duygulu

Scaled representations

To Do. Advanced Computer Graphics. Discrete Convolution. Outline. Outline. Implementing Discrete Convolution

Drawing a Triangle (and an Intro to Sampling)

Computational Aspects of MRI

Sampling, Aliasing, & Mipmaps

Lecture 6 Basic Signal Processing

Announcements. Image Matching! Source & Destination Images. Image Transformation 2/ 3/ 16. Compare a big image to a small image

Fourier transform of images

Theoretically Perfect Sensor

Theoretically Perfect Sensor

CS4442/9542b Artificial Intelligence II prof. Olga Veksler

Aliasing. Can t draw smooth lines on discrete raster device get staircased lines ( jaggies ):

Biomedical Image Analysis. Spatial Filtering

Sampling, Aliasing, & Mipmaps

COMP 9517 Computer Vision

Filters and Fourier Transforms

CS354 Computer Graphics Sampling and Aliasing

CPSC 425: Computer Vision

BME I5000: Biomedical Imaging

Image preprocessing in spatial domain

Computer Vision: 4. Filtering. By I-Chen Lin Dept. of CS, National Chiao Tung University

Image preprocessing in spatial domain

Section Graphs of the Sine and Cosine Functions

CS4442/9542b Artificial Intelligence II prof. Olga Veksler

Image Processing: Discrete Images

Sampling and Reconstruction. Most slides from Steve Marschner

Sampling, Aliasing, & Mipmaps

Ulrik Söderström 17 Jan Image Processing. Introduction

2D Image Processing INFORMATIK. Kaiserlautern University. DFKI Deutsches Forschungszentrum für Künstliche Intelligenz

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates

CS4670: Computer Vision

Why is computer vision difficult?

Edge and local feature detection - 2. Importance of edge detection in computer vision

Introduction to Sampled Signals and Fourier Transforms

Fourier transforms and convolution

Sampling, Resampling, and Warping. COS 426, Spring 2014 Tom Funkhouser

Central Slice Theorem

Image Enhancement in Spatial Domain. By Dr. Rajeev Srivastava

Graphics and Interaction Transformation geometry and homogeneous coordinates

Image Acquisition + Histograms

Lecture 4: Spatial Domain Transformations

Blob-Representation of Multidimensional Objects and Surfaces

convolution shift invariant linear system Fourier Transform Aliasing and sampling scale representation edge detection corner detection

Picking. Lecture 9. Using Back Buffer. Hw notes. Using OpenGL Selection Using Back Buffer

Image Sampling and Quantisation

Overview. Spectral Processing of Point- Sampled Geometry. Introduction. Introduction. Fourier Transform. Fourier Transform

Image Sampling & Quantisation

Biometrics Technology: Image Processing & Pattern Recognition (by Dr. Dickson Tong)

Filtering theory: Battling Aliasing with Antialiasing. Department of Computer Engineering Chalmers University of Technology

Being edited by Prof. Sumana Gupta 1

Phys. 428, Lecture 6

Problem 1 (10 Points)

Image restoration. Lecture 14. Milan Gavrilovic Centre for Image Analysis Uppsala University

Image Restoration. Yao Wang Polytechnic Institute of NYU, Brooklyn, NY 11201

Filtering Images. Contents

UNIT-2 IMAGE REPRESENTATION IMAGE REPRESENTATION IMAGE SENSORS IMAGE SENSORS- FLEX CIRCUIT ASSEMBLY

CS1114 Section 8: The Fourier Transform March 13th, 2013

Signals and Sampling. CMPT 461/761 Image Synthesis Torsten Möller. Machiraju/Möller

Applications of Image Filters

Fourier Transforms. Laboratory & Computational Physics 2

Image processing in frequency Domain

From multiple images to catalogs

Topics. View Aliasing. CT Sampling Requirements. Sampling Requirements in CT Sampling Theory Aliasing

L. David Sabbagh, Harold A. Sabbagh and James S. Klopfenstein Sabbagh Associates, Inc Round Hill Lane Bloomington, IN 47401

Aliasing And Anti-Aliasing Sampling and Reconstruction

EEM 561 Machine Vision. Week 3: Fourier Transform and Image Pyramids

Thinking in Frequency

Examination in Digital Image Processing, TSBB08

Digital Signal Processing Lecture Notes 22 November 2010

Filtering theory: Battling Aliasing with Antialiasing. Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology

Outline. Visualization Discretization Sampling Quantization Representation Continuous Discrete. Noise

f(x,y) is the original image H is the degradation process (or function) n(x,y) represents noise g(x,y) is the obtained degraded image p q

Edges, interpolation, templates. Nuno Vasconcelos ECE Department, UCSD (with thanks to David Forsyth)

Transcription:

Reading Required: Watt, Section 14.1 Recommended: 2. Fourier analysis and sampling theory Ron Bracewell, The Fourier Transform and Its Applications, McGraw-Hill. Don P. Mitchell and Arun N. Netravali, Reconstruction Filters in Computer Computer Graphics, Computer Graphics, (Proceedings of SIGGRAPH 88). 22 (4), pp. 221-228, 1988. 1 2

What is an image? Images as functions We can think of an image as a function, f, from R 2 to R: f( x, y ) gives the intensity of a channel at position ( x, y ) Realistically, we expect the image only to be defined over a rectangle, with a finite range: f: [a,b]x[c,d] [0,1] A color image is just three functions pasted together. We can write this as a vector-valued function: rxy (, ) f( x, y) = g( x, y) bxy (, ) We ll focus in grayscale (scalar-valued) images for now. 3 4

Digital images In computer graphics, we usually create or operate on digital (discrete) images: Sample the space on a regular grid Quantize each sample (round to nearest integer) If our samples are apart, we can write this as: f[i,j] = Quantize{ f(i, j ) } Motivation: filtering and resizing What if we now want to: smooth an image? sharpen an image? enlarge an image? shrink an image? Before we try these operations, it s helpful to think about images in a more mathematical way 5 6

Fourier transforms We can represent functions as a weighted sum of sines and cosines. We can think of a function in two complementary ways: Spatially in the spatial domain Spectrally in the frequency domain The Fourier transform and its inverse convert between these two domains: Fourier transforms (cont d) Spatial domain i2π sx Fs () = f( xe ) dx 2 f( x) Fse ( ) i π sx ds = Where do the sines and cosines come in? Frequency domain Spatial domain i2π sx Fs () f( xe ) dx = 2 f( x) Fse ( ) i π sx ds = Frequency domain f(x) is usually a real signal, but F(s) is generally complex: Fs () = As () + ibs () = Fs () e i2 πθ ( s) If f(x) is symmetric, i.e., f(x) = f(-x)), then F(s) = A(s). Why? 7 8

1D Fourier examples 2D Fourier transform Spatial domain i2 π ( s x+ s y) x y Fs (, s) f( x, ye ) dxdy x y = i2 π ( s x+ s y) x y x y x y f( x, y) Fs (, s ) e dsds = Frequency domain Spatial domain Frequency domain f( x, y) Fs (, s) x y 9 10

2D Fourier examples Convolution One of the most common methods for filtering a function is called convolution. In 1D, convolution is defined as: Spatial domain f( x, y) Frequency domain Fs (, s) x y gx ( ) = f( x) hx ( ) = f( x') h( x x') dx' = f( x') h% ( x' x) dx' where hx %( ) h( x). 11 12

Convolution properties Convolution in 2D Convolution exhibits a number of basic, but important properties. Commutativity: Associativity: ax ( ) bx ( ) = bx ( ) ax ( ) [ ax ( ) bx ( )] cx ( ) = ax ( ) [ bx ( ) cx ( )] In two dimensions, convolution becomes: gxy (, ) = f( xy, ) hxy (, ) = f ( x', y') h( x x', y y') dx' dy' = f ( x', y') h% ( x' x, y' y) dx' dy' where hxy %(, ) = h( x, y). Linearity: ax ( ) [ k bx ( )] = k [ ax ( ) bx ( )] ax ( ) ( bx ( ) + cx ( )) = ax ( ) bx ( ) + ax ( ) cx ( ) * = f(x,y) h(x,y) g(x,y) 13 14

Convolution theorems 1D convolution theorem example Convolution theorem: Convolution in the spatial domain is equivalent to multiplication in the frequency domain. f h F H Symmetric theorem: Convolution in the frequency domain is equivalent to multiplication in the spatial domain. f h F H 15 16

2D convolution theorem example The delta function f(x,y) F(s x,s y ) The Dirac delta function, δ(x), is a handy tool for sampling theory. It has zero width, infinite height, and unit area. It is usually drawn as: * h(x,y) H(s x,s y ) g(x,y) G(s x,s y ) 17 18

Sifting and shifting For sampling, the delta function has two important properties. Sifting: f( x) δ ( x a) = f( a) δ ( x a) The shah/comb function A string of delta functions is the key to sampling. The resulting function is called the shah or comb function: which looks like: III( x) = δ ( x nt) n= Shifting: f( x) δ ( x a) = f( x a) Amazingly, the Fourier transform of the shah function takes the same form: where s o = 1/T. III( s) = δ ( s ns ) n= o 19 20

Sampling Sampling and reconstruction Now, we can talk about sampling. The Fourier spectrum gets replicated by spatial sampling! How do we recover the signal? 21 22

Sampling and reconstruction in 2D Sampling theorem This result is 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 energy in frequencies at or above ½ the sampling frequency. For a given bandlimited function, the minimum rate at which it must be sampled is the Nyquist frequency. 23 24

Reconstruction filters The sinc filter, while ideal, has two drawbacks: It has large support (slow to compute) It introduces ringing in practice We can choose from many other filters Cubic filters Mitchell and Netravali (1988) experimented with cubic filters, reducing them all to the following form: 3 2 B C x + + B+ C x + B x < (12 9 6 ) ( 18 12 6 ) (6 2 ) 1 1 3 2 rx ( ) = (( B 6 Cx ) + (6B+ 30 Cx ) + ( 12B 48 Cx ) + (8B+ 24 C) 1 x< 2 6 0 otherwise The choice of B or C trades off between being too blurry or having too much ringing. B=C=1/3 was their visually best choice. The resulting reconstruction filter is often called the Mitchell filter. 1 0.5 0 2 1.5 1 0.5 0 0.5 1 1.5 2 25 26

Reconstruction filters in 2D Aliasing We can also perform reconstruction in 2D Sampling rate is too low 27 28

Aliasing What if we go below the Nyquist frequency? Anti-aliasing Anti-aliasing is the process of removing the frequencies before they alias. 29 30

Anti-aliasing by analytic prefiltering We can fill the magic box with analytic prefiltering of the signal: Filtered downsampling Alternatively, we can sample the image at a higher rate, and then filter that signal: Why may this not generally be possible? We can now sample the signal at a lower rate. The whole process is called filtered downsampling or supersampling and averaging down. 31 32

Practical upsampling Practical upsampling When resampling a function (e.g., when resizing an image), you do not need to reconstruct the complete continuous function. For zooming in on a function, you need only use a reconstruction filter and evaluate as needed for each new sample. Here s an example using a cubic filter: This can also be viewed as: 1. putting the reconstruction filter at the desired location 2. evaluating at the original sample positions 3. taking products with the sample values themselves 4. summing it up Important: filter should always be normalized! 33 34

Practical downsampling Downsampling is similar, but filter has larger support and smaller amplitude. Operationally: 1. Choose filter in downsampled space. 2. Compute the downsampling rate, d, ratio of new sampling rate to old sampling rate 3. Stretch the filter by 1/d and scale it down by d 4. Follow upsampling procedure (previous slides) to compute new values 2D resampling We ve been looking at separable filters: r ( x, y) = r ( x) r ( y) 2D 1D 1D How might you use this fact for efficient resampling in 2D? 35 36

Next class: Image Processing Reading: Jain, Kasturi, Schunck, Machine Vision. McGraw-Hill, 1995. Sections 4.2-4.4, 4.5(intro), 4.5.5, 4.5.6, 5.1-5.4. (from course reader) Topics: - Implementing discrete convolution - Blurring and noise reduction - Sharpening - Edge detection 37