7 Images Outline A typical color image might be 600 by 800 pixels. Each pixel has a red (R), green (G) and blue (B) value associated to it. Each pixel needs 3 bytes of storage (one for each color). That s = 1.44 megabytes. But a typical 600 by 800 JPEG image takes only about 120 kilobytes, less than 1/10 the expected amount!

8 Images Outline A typical color image might be 600 by 800 pixels. Each pixel has a red (R), green (G) and blue (B) value associated to it. Each pixel needs 3 bytes of storage (one for each color). That s = 1.44 megabytes. But a typical 600 by 800 JPEG image takes only about 120 kilobytes, less than 1/10 the expected amount! How can we eliminate 90 percent of the required storage?

9 Compression Outline An interesting image:

10 Bad Compression Image compressed 10-fold:

11 The Basis for Compression JPEG compression (and a good chunk of applied mathematics) is based on one of the great ideas of 19th century mathematics: Functions can be decomposed into sums of sines and cosines of various frequencies.

12 Fourier Cosine Series Outline Fourier series come in many flavors. We ll be interested in Fourier Cosine Series: Any reasonable function f (t) defined on [0, π] can be well-approximated as a sum of cosines, f (t) a 0 + a 1 cos(t) + a 2 cos(2t) + + a N cos(nt) if we pick the a k correctly (and take N large enough).

21 The Cosine Coefficients A piecewise continuously-differentiable function f (t) defined on [0, π] can be approximated with a Fourier sum where f (t) a a 1 cos(t) + a 2 cos(2t) + + a N cos(nt) a k = 2 π π 0 f (t) cos(kt) dt As N the sum converges to f (t) for any t at which f is continuous.

22 Periodicity Outline Outside the interval [0, π] the cosine series extends f as an even period 2π function to the real line:

23 Discontinuities Outline Discontinuities are difficult to represent, for they take a lot of cosine terms to synthesize accurately. Here N = 50:

24 Compressing a Function So a function f (t) on [0, π] is determined by its Fourier cosine coefficients a 0, a 1, a 2..., an infinite amount of information. We could compress this information by

25 Compressing a Function So a function f (t) on [0, π] is determined by its Fourier cosine coefficients a 0, a 1, a 2..., an infinite amount of information. We could compress this information by Throwing out all small a k, e.g., a k < δ for some δ, and

26 Compressing a Function So a function f (t) on [0, π] is determined by its Fourier cosine coefficients a 0, a 1, a 2..., an infinite amount of information. We could compress this information by Throwing out all small a k, e.g., a k < δ for some δ, and Quantizing the remaining a k by, for example, rounding them to the nearest integer, or more generally,

27 Compressing a Function So a function f (t) on [0, π] is determined by its Fourier cosine coefficients a 0, a 1, a 2..., an infinite amount of information. We could compress this information by Throwing out all small a k, e.g., a k < δ for some δ, and Quantizing the remaining a k by, for example, rounding them to the nearest integer, or more generally, Rounding them to the nearest multiple of r for some fixed r.

44 Discrete Compression To compress a discretized signal (vector) f R N : 1 Perform a DCT c = C N f. 2 Zero out all c k below a certain threshold, quantize the rest (round to nearest integer, near tenth, etc.) This is where we get compression. 3 The signal can be (approximately) reconstituted using the thresholded quantized c k and an inverse DCT.

46 Audio Compression Example The file gong1.wav consists of 50,000 sampled audio values, so f R With Matlab, we can perform a DCT, round each coefficient to the nearest integer (or multiple of r). This is where compression happens (most c k will be zero).

47 Audio Compression Example The file gong1.wav consists of 50,000 sampled audio values, so f R With Matlab, we can perform a DCT, round each coefficient to the nearest integer (or multiple of r). This is where compression happens (most c k will be zero). We can approximately reconstitute the original audio signal with an inverse DCT.

48 Blocking Outline 1 Discontinuities cause many DCT coefficients to be large they don t decay to zero very fast and so the file is hard to compress.

49 Blocking Outline 1 Discontinuities cause many DCT coefficients to be large they don t decay to zero very fast and so the file is hard to compress. 2 It can help to break the signal into blocks and compress each individually, to limit the effect of any discontinuity to one block.

50 Compression Example 2 A signal with discontinuities, and its compressed version (eight-bit) 62 percent of the DCT coefficients remain non-zero.

59 Sampling in 2D Outline in 2D Sampling and the DCT in 2D 2D Compression A grayscale image on a square 0 x, y π can be considered as a function f (x, y). The sampled version is the M N matrix q with entries q jk = f (x k, y j ), sampled on a rectangular grid. Each sample value q jk is the gray value of the corresponding pixel.

66 2D Compression Example in 2D Sampling and the DCT in 2D 2D Compression A grayscale image to compress:

67 2D Compression Example in 2D Sampling and the DCT in 2D 2D Compression The DCT, displayed as a grayscale image (log rescaling):

68 2D Compression Example in 2D Sampling and the DCT in 2D 2D Compression The strategy: 1 Perform a DCT on the image, to produce M N array q of DCT coefficients.

69 2D Compression Example in 2D Sampling and the DCT in 2D 2D Compression The strategy: 1 Perform a DCT on the image, to produce M N array q of DCT coefficients. 2 Quantize the array by rounding each q jk, zeroing out small q jk (this is where compression occurs).

70 2D Compression Example in 2D Sampling and the DCT in 2D 2D Compression The strategy: 1 Perform a DCT on the image, to produce M N array q of DCT coefficients. 2 Quantize the array by rounding each q jk, zeroing out small q jk (this is where compression occurs). 3 The image can be reconstructed by using the quantized array and an inverse DCT (2D).

72 Block Compression Outline in 2D Sampling and the DCT in 2D 2D Compression As in 1D, discontinuities (edges) cause trouble. It can help to divide the image into blocks and compress each individually.

73 Block Compression Outline in 2D Sampling and the DCT in 2D 2D Compression As in 1D, discontinuities (edges) cause trouble. It can help to divide the image into blocks and compress each individually. The JPEG standard uses 8 8 pixel blocks.

75 Final Remarks Outline in 2D Sampling and the DCT in 2D 2D Compression The ideas of Fourier analysis appears in many other areas of image processing, e.g., noise removal, edge detection.

76 Final Remarks Outline in 2D Sampling and the DCT in 2D 2D Compression The ideas of Fourier analysis appears in many other areas of image processing, e.g., noise removal, edge detection. The new JPEG 2000 standard replaces the cosine basis functions with wavelet basis functions.

Correlation and Convolution Class otes for CMSC 46, Fall 5 David Jacobs Introduction Correlation and Convolution are basic operations that we will perform to extract information from images. They are in

Sine and Cosine Series; Odd and Even Functions A sine series on the interval [, ] is a trigonometric series of the form k = 1 b k sin πkx. All of the terms in a series of this type have values vanishing

International Journal of Current Engineering and Technology E-ISSN 2277 4106, P-ISSN 2347 5161 2015 INPRESSCO, All Rights Reserved Available at http://inpressco.com/category/ijcet Research Article Rahul

Wavelet analysis In the case of Fourier series, the orthonormal basis is generated by integral dilation of a single function e jx Every 2π-periodic square-integrable function is generated by a superposition

3 Data Storage 3.1 Foundations of Computer Science Cengage Learning Objectives After studying this chapter, the student should be able to: List five different data types used in a computer. Describe how

Part 3: Time Series I Purpose of Time Series Analysis (Figure from Panofsky and Brier 1968) Autocorrelation Function Harmonic Analysis Spectrum Analysis Data Window Significance Tests Some major purposes

. INNER PRODUCT SPACES.. Definition So far we have studied abstract vector spaces. These are a generalisation of the geometric spaces R and R. But these have more structure than just that of a vector space.

Chapter 3 Data Storage Objectives After studying this chapter, students should be able to: List five different data types used in a computer. Describe how integers are stored in a computer. Describe how

Linear Algebra Notes for Marsden and Tromba Vector Calculus n-dimensional Euclidean Space and Matrices Definition of n space As was learned in Math b, a point in Euclidean three space can be thought of

A Robust and Lossless Information Embedding in Image Based on DCT and Scrambling Algorithms Dr. Mohammad V. Malakooti Faculty and Head of Department of Computer Engineering, Islamic Azad University, UAE

1 Matlab 1) Fundamentals a) Getting Help for more detailed help on any topic, typing help, then a space, and then the matlab command brings up a detailed page on the command or topic. For really difficult

Introduction to Complex Fourier Series Nathan Pflueger 1 December 2014 Fourier series come in two flavors. What we have studied so far are called real Fourier series: these decompose a given periodic function

LS.6 Solution Matrices In the literature, solutions to linear systems often are expressed using square matrices rather than vectors. You need to get used to the terminology. As before, we state the definitions

Applications to Data Smoothing and Image Processing I MA 348 Kurt Bryan Signals and Images Let t denote time and consider a signal a(t) on some time interval, say t. We ll assume that the signal a(t) is

Numerical Complex Analysis Image Compression Using Fourier Techniques SID 430493250 Introduction The importance of image compression has arisen as a natural consequence of the advancement in modern photography.

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

page 1 Chapter 1 The Image Deblurring Problem You cannot depend on your eyes when your imagination is out of focus. Mark Twain When we use a camera, we want the recorded image to be a faithful representation

4. MATRICES 170 4. Matrices 4.1. Definitions. Definition 4.1.1. A matrix is a rectangular array of numbers. A matrix with m rows and n columns is said to have dimension m n and may be represented as follows:

Video Compression Djordje Mitrovic University of Edinburgh This document deals with the issues of video compression. The algorithm, which is used by the MPEG standards, will be elucidated upon in order

INPUT OUTPUT 08 / IMAGE QUALITY & VIEWING In this section we will cover common image file formats you are likely to come across and examine image quality in terms of resolution and bit depth. We will cover

18 Chapter. Orthogonality.3 Least Squares Approximations It often happens that Ax D b has no solution. The usual reason is: too many equations. The matrix has more rows than columns. There are more equations

Surface Area of Prisms Find the Surface Area for each prism. Show all of your work. Surface Area: The sum of the areas of all the surface (faces) if the threedimensional figure. Rectangular Prism: A prism

Infinite Algebra 1 Kuta Software LLC Common Core Alignment Software version 2.05 Last revised July 2015 Infinite Algebra 1 supports the teaching of the Common Core State Standards listed below. High School

Solving Systems of Linear Equations There are two basic methods we will use to solve systems of linear equations: Substitution Elimination We will describe each for a system of two equations in two unknowns,

Journal of Online Mathematics and Its Applications Volume 6. June 2006. Article ID 1156 The Geometry of the Dot and Cross Products Tevian Dray Corinne A. Manogue 1 Introduction Most students first learn

The Convolution Operation Convolution is a very natural mathematical operation which occurs in both discrete and continuous modes of various kinds. We often encounter it in the course of doing other operations

CHAPTER 1 Brief Introduction to Vectors and Matrices In this chapter, we will discuss some needed concepts found in introductory course in linear algebra. We will introduce matrix, vector, vector-valued

Point Lattices in Computer Graphics and Visualization how signal processing may help computer graphics Dimitri Van De Ville Ecole Polytechnique Fédérale de Lausanne Biomedical Imaging Group dimitri.vandeville@epfl.ch

Auto-Tuning Using Fourier Coefficients Math 56 Tom Whalen May 20, 2013 The Fourier transform is an integral part of signal processing of any kind. To be able to analyze an input signal as a superposition

Math 571 Inner Product Spaces 1. Preliminaries An inner product space is a vector space V along with a function, called an inner product which associates each pair of vectors u, v with a scalar u, v, and

Application Note 4 Introduction Fast Fourier Transforms and Power Spectra in LabVIEW K. Fahy, E. Pérez Ph.D. The Fourier transform is one of the most powerful signal analysis tools, applicable to a wide