University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Sampling and Reconstruction.

Slides:



Advertisements
Similar presentations
Sampling and Reconstruction
Advertisements

3-D Computational Vision CSc Image Processing II - Fourier Transform.
Advanced Computer Graphics (Spring 2006) COMS 4162, Lecture 4: Image Processing 1 Ravi Ramamoorthi
Advanced Computer Graphics CSE 190 [Spring 2015], Lecture 4 Ravi Ramamoorthi
Fourier Transform (Chapter 4)
Fourier Transform – Chapter 13. Fourier Transform – continuous function Apply the Fourier Series to complex- valued functions using Euler’s notation to.
School of Computing Science Simon Fraser University
Advanced Computer Graphics (Fall 2010) CS 283, Lecture 3: Sampling and Reconstruction Ravi Ramamoorthi Some slides.
1 Image filtering Hybrid Images, Oliva et al.,
Convolution, Edge Detection, Sampling : Computational Photography Alexei Efros, CMU, Fall 2006 Some slides from Steve Seitz.
CSCE 641 Computer Graphics: Image Sampling and Reconstruction Jinxiang Chai.
Image Processing : Computational Photography Alexei Efros, CMU, Fall 2006 Some figures from Steve Seitz, and Gonzalez et al.
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
Linear filtering. Overview: Linear filtering Linear filters Definition and properties Examples Gaussian smoothing Separability Applications Denoising.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Sampling Week 7, Fri 17 Oct 2003 p1 demos sampling.
1 Image filtering Images by Pawan SinhaPawan Sinha.
1 Image filtering
Sampling and Aliasing Kurt Akeley CS248 Lecture 3 2 October 2007
1 Images and Transformations Images by Pawan SinhaPawan Sinha.
Advanced Computer Graphics (Spring 2005) COMS 4162, Lecture 3: Sampling and Reconstruction Ravi Ramamoorthi
1 Image filtering Hybrid Images, Oliva et al.,
Image Sampling Moire patterns -
Most slides from Steve Seitz
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
Computer Vision Spring ,-685 Instructor: S. Narasimhan Wean 5403 T-R 3:00pm – 4:20pm.
Chapter 4: Sampling of Continuous-Time Signals
… 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.
Topic 7 - Fourier Transforms DIGITAL IMAGE PROCESSING Course 3624 Department of Physics and Astronomy Professor Bob Warwick.
EE D Fourier Transform. Bahadir K. Gunturk EE Image Analysis I 2 Summary of Lecture 2 We talked about the digital image properties, including.
University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell Image processing.
Filtering Robert Lin April 29, Outline Why filter? Filtering for Graphics Sampling and Reconstruction Convolution The Fourier Transform Overview.
09/19/2002 (C) University of Wisconsin 2002, CS 559 Last Time Color Quantization Dithering.
Image Processing Basics. What are images? An image is a 2-d rectilinear array of pixels.
CMSC 635 Sampling and Antialiasing. Aliasing in images.
CS559: Computer Graphics Lecture 4: Compositing and Resampling Li Zhang Spring 2008.
02/05/2002 (C) University of Wisconsin 2002, CS 559 Last Time Color Quantization Mach Banding –Humans exaggerate sharp boundaries, but not fuzzy ones.
Mestrado em Ciência de Computadores Mestrado Integrado em Engenharia de Redes e Sistemas Informáticos VC 15/16 – TP7 Spatial Filters Miguel Tavares Coimbra.
2D Sampling Goal: Represent a 2D function by a finite set of points.
Sampling Theorem & Antialiasing
Fourier Transform.
Fourier Transform (Chapter 4) CS474/674 – Prof. Bebis.
Sampling Week 7, Fri 17 Oct 2003 p1 demos sampling.
Advanced Computer Graphics
Advanced Computer Graphics
… Sampling … … Filtering … … Reconstruction …
Sampling Theorem & Antialiasing
(C) 2002 University of Wisconsin, CS 559
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.
IMAGE PROCESSING AKSHAY P S3 EC ROLL NO. 9.
Image filtering Images by Pawan Sinha.
CSCE 643 Computer Vision: Image Sampling and Filtering
CSCE 643 Computer Vision: Thinking in Frequency
Sampling and Reconstruction
4. Image Enhancement in Frequency Domain
Image filtering Images by Pawan Sinha.
Image Processing Today’s readings For Monday
Filtering Part 2: Image Sampling
Linear filtering.
Lecture 5: Resampling, Compositing, and Filtering Li Zhang Spring 2008
Most slides from Steve Seitz
Image filtering Images by Pawan Sinha.
Image filtering
Image filtering
Intensity Transformation
Most slides from Steve Seitz
Presentation transcript:

University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Sampling and Reconstruction

2 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Reading Required: Watt, Section 14.1 Recommended: 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 , 1988.

3 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell What is an image? 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: We’ll focus in grayscale (scalar-valued) images for now.

4 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Images as functions

5 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell 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  ) }

6 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell 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…

7 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Fourier transforms We can represent a function as a linear combination (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: Frequency domain Spatial domain

8 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Fourier transforms (cont’d) Where do the sines and cosines come in? f(x) is usually a real signal, but F(s) is generally complex: If f(x) is symmetric, i.e., f(x) = f(-x)), then F(s) = Re(s). Why? Frequency domain Spatial domain

9 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell 1D Fourier examples

10 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell 2D Fourier transform Frequency domain Spatial domain Spatial domainFrequency domain

11 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell 2D Fourier examples Spatial domain Frequency domain

12 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Convolution One of the most common methods for filtering a function is called convolution. In 1D, convolution is defined as: where

13 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Convolution properties Convolution exhibits a number of basic, but important properties. Commutativity: Associativity: Linearity:

14 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Convolution in 2D In two dimensions, convolution becomes: where * = f(x,y)f(x,y)h(x,y)h(x,y)g(x,y)g(x,y)

15 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Convolution theorems Convolution theorem: Convolution in the spatial domain is equivalent to multiplication in the frequency domain. Symmetric theorem: Convolution in the frequency domain is equivalent to multiplication in the spatial domain.

16 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Convolution theorems Theorem Proof (1)

17 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell 1D convolution theorem example

18 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell 2D convolution theorem example * f(x,y)f(x,y) h(x,y)h(x,y) g(x,y)g(x,y) |F(s x,s y )| |H(s x,s y )| |G(s x,s y )|

19 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell The delta function 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:

20 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Sifting and shifting For sampling, the delta function has two important properties. Sifting: Shifting:

21 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell 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: Amazingly, the Fourier transform of the shah function takes the same form: where s o = 1/T.

22 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Now, we can talk about sampling. The Fourier spectrum gets replicated by spatial sampling! How do we recover the signal? Sampling

23 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Sampling and reconstruction

24 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Sampling and reconstruction in 2D

25 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Sampling theorem This result is known as the Sampling Theorem and is generally attributed to Claude Shannon (who discovered it in 1949) but was discovered earlier, independently by at least 4 others: 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.

26 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell 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…

27 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Cubic filters Mitchell and Netravali (1988) experimented with cubic filters, reducing them all to the following form: 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.”

28 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Reconstruction filters in 2D We can also perform reconstruction in 2D…

29 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Aliasing Sampling rate is too low

30 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Aliasing What if we go below the Nyquist frequency?

31 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Anti-aliasing Anti-aliasing is the process of removing the frequencies before they alias.

32 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell We can fill the “magic” box with analytic pre- filtering of the signal: Why may this not generally be possible? Anti-aliasing by analytic prefiltering

33 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Filtered downsampling Alternatively, we can sample the image at a higher rate, and then filter that signal: We can now sample the signal at a lower rate. The whole process is called filtered downsampling or supersampling and averaging down.

34 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell 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:

35 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Practical upsampling 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!

36 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell 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

37 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell 2D resampling We’ve been looking at separable filters: How might you use this fact for efficient resampling in 2D?

38 University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Next class: Image Processing Reading: Jain, Kasturi, Schunck, Machine Vision. McGraw-Hill, Sections , 4.5(intro), 4.5.5, 4.5.6, (from course reader) Topics: -Implementing discrete convolution -Blurring and noise reduction -Sharpening -Edge detection