Image Data Compression

Similar documents
Multimedia Networking ECE 599

Image Compression. Fundamentals: Coding redundancy. The gray level histogram of an image can reveal a great deal of information about the image

Image Compression - JPEG

encoding without prediction) (Server) Quantization: Initial Data 0, 1, 2, Quantized Data 0, 1, 2, 3, 4, 8, 16, 32, 64, 128, 256

Basic Principles of Video Coding

IMAGE COMPRESSION-II. Week IX. 03/6/2003 Image Compression-II 1

BASICS OF COMPRESSION THEORY

Lecture 2: Introduction to Audio, Video & Image Coding Techniques (I) -- Fundaments

Lecture 2: Introduction to Audio, Video & Image Coding Techniques (I) -- Fundaments. Tutorial 1. Acknowledgement and References for lectures 1 to 5

SYDE 575: Introduction to Image Processing. Image Compression Part 2: Variable-rate compression

Waveform-Based Coding: Outline

Objective: Reduction of data redundancy. Coding redundancy Interpixel redundancy Psychovisual redundancy Fall LIST 2

Digital Image Processing Lectures 25 & 26

Real-Time Audio and Video

IMAGE COMPRESSION IMAGE COMPRESSION-II. Coding Redundancy (contd.) Data Redundancy. Predictive coding. General Model

CSE 408 Multimedia Information System Yezhou Yang

Introduction to Video Compression H.261

2018/5/3. YU Xiangyu

L. Yaroslavsky. Fundamentals of Digital Image Processing. Course

Compression methods: the 1 st generation

Lecture 7 Predictive Coding & Quantization

Wavelet Scalable Video Codec Part 1: image compression by JPEG2000

Overview. Analog capturing device (camera, microphone) PCM encoded or raw signal ( wav, bmp, ) A/D CONVERTER. Compressed bit stream (mp3, jpg, )

Compression. Encryption. Decryption. Decompression. Presentation of Information to client site

Compression and Coding

Transform coding - topics. Principle of block-wise transform coding

Transform Coding. Transform Coding Principle

EE67I Multimedia Communication Systems

Part 2: Video Coding Techniques

Multimedia Information Systems

Fault Tolerance Technique in Huffman Coding applies to Baseline JPEG

State of the art Image Compression Techniques

Multimedia & Computer Visualization. Exercise #5. JPEG compression

A study of image compression techniques, with specific focus on weighted finite automata

Module 2 LOSSLESS IMAGE COMPRESSION SYSTEMS. Version 2 ECE IIT, Kharagpur

3 rd Generation Approach to Video Compression for Multimedia

6.003: Signals and Systems. Sampling and Quantization

UNIT I INFORMATION THEORY. I k log 2

Run-length & Entropy Coding. Redundancy Removal. Sampling. Quantization. Perform inverse operations at the receiver EEE

BASIC COMPRESSION TECHNIQUES

CSE 126 Multimedia Systems Midterm Exam (Form A)

Image and Multidimensional Signal Processing

Source Coding: Part I of Fundamentals of Source and Video Coding

4. Quantization and Data Compression. ECE 302 Spring 2012 Purdue University, School of ECE Prof. Ilya Pollak

Module 4. Multi-Resolution Analysis. Version 2 ECE IIT, Kharagpur

Image Compression. Qiaoyong Zhong. November 19, CAS-MPG Partner Institute for Computational Biology (PICB)

Introduction p. 1 Compression Techniques p. 3 Lossless Compression p. 4 Lossy Compression p. 5 Measures of Performance p. 5 Modeling and Coding p.

CODING SAMPLE DIFFERENCES ATTEMPT 1: NAIVE DIFFERENTIAL CODING

On Compression Encrypted Data part 2. Prof. Ja-Ling Wu The Graduate Institute of Networking and Multimedia National Taiwan University

repetition, part ii Ole-Johan Skrede INF Digital Image Processing

Image Compression Basis Sebastiano Battiato, Ph.D.

SIGNAL COMPRESSION. 8. Lossy image compression: Principle of embedding

on a per-coecient basis in large images is computationally expensive. Further, the algorithm in [CR95] needs to be rerun, every time a new rate of com

INTEGER SUB-OPTIMAL KARHUNEN-LOEVE TRANSFORM FOR MULTI-CHANNEL LOSSLESS EEG COMPRESSION

Compression and Coding. Theory and Applications Part 1: Fundamentals

Module 5 EMBEDDED WAVELET CODING. Version 2 ECE IIT, Kharagpur

Compressing a 1D Discrete Signal

Digital communication system. Shannon s separation principle

A DISTRIBUTED VIDEO CODER BASED ON THE H.264/AVC STANDARD

EECS490: Digital Image Processing. Lecture #26

Compression. Reality Check 11 on page 527 explores implementation of the MDCT into a simple, working algorithm to compress audio.

Basics of DCT, Quantization and Entropy Coding

JPEG and JPEG2000 Image Coding Standards

EE 121: Introduction to Digital Communication Systems. 1. Consider the following discrete-time communication system. There are two equallly likely

at Some sort of quantization is necessary to represent continuous signals in digital form

Audio Coding. Fundamentals Quantization Waveform Coding Subband Coding P NCTU/CSIE DSPLAB C.M..LIU

Lec 04 Variable Length Coding (VLC) in JPEG

Information and Entropy

Compressing a 1D Discrete Signal

6. H.261 Video Coding Standard

Image compression. Institute of Engineering & Technology, Ahmedabad University. October 20, 2015

+ (50% contribution by each member)

Scalable color image coding with Matching Pursuit

The MPEG4/AVC standard: description and basic tasks splitting

ECE472/572 - Lecture 11. Roadmap. Roadmap. Image Compression Fundamentals and Lossless Compression Techniques 11/03/11.

Reduce the amount of data required to represent a given quantity of information Data vs information R = 1 1 C

Predictive Coding. Prediction Prediction in Images

Lecture 10 : Basic Compression Algorithms

Multimedia Communications Fall 07 Midterm Exam (Close Book)

Predictive Coding. Prediction

Product Obsolete/Under Obsolescence. Quantization. Author: Latha Pillai

Estimation-Theoretic Delayed Decoding of Predictively Encoded Video Sequences

CMPT 365 Multimedia Systems. Lossless Compression

Fast Progressive Wavelet Coding

Analysis of Rate-distortion Functions and Congestion Control in Scalable Internet Video Streaming

Module 3 LOSSY IMAGE COMPRESSION SYSTEMS. Version 2 ECE IIT, Kharagpur

CSCI 2570 Introduction to Nanocomputing

Source Coding for Compression

Compression and Coding. Theory and Applications Part 1: Fundamentals

Objectives of Image Coding

Centralized and Distributed Semi-Parametric Compression of Piecewise Smooth Functions

Department of Electrical Engineering, Polytechnic University, Brooklyn Fall 05 EL DIGITAL IMAGE PROCESSING (I) Final Exam 1/5/06, 1PM-4PM

RLE = [ ; ], with compression ratio (CR) = 4/8. RLE actually increases the size of the compressed image.

Multimedia Communications. Differential Coding

Empirical Mean and Variance!

EE5585 Data Compression April 18, Lecture 23

Singular Value Decompsition

Review of Quantization. Quantization. Bring in Probability Distribution. L-level Quantization. Uniform partition

Compression. What. Why. Reduce the amount of information (bits) needed to represent image Video: 720 x 480 res, 30 fps, color

Deterministic sampling masks and compressed sensing: Compensating for partial image loss at the pixel level

Transcription:

Image Data Compression Image data compression is important for - image archiving e.g. satellite data - image transmission e.g. web data - multimedia applications e.g. desk-top editing Image data compression exploits redundancy for more efficient coding: digitized image data redundancy reduction coding transmission, storage, archiving digitized image reconstruction decoding 1 Run Length Coding Images with repeating greyvalues along rows (or columns) can be compressed by storing "runs" of identical greyvalues in the format: greyvalue1 repetition1 greyvalue2 repetition2 For B/W images (e.g. fax data) another run length code is used: row # column # run1 begin column # run1 end column # run2 begin column # run2 end 1 2 3 1 2 3 4 5 6 7 8 9 1 11 12 13 14 15 run length coding: ( 3 5 9 9) (1 1 7 9 9) (3 4 4 6 6 8 8 1 1 12 14) 2 1

Probabilistic Data Compression A discrete image encodes information redundantly if 1. the greyvalues of individual pixels are not equally probable 2. the greyvalues of neighbouring pixels are correlated Information Theory provides limits for minimal encoding of probabilistic information sources. Redundancy of the encoding of individual pixels with G greylevels each: r = b - H G1 1 H = P(g) log g= 2 P(g) b = number of bits used for each pixel = log 2 G H = entropy of pixel source = mean number of bits required to encode information of this source The entropy of a pixel source with equally probable greyvalues is equal to the number of bits required for coding. 3 Huffman Coding The Huffman coding scheme provides a variable-length code with minimal average code-word length, i.e. least possible redundancy, for a discrete message source. (Here messages are greyvalues) 1. Sort messages along increasing probabilities such that g (1) and g (2) are the least probable messages 2. Assign 1 to code word of g (1) and to codeword of g (2) 3. Merge g (1) and g (2) by adding their probabilities 4. Repeat steps 1-4 until a single message is left. Example: message probability code word coding tree g1.3 g2.25 1 1.55 g3.25 1 g4.1 11 g5.1 111 1.2 1.45 1 Entropy: H = 2.185 Average code word length of Huffman code: 2.2 4 2

Statistical Dependence An image may be modelled as a set of statistically dependent random variables with a multivariate distribution p(x 1, x 2,..., x N ) = p(x). Often the exact distribution is unknown and only correlations can be (approximately) determined. Correlation of two variables: E[x i x j ] = c ij Correlation matrix: Covariance of two variables: E[(x i -m i )(x j -m j )] = v ij with m k = mean of x k Covariance matrix: E[x x T ] = c 11 c 12 c 13... c 21 c 22 c 23 c 31 c 32 c 33... E[(x-m) (x-m) T ] = v 11 v 12 v 13... v 21 v 22 v 23 v 31 v 32 v 33... Uncorrelated variables need not be statistically independent: E[x i x j ] = p(x i x j ) = p(x i ) p(x j ) For Gaussian random variables, uncorrelatedness implies statistical independence. 5 Karhunen-Loève Transform (also known as Hotelling Transform or Principal Components Transform ) Determine uncorrelated variables y from correlated variables x by a linear transformation. y = A (x - m) E[y y T ] = A E[(x - m) (x - m) T ] A T = A V A T = D D is a diagonal matrix An orthonormal matrix A which diagonalizes the real symmetric covariance matrix V always exists. A is the matrix of eigenvectors of V, D is the matrix of corresponding eigenvalues. x = A T y + m reconstruction of x from y If x is viewed as a point in n-dimensional Euclidean space, then A defines a rotated coordinate system. 6 3

Illustration of Minimum-loss Dimension Reduction Using the Karhunen-Loève transform data compression is achieved by changing (rotating) the coordinate system omitting the least informative dimension(s) in the new coodinate system Example: y 2 x 2 y 1 x 2 x 1 x 1 y 2 y 1 y 1 7 Compression and Reconstruction with the Karhunen-Loève Transform Assume that the eigenvalues n and the corresponding eigenvectors in A are sorted in decreasing order 1 2... N D = 1... 2 3... Eigenvectors a and eigenvalues are defined by V a = a and can be determined by solving det [V - I ] =. There exist special procedures for determining eigenvalues of real symmetric matrices V. Then x can be transformed into a K-dimensional vector y K, K < N, with a transformation matrix A K containing only the first K eigenvectors of A corresponding to the largest K eigenvalues. y K = A K (x - m) The approximate reconstruction x minimizing the MSE is x = A T K y K + m Hence y K can be used for data compression! 8 4

Example for Karhunen-Loève Compression N = 3 x T = [x 1 x 2 x 3 ] V = 2 -,866 -,5 -,866 2 -,5 2 m = det (V - I) = 1 = 3 2 = 2 3 = 1 A T =,77,77 -,612,5,612 -,354 -,866,354 D = 3 2 1 Compression into K=2 dimensions: y 2 = A 2 x =,77 -,612 -,354 x,5 -,866 Reconstruction from compressed values: x = A T 2 y =,77 y -,612,5 -,354,354 Note the discrepancies between the original and the approximated values: x 1 =,5 x 1 -,43 x 2 -,25 x 3 x 2 = -,85 x 1 -,625 x 2 +,39 x 3 x 3 =,273 x 1 +,39 x 2 +,25 x 3 9 Predictive Compression Principle: estimate g mn from greyvalues in the neighbourhood of (mn) encode difference d mn = g mn - g mn transmit difference data + predictor For a 1D signal this is known as Differential Pulse Code Modulation (DPCM): f(t) + f (t) - quantizer predictor d(t) + + coder decoder d(t) + f (t) predictor f(t) compression reconstruction Linear predictor for a neighbourhood of K pixels: g mn = a 1 g 1 + a 2 g 2 +... + a K g K Computation of a 1... a K by minimizing the expected reconstruction error 1 5

Example of Linear Predictor For images, a linear predictor based on 3 pixels (3rd order) is often sufficient: g mn = a 1 g m,n-1 + a 2 g m-1,n-1 + a 3 g m-1,n If g mn is a zero mean stationary random process with autocorrelation C, then minimizing the expected error gives a 1 c + a 2 c 1 + a 3 c 11 = c 1 a 1 c 1 + a 2 c + a 3 c 1 = c 11 a 1 c 11 + a 2 c 1 + a 3 c = c 1 This can be solved for a 1, a 2, a 3 using Cramer s Rule. n 1 11 1 m Example: Predictive compression with 2nd order predictor and Huffman coding, ratio 6.2 Left: Reconstructed image Right: Difference image (right) with maximal difference of 14 greylevels 11 Discrete Cosine Transform (DCT) Discrete Cosine Transform is commonly used for image compression, e.g. in JPEG (Joint Photographic Expert Group) Baseline System standard. Definition of DCT: G = 1 N G uv = 1 2N 3 Inverse DCT: g mn = 1 N G + 1 2N 3 N 1 m= N 1 m= N 1 u= N 1 g n= mn N 1 g n= mn N1 G v = uv cos[(2m +1)u] cos[(2n + 1) v] cos[(2m + 1)u] cos[(2n+ 1)v] In effect, the DCT computes a Fourier Transform of a function made symmetric at N by a mirror copy. => 1. Result does not contain sinus terms 2. No wrap-around errors Example: DCT compression with ratio 1 : 5.6 Left: Reconstructed image Right: Difference image (right) with maximal difference of 125 greylevels 12 6

Principle of Baseline JPEG (Source: Gibson et al., Digital Compression for Multimedia, Morgan Kaufmann 98) 8 x 8 blocks Encoder FDCT Quantizer Entropy Encoder source image data table specifications table specifications compressed image data transform RGB into YUV coding, subsample color information partition image into 8 x 8 blocks, left-to-right, top-to-bottom compute Discrete Cosine Transform (DCT) of each block quantize coefficients according to psychovisual quantization tables order DCT coefficients in zigzag order perform runlength coding of bitstream of all coefficients of a block perform Huffman coding for symbols formed by bit patterns of a block 13 YUV Color Model for JPEG Human eyes are more sensitive to luminance (brightness) than to chrominance (color). YUV color coding allows to code chrominance with fewer bits than luminance. CCIR-61 scheme: Y =.299 R +.587 G +.144 B "luminance" Cb =.1687 R -.3313 G +.5 B "blueness" U Cr =.5 R -.4187 G -.813 B "redness" V In JPEG: 1 Cb, 1 Cr and 4 Y values for each 2 x 2 image subfield (6 instead of 12 values) 14 7

Illustrations for Baseline JPEG partitioning the image into blocks blocks 1 2 DCT coefficients 1 62 63 7 6 1 a a 1 a 2 a 3 a 63 DCT coefficient ordering for efficient runlength coding transmission sequence for blocks of image MSB LSB 15 JPEG-compressed Image original 5.8 MB JPEG-compressed 45 KB difference image standard deviation of luminance differences: 1,44 16 8

Problems with Block Structure of JPEG JPEC encoding with compression ratio 1:7 block boundaries are visible 17 Progressive Encoding Progressive encoding allows to first transmit a coarse version of the image which is then progressively refined (convenient for browsing applications). Spectral selection 1. transmission: DCT coefficients a... a k1 2. transmission: DCT coefficients a k1... a k2 Successive approximation 1. transmission: bits 7... n 1 2. transmission: bits n 1 +1... n 2 low frequency coefficients first most significant bits first 18 9

MPEG Compression Original goal: Compress a 12 Mbps video stream to be handled by a CD with 1 Mbps. Basic procedure: temporal prediction to exploit redundancy between image frames frequency domain decomposition using the DCT selective reduction of precision by quantization variable length coding to exploit statistical redundancy additional special techniques to maximize efficiency Motion compensation: 16 x 16 blocks luminance with 8 x 8 blocks chromaticity of the current image frame are transmitted in terms of - an offset to the best-fitting block in a reference frame (motion vector) - the compressed differences between the current and the reference block 19 MPEG-7 Standard MPEG-7: Multimedia Content Description Interface introduced as standard in 22 supports multimedia content description (audio and visual) not aimed at a particular application Descrtiption of visual contents in terms of: descriptors (e.g. color, texture, shape, motion, localization, face features) segments structural information Description Definition Language (DDL) segmentation methodology required! 2 1

Quadtree Image Representation Properties of quadtree: every node represents a squared image area, e.g. by its mean greyvalue every node has 4 children except leaf nodes children of a node represent the 4 subsquares of the parent node nodes can be refined if necessary 1 11 11 12 13 12 13 quadtree structure: root 1 2 3 2 3 1 11 12 13 1 11 12 13 21 Quadtree Image Compression A complete quadtree represents an image of N = 2 K x 2 K pixels with 1 + 4 + 16 +... + 2 2K nodes 1.33 N nodes. An image may be compressed by - storing at every child node the greyvalue difference between child and parent node - omitting subtrees with equal greyvalues Quadtree image compression supports progressive image transmission: images are transmitted by increasing quadtree levels, i.e. images are progressively refined intermediate image representations provide useful information, e.g. for image retrieval 22 11