Computer Graphics Recitation 7. 2 Motivation – Image compression What linear combination of 8x8 basis signals produces an 8x8 block in the image?

Slides:



Advertisements
Similar presentations
DCSP-3: Fourier Transform (continuous time) Jianfeng Feng
Advertisements

DCSP-3: Fourier Transform Jianfeng Feng Department of Computer Science Warwick Univ., UK
DCSP-11 Jianfeng Feng
Time Series II.
Fourier Transforms and Their Use in Data Compression
Digital Kommunikationselektronik TNE027 Lecture 5 1 Fourier Transforms Discrete Fourier Transform (DFT) Algorithms Fast Fourier Transform (FFT) Algorithms.
Fourier Transform (Chapter 4)
Fourier Transform – Chapter 13. Image space Cameras (regardless of wave lengths) create images in the spatial domain Pixels represent features (intensity,
School of Computing Science Simon Fraser University
Digital Image Processing
Computer Graphics Recitation 6. 2 Motivation – Image compression What linear combination of 8x8 basis signals produces an 8x8 block in the image?
Intro to Fourier Analysis Definition Analysis of periodic waves Analysis of aperiodic waves Digitization Time-frequency uncertainty.
CSCE 641 Computer Graphics: Image Sampling and Reconstruction Jinxiang Chai.
CSCE 641 Computer Graphics: Image Sampling and Reconstruction Jinxiang Chai.
Advanced Computer Graphics (Spring 2006) COMS 4162, Lecture 3: Sampling and Reconstruction Ravi Ramamoorthi
SWE 423: Multimedia Systems Chapter 7: Data Compression (3)
CS :: Fall 2003 MPEG-1 Video (Part 1) Ketan Mayer-Patel.
Fourier Analysis Without Tears : Computational Photography Alexei Efros, CMU, Fall 2005 Somewhere in Cinque Terre, May 2005.
Advanced Computer Graphics (Spring 2005) COMS 4162, Lecture 3: Sampling and Reconstruction Ravi Ramamoorthi
The Frequency Domain : Computational Photography Alexei Efros, CMU, Fall 2008 Somewhere in Cinque Terre, May 2005 Many slides borrowed from Steve.
T.Sharon-A.Frank 1 Multimedia Image Compression 2 T.Sharon-A.Frank Coding Techniques – Hybrid.
Fourier Analysis D. Gordon E. Robertson, PhD, FCSB School of Human Kinetics University of Ottawa.
SWE 423: Multimedia Systems Chapter 7: Data Compression (5)
CH#3 Fourier Series and Transform
Chapter 15 Fourier Series and Fourier Transform
Chapter 25 Nonsinusoidal Waveforms. 2 Waveforms Used in electronics except for sinusoidal Any periodic waveform may be expressed as –Sum of a series of.
Advanced Computer Graphics CSE 190 [Spring 2015], Lecture 3 Ravi Ramamoorthi
G52IIP, School of Computer Science, University of Nottingham 1 Image Transforms Fourier Transform Basic idea.
Lecture 1 Signals in the Time and Frequency Domains
Introduction to JPEG Alireza Shafaei ( ) Fall 2005.
CS Spring 2012 CS 414 – Multimedia Systems Design Lecture 8 – JPEG Compression (Part 3) Klara Nahrstedt Spring 2012.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 19.
1 Chapter 5 Image Transforms. 2 Image Processing for Pattern Recognition Feature Extraction Acquisition Preprocessing Classification Post Processing Scaling.
Wireless and Mobile Computing Transmission Fundamentals Lecture 2.
DCT cs195g: Computational Photography James Hays, Brown, Spring 2010 Somewhere in Cinque Terre, May 2005 Slides from Alexei Efros.
Part I: Image Transforms DIGITAL IMAGE PROCESSING.
09/19/2002 (C) University of Wisconsin 2002, CS 559 Last Time Color Quantization Dithering.
Digital Image Processing, 2nd ed. © 2002 R. C. Gonzalez & R. E. Woods Background Any function that periodically repeats itself.
Recap of Monday linear Filtering convolution differential filters filter types boundary conditions.
7- 1 Chapter 7: Fourier Analysis Fourier analysis = Series + Transform ◎ Fourier Series -- A periodic (T) function f(x) can be written as the sum of sines.
Image as a linear combination of basis images
Fourier Transform.
Chapter 8 Lossy Compression Algorithms. Fundamentals of Multimedia, Chapter Introduction Lossless compression algorithms do not deliver compression.
CS 376b Introduction to Computer Vision 03 / 17 / 2008 Instructor: Michael Eckmann.
Image hole-filling. Agenda Project 2: Will be up tomorrow Due in 2 weeks Fourier – finish up Hole-filling (texture synthesis) Image blending.
Learning from the Past, Looking to the Future James R. (Jim) Beaty, PhD - NASA Langley Research Center Vehicle Analysis Branch, Systems Analysis & Concepts.
The Frequency Domain Digital Image Processing – Chapter 8.
Chapter 2. Characteristics of Signal ※ Signal : transmission of information The quality of the information depends on proper selection of a measurement.
CH#3 Fourier Series and Transform 1 st semester King Saud University College of Applied studies and Community Service 1301CT By: Nour Alhariqi.
Fourier Transform (Chapter 4) CS474/674 – Prof. Bebis.
Fourier Analysis Patrice Koehl Department of Biological Sciences National University of Singapore
Signal Fndamentals Analogue, Discrete and Digital Signals
Chapter 8 Lossy Compression Algorithms
Advanced Computer Graphics
JPEG Compression What is JPEG? Motivation
A Simple Image Compression : JPEG
Continuous-Time Signal Analysis
Image Enhancement in the
CSI-447: Multimedia Systems
Dr. Nikos Desypris, Oct Lecture 3
Fourier Transform.
UNIT II Analysis of Continuous Time signal
Frequency Domain Analysis
CSCE 643 Computer Vision: Image Sampling and Filtering
Fourier Integrals For non-periodic applications (or a specialized Fourier series when the period of the function is infinite: L) -L L -L- L
Image Processing, Leture #14
1-D DISCRETE COSINE TRANSFORM DCT
Fourier Analysis Without Tears
8.6 Autocorrelation instrument, mathematical definition, and properties autocorrelation and Fourier transforms cosine and sine waves sum of cosines Johnson.
The Frequency Domain Any wave shape can be approximated by a sum of periodic (such as sine and cosine) functions. a--amplitude of waveform f-- frequency.
Presentation transcript:

Computer Graphics Recitation 7

2 Motivation – Image compression What linear combination of 8x8 basis signals produces an 8x8 block in the image?

3 The plan today Fourier Transform (FT). Discrete Cosine Transform (DCT).

4 What is a transformation? Function : rule that tells how to obtain result y given some input x Transformation : rule that tells how to obtain a function G(f) from another function g(t)

5 What do we need transformations for? Mathematical tool to solve problems Change a quantity to another form that might exhibit useful features Example: XCVI x XII  96 x 12 = 1152  MCLII

6 Periodic function Definition: g(t) is periodic if exists P such that g(t+P) = g(t) Period of a function: smallest constant P that satisfies g(t+P) = g(t)

7 Attributes of periodic function Amplitude: max value it has in any period Period: P Frequency: 1/P, cycles per second,Hz Phase: position of function within a period

8 Time and Frequency example : g(t) = sin(2  ft) + (1/3)sin(2  (3f)t)

9 Time and Frequency example : g(t) = sin(2  ft) + (1/3)sin(2  (3f)t) = +

10 Time and Frequency example : g(t) = sin(2  ft) + (1/3)sin(2  (3f)t) = +

11 Time and Frequency example : g(t) = { 1, -a/2 < t < a/2 0, elsewhere

12 Time and Frequency example : g(t) = { 1, -a/2 < t < a/2 0, elsewhere = + =

13 Time and Frequency example : g(t) = { 1, -a/2 < t < a/2 0, elsewhere = + =

14 Time and Frequency example : g(t) = { 1, -a/2 < t < a/2 0, elsewhere = + =

15 Time and Frequency example : g(t) = { 1, -a/2 < t < a/2 0, elsewhere = + =

16 Time and Frequency example : g(t) = { 1, -a/2 < t < a/2 0, elsewhere = + =

17 Time and Frequency example : g(t) = { 1, -a/2 < t < a/2 0, elsewhere = A (1/k)sin(2  kft)

18 Time and Frequency  If the shape of the function is far from regular wave its Fourier expansion will include infinite num of freq. A (1/k)sin(2  kft) =

19 Frequency domain  Spectrum of freq. domain : range of freq.  Bandwidth of freq. domain : width of the spectrum  DC component (direct current): component of zero freq.  AC – all others

20 Fourier transform G(f) = g(t)[cos(2  ft) - i sin(2  ft)]dt g(t) = G(f)[cos(2  ft) + i sin(2  ft)]df  Every periodic function can be represented as the sum of sine and cosine functions  Transform a function between a time and freq. domain

21 Fourier transform  Discrete g(t) = (1/n) G(f)[cos(2  ft/n) + i sin(2  ft/n)], 0<t<n-1 G(f) = (1/n) g(t)[cos(2  ft/n) - i sin(2  ft/n)], 0<f<n-1

22 FT for digitized image  Each pixel Pxy = point in 3D (z coordinate is value of color/gray level  Each coefficient describes the 2D sinusoidal function needed to reconstruct the surface  In typical image neighboring pixels have “close” values  surface almost flat  most FT coefficients small

23 Sampling theory  Image = continuous signal of intensity function i(t)  Sampling: store a finite sequence in memory i(1)…i(n)  The bigger the sample, the better the quality? – not necessarily

24 Sampling theory  We can sample an image and reconstruct it without loss of quality if we can : - Transform i(t) function from time to freq. Domain - Find the max freq. f m - Sample i(t) at rate > 2f m - Store the sampled values in a bitmap

25  Some loss of image quality because: - f m can be infinite: choose a value s.t freq. > f m do not contribute much (low amplitudes) - Bitmap may be too small  2f m is Nyquist rate Sampling theory

26 Fourier Transform  Periodic function can be represented as sum of sine waves that are integer multiple of fundamental (basis) frequencies  Freq. domain can be applied to a non periodic function if it is nonzero over a finite range

27 Discrete Cosine Transform  A variant of discrete Fourier transform - Real numbers - Fast implementation -Separable (row/column)

28 Discrete Cosine Transform  Example: DCT on 8 points G = (½) C P cos((2t+1)f  /16), C = { f ft f=0 1 f=1…7 f  Fourier transform on 8 points G = P cos(2  ft/8) – i P sin(2  ft/8), f=0,1,…,7 f t t

29 Discrete Cosine Transform  Example 8 points: Same meaning: the 8 numbers G f tell what sinusoidal func. should be combined to approximate the function described by the 8 original numbers P t

30 Discrete Cosine Transform G = (½) C P cos((2t+1)f  /16), C = { f ft f=0 1 f=1…7 f  G3 = contribution of sinusoidal with freq. 3tp/16 to the 8 numbers Pt  G7 = contribution of sinusoidal with freq. 7tp/16 to the 8 numbers Pt  Example 8 points:

31 The inverse DCT P = (½) C G cos((2t+1)j  /16), t=0,1,…,7 j j t Discrete Cosine Transform  Example 8 points:

32 Discrete Cosine Transform  2D DCT G = C C P xy cos((2x+1)i  /2n)cos((2y+1)j  /2n) i j ij  2D Inverse DCT (IDCT) P =¼ C C G ij cos((2x+1)i  /16) cos((2y+1)j  /16) i xy j f=0 1 f=1…7 C f = {

33 Using DCT in JPEG  DCT on 8x8 blocks

34 Using DCT in JPEG  Block size : small block - faster - correlation exists between neighboring pixels large block - better compression in “flat” regions  Power of 2 – for fast implementation

35 Using DCT in JPEG  DCT – basis

36  For almost flat surface most G ij =0  For surface that oscillates much many G ij non zero  G 00 = DC coefficient  Numbers at top left of G ij contribution of low freq. sinusoidal to the surface, bottom right – high freq. Using DCT in JPEG

37  Numbers at top left of G ij contribution of low freq. sinusoidal to the surface, bottom right – high freq.  Scan each block in zig-zag order Using DCT in JPEG

38 DCT enables image compression by concentrating most image information in the low frequencies Loose unimportant image info buy cut G ij at right bottom Decoder computes the inverse IDCT Image compression using DCT

See you next time