Digital Image Processing

Similar documents
CSEP 521 Applied Algorithms Spring Lossy Image Compression

CS 335 Graphics and Multimedia. Image Compression

Compression II: Images (JPEG)

Modified SPIHT Image Coder For Wireless Communication

CMPT 365 Multimedia Systems. Media Compression - Image

JPEG Joint Photographic Experts Group ISO/IEC JTC1/SC29/WG1 Still image compression standard Features

SIGNAL COMPRESSION. 9. Lossy image compression: SPIHT and S+P

IMAGE COMPRESSION. October 7, ICSY Lab, University of Kaiserslautern, Germany

Review and Implementation of DWT based Scalable Video Coding with Scalable Motion Coding.

Fundamentals of Video Compression. Video Compression

Introduction ti to JPEG

Compression of RADARSAT Data with Block Adaptive Wavelets Abstract: 1. Introduction

Multimedia Systems Image III (Image Compression, JPEG) Mahdi Amiri April 2011 Sharif University of Technology

IMAGE COMPRESSION. Chapter - 5 : (Basic)

The Standardization process

Multimedia Communications. Transform Coding

The Existing DCT-Based JPEG Standard. Bernie Brower

CHAPTER 6. 6 Huffman Coding Based Image Compression Using Complex Wavelet Transform. 6.3 Wavelet Transform based compression technique 106

Features. Sequential encoding. Progressive encoding. Hierarchical encoding. Lossless encoding using a different strategy

Wireless Communication

Fingerprint Image Compression

ISSN (ONLINE): , VOLUME-3, ISSUE-1,

DigiPoints Volume 1. Student Workbook. Module 8 Digital Compression

Topic 5 Image Compression

JPEG 2000 compression

Compression Part 2 Lossy Image Compression (JPEG) Norm Zeck

DIGITAL TELEVISION 1. DIGITAL VIDEO FUNDAMENTALS

7.5 Dictionary-based Coding

AN ANALYTICAL STUDY OF LOSSY COMPRESSION TECHINIQUES ON CONTINUOUS TONE GRAPHICAL IMAGES

Lecture 5: Compression I. This Week s Schedule

Video Compression An Introduction

Image, video and audio coding concepts. Roadmap. Rationale. Stefan Alfredsson. (based on material by Johan Garcia)

IMAGE COMPRESSION. Image Compression. Why? Reducing transportation times Reducing file size. A two way event - compression and decompression

An introduction to JPEG compression using MATLAB

Optimized Progressive Coding of Stereo Images Using Discrete Wavelet Transform

06/12/2017. Image compression. Image compression. Image compression. Image compression. Coding redundancy: image 1 has four gray levels

Final Review. Image Processing CSE 166 Lecture 18

( ) ; For N=1: g 1. g n

Digital Image Processing

JPEG: An Image Compression System. Nimrod Peleg update: Nov. 2003

Digital Image Processing

JPEG Compression. What is JPEG?

A Image Comparative Study using DCT, Fast Fourier, Wavelet Transforms and Huffman Algorithm

FAST AND EFFICIENT SPATIAL SCALABLE IMAGE COMPRESSION USING WAVELET LOWER TREES

Digital Image Representation Image Compression

Image coding and compression

Image Coding and Data Compression

Wavelet Transform (WT) & JPEG-2000

JPEG: An Image Compression System

Professor Laurence S. Dooley. School of Computing and Communications Milton Keynes, UK

Wavelet Based Image Compression Using ROI SPIHT Coding

Lecture 8 JPEG Compression (Part 3)

JPEG Baseline JPEG Pros and Cons (as compared to JPEG2000) Advantages. Disadvantages

FPGA IMPLEMENTATION OF BIT PLANE ENTROPY ENCODER FOR 3 D DWT BASED VIDEO COMPRESSION

MRT based Fixed Block size Transform Coding

RD OPTIMIZED PROGRESSIVE IMAGE CODING USING JPEG. Jaehan In. B. Sc. (Electrical Engineering) The Johns Hopkins University, U.S.A.

Robert Matthew Buckley. Nova Southeastern University. Dr. Laszlo. MCIS625 On Line. Module 2 Graphics File Format Essay

Biomedical signal and image processing (Course ) Lect. 5. Principles of signal and image coding. Classification of coding methods.

Scalable Compression and Transmission of Large, Three- Dimensional Materials Microstructures

Video coding. Concepts and notations.

Module 6 STILL IMAGE COMPRESSION STANDARDS

Index. 1. Motivation 2. Background 3. JPEG Compression The Discrete Cosine Transformation Quantization Coding 4. MPEG 5.

Image compression. Stefano Ferrari. Università degli Studi di Milano Methods for Image Processing. academic year

CHAPTER 4 REVERSIBLE IMAGE WATERMARKING USING BIT PLANE CODING AND LIFTING WAVELET TRANSFORM

2014 Summer School on MPEG/VCEG Video. Video Coding Concept

Comparison of different Fingerprint Compression Techniques

Image Compression for Mobile Devices using Prediction and Direct Coding Approach

PERFORMANCE IMPROVEMENT OF SPIHT ALGORITHM USING HYBRID IMAGE COMPRESSION TECHNIQUE

New Perspectives on Image Compression

Tutorial on Image Compression

Color Imaging Seminar. Yair Moshe

Image Compression Algorithm and JPEG Standard

THE TRANSFORM AND DATA COMPRESSION HANDBOOK

IMAGE COMPRESSION USING HYBRID QUANTIZATION METHOD IN JPEG

Standard Codecs. Image compression to advanced video coding. Mohammed Ghanbari. 3rd Edition. The Institution of Engineering and Technology

Image and Video Compression Fundamentals

VC 12/13 T16 Video Compression

VIDEO SIGNALS. Lossless coding

CONTENT BASED IMAGE COMPRESSION TECHNIQUES: A SURVEY

PERFORMANCE ANAYSIS OF EMBEDDED ZERO TREE AND SET PARTITIONING IN HIERARCHICAL TREE

Progressive Geometry Compression. Andrei Khodakovsky Peter Schröder Wim Sweldens

Video Compression MPEG-4. Market s requirements for Video compression standard

Reversible Wavelets for Embedded Image Compression. Sri Rama Prasanna Pavani Electrical and Computer Engineering, CU Boulder

IMAGE COMPRESSION SYSTEMS A JPEG PERSPECTIVE

JPEG 2000 Implementation Guide

Low-complexity video compression based on 3-D DWT and fast entropy coding

Embedded Rate Scalable Wavelet-Based Image Coding Algorithm with RPSWS

Image Coding and Compression

CoE4TN4 Image Processing. Chapter 8 Image Compression

DCT Coefficients Compression Using Embedded Zerotree Algorithm

A Comparative Study of DCT, DWT & Hybrid (DCT-DWT) Transform

Error Protection of Wavelet Coded Images Using Residual Source Redundancy

Mesh Based Interpolative Coding (MBIC)

Image Compression Standard: Jpeg/Jpeg 2000

A Study of Image Compression Based Transmission Algorithm Using SPIHT for Low Bit Rate Application

13.6 FLEXIBILITY AND ADAPTABILITY OF NOAA S LOW RATE INFORMATION TRANSMISSION SYSTEM

ECE 417 Guest Lecture Video Compression in MPEG-1/2/4. Min-Hsuan Tsai Apr 02, 2013

Part 1 of 4. MARCH

Lecture 8 JPEG Compression (Part 3)

Introduction to Video Compression

Transcription:

Digital Image Processing 5 January 7 Dr. ir. Aleksandra Pizurica Prof. Dr. Ir. Wilfried Philips Aleksandra.Pizurica @telin.ugent.be Tel: 9/64.3415 UNIVERSITEIT GENT Telecommunicatie en Informatieverwerking Lossy Image Compression

version: 5/1/7 A. W. Pizurica, Philips, Universiteit Gent, 67 19986 A general image compression scheme reducing spatial correlation Orthogonal transformation Predicting pixel values from the previous values (integer) prediction errors or (real) transform coefficients removing visuallyirrelevant data Quantisation of the coefficients/prediction errors Not coding some coefficients/prediction errors integer numbers removing statistical redundancy Huffman coding Arithmetic coding bit stream 8b.3 version: 5/1/7 The RateDistortion (RD) curve A. W. Pizurica, Philips, Universiteit Gent, 67 19986 In lossy compression there is a tradeoff between quality and the compression factor A common numerical distortion criterion is squared error 1 1 1 N M MN ( ~ f ( x, y) f ( x, y) ) y= x= or the PSNR, an average score given by a test panel, distorsion ratedistortion curve ratedistortion limit beter for a good technique it has to be monotonically decreasing! number of bits ( bit rate ) The Ratedistortion curve gives the corresponding values of the distrorsion and the number of bits, for different specifications of the coding parameters Usually it is computed for a representative set of images The Ratedistortion limit gives the smallest possible distorsion that can be achieved by any coding scheme for a given number of bits 8b.4

version: 5/1/7 Examples... A. W. Pizurica, Philips, Universiteit Gent, 67 19986 5 4 3 1 1 1 1 N M MN y= x= RMS error ( ~ f ( x, y) f ( x, y) ) Quasilossless region Lossy JPEG Lossy Btpc #bits (kbyte) 5 1 15 Current compression standard Predictive method (prev. lesson!) The current compression standard is no longer optimal in the quasilossless region 8b.5 version: 5/1/7 A. W. Pizurica, Philips, Universiteit Gent, 67 19986 Examples: compression versus distorsion 5 RMS error 4 3 1 "lossless" Hadamard Lossy JPEG Btpc Lossless DCT 4 6 8 1 1 14 8MN Compression factor = #bits 8b.6

version: 5/1/7 Subjectieve quality measures A. W. Pizurica, Philips, Universiteit Gent, 67 19986 These measures take into account the characteristics of the human eye Example: frequency weighted mean square error M 1 N 1 ~ ~ F k, l Fk, l Wk, l ( F k, l, F k, l are DDFTs) k= l= The weighting function W k,l takes into account spatial and frequency sensitivity of the eye W k,l depends on the viewing distance! only for a fixed viewing distance! Interesting for optimizing coding schemes based on transform coding 8b.7 version: 5/1/7 Lossy prediction techniques A. W. Pizurica, Philips, Universiteit Gent, 67 19986 +k x p prediction current pixel coded pixels + quantization k = [ x/ ] k Huffman coder prediction + + k scaling k Huffman decoder new pixel The coder makes prediction based on the coded pixels instead of on the basis of original pixels less accurate prediction in the coder no error propagation netto beter prediction 8b.8

version: 5/1/7 Quantization: example A. W. Pizurica, Philips, Universiteit Gent, 67 19986 Quantisation ( =) 1 1 1 1 1 3 4 5 3 6 3 Dequantization (scaling with = ) 1 1 1 4 4 3 6 3 6 8b.9 version: 5/1/7 Transform coding A. W. Pizurica, Philips, Universiteit Gent, 67 19986 Goal: linearly transform image data into (quantized) coefficients with lower entropy a k f ( x, y) transform a = M quantisation x =... n 1 a n 1 y =... n 1 k j = [ a j / j ] statistical coding ~ f ( x, y) x =... n 1 y =... n 1 inverse transform a~ ~ a = M ~ a n 1 ~ a a scaling a~ = j k j j k statistical decoding Advantage of the orthogonality of the basis functions: energy preserved, squared error easy to estimate: d = n 1n 1 n 1 ( ~ f ( x, y) f ( x, y) ) = ( a~ i ai ) x= y= i= n / 4 als j = a~ j a j j / 8b.1

version: 5/1/7 The best orthogonal transform A. W. Pizurica, Philips, Universiteit Gent, 67 19986 The best transform is the one that yields the best ratedistortion (RD) curve: For a given compression factor distortion is as small as possible For a given distortion the compression factor is as high as possible The best transform in RD sense is the KarhunenLoève transform This transform is image dependent and notseparable! Based on experiments the DiscreteCosineTransform (DCT) is almost optimal This transform is image independent and separable (so faster to compute)! 8b.11 DCT based image compression

version: 5/1/7 A. W. Pizurica, Philips, Universiteit Gent, 67 19986 The discrete cosine transform (DCT) = image block a +a 1 +a +a 3 + +a 1 +a 11 +a 1 +a 13 + +a +a 1 +a +a 3 + +a 3 +a 31 +a 3 +a 33 + q ( y) q ( x) i coefficients block j + Basis functions: q i (y)q j (x); ci i( x + 1/ )π qi ( x) = cos with c n n i = 1 for i= for i 8b.13 version: 5/1/7 Blokcodering met de DCT A. W. Pizurica, Philips, Universiteit Gent, 67 19986 big DCT a i, j small There are a lot of small coefficients; big ones are rare The histogram of the quantized coefficients is strongly nonuniform ideal for statistical coding Experiments show that block sizes n=8 to n=3 yield the best ratedistortion curve The DCT is separable and requires hence 4n computations per pixel n=8 is thus 4 times faster than n=3 usually n=8 is chosen 8b.14

version: 5/1/7 The JPEGstandard A. W. Pizurica, Philips, Universiteit Gent, 67 19986 JPEG = Joint Photographic Experts Group forward DCT quantisation entropycoding image data Division into blocks of 8x8 pixels Quantisation with frequency dependent accuracy : k i, j = [ ai, j / i, j ] Huffman coding or arithmetic coding The quantized DCcoefficients a, (one per block) are gathered in a smaller image which is coded by lossless JPEG Runlength coding is applied to highfrequency coefficients within a block table table Compressed file Quantization table Huffman table Compressed data 8b.15 version: 5/1/7 A. W. Pizurica, Philips, Universiteit Gent, 67 19986 Psychovisually adapted quantization 14 1 1 8 6 4 The quantization step is frequencydependent High frequency coefficients are quantized more coarsely because eye is less sensitive to high spatial frequencies The optimal quantization table is derived based on experiments with test persons i, j 1 3 4 5 6 7 Vertical frequency i 4 6 Horizontal frequency j The percieved spatial frequency depends on the viewing distance this implies implicitely a fixed viewing distance frequency dependent quantization is not a good option when increasing image is desired (e.g., in medical applications) 8b.16

version: 5/1/7 Coding of DCcoefficients A. W. Pizurica, Philips, Universiteit Gent, 67 19986 56x56 image, divided in 8x8 blocks DCcoefficients of each block, grouped in 3x3 image (here shown 8x enlarged) Neighboring DCcoefficients are still pretty much similar From these coefficients a DC image is formed and compressed with LJPEG 8b.17 version: 5/1/7 A. W. Pizurica, Philips, Universiteit Gent, 67 19986 Zigzag scan and runlength coding 8 5 3 35 9 13 11 13 31 41 7 7 8 3 8 36 9 6 1 3 18 3 4 1 1 15 1 1 3 4 7 3 1 1 1 4 1 Zerorun 11 8 7 4 (11,) (8,3) (7,1) (4,) (,) meta symbol, coded by e.g. an (adapted) Huffman coder 9 1 1 Endofblock The quantized HF coefficients disappear quickly with increasing frequency Because of typical concentration of image energy at low frequencies Because of stronger quantization of the coefficients at high frequencies To make use of this zeroruns and endofblock markers are introduced 8b.18

version: 5/1/7 A. W. Pizurica, Philips, Universiteit Gent, 67 19986 Errors in highly compressed images Original DCT, 3x3 (compression factor 4) c b a At the borders of the blocks the error changes discontinuously Block distortion (a) The coefficients at highest frequencies are by quantization set to zero, as if an ideal lowpass filter was applied lowpass filtering effect: the image becomes blurred (b) Gibbseffect: wrinkles appear in the image (c) 8b.19 version: 5/1/7 A. W. Pizurica, Philips, Universiteit Gent, 67 19986 JPEG: Problems at high compression Block distortion: the borders of the blocks become visible Compression factor 7 (.3 bpp) 8b.

Subband coding and wavelet based image compression version: 5/1/7 A. W. Pizurica, Philips, Universiteit Gent, 67 19986 Subband coding wavelet coding Principle: transform image using (bi) orthogonal discrete wavelet transform (DWT) quantize the wavelet coefficients Make use of the dependencies between the wavelet coefficients using zero tree coding or significance coding Use a Huffman coder or an arithmetic coder to reduce the remaining statistical redundancy The JPEG standard Extension of the old JPEG standard Wavelet representation + significance coding Most important advantages Beter quality for very low and very high compression Very flexible: scalability in resolution, quality, spatial location and color component 8b.

version: 5/1/7 Scalability in quality A. W. Pizurica, Philips, Universiteit Gent, 67 19986 Time:..9.17.7.51 1.5.1 3.9 s 56x56x8 Total transmission time over 33.6 modem without compression: s with compression: 13 s Progressive decompression: very good image after s Useful for navigation in big image sets Remark: compression technique in this demo does not use wavelets! 56x56x8 51x51x1 ISDN (18 kbit/s): 4 s 4 s 33.6 modem: s. min. 8b.3 version: 5/1/7 Scalability A. W. Pizurica, Philips, Universiteit Gent, 67 19986 Scalability means that by truncating the compressed file we get an image version the quality of which improves when we truncate less Important here is the order in which data packets are stored in the compressed file Scalability in accuracy: the most significant bits of all wavelet coefficiets in all subbands are stored first, then less significant bits follow Scalability in resolution: low and medium frequency wavelet bands are first saved with maximum quality before taking high frequency coefficients in the reconstruction Scalability in spatial location: all coefficients of a region of interest (e.g. the central part of the image) are saved first Scalability in color: the coefficients of the luminance component are saved first and the chrominance components follow after 8b.4

version: 5/1/7 Scalability: remarks A. W. Pizurica, Philips, Universiteit Gent, 67 19986 It is possible to switch from one type of scalability to another during compression: e.g. first resolution then quality The JPEG data stream consists of packets; in the header of these packets it is noted which information they contain By reordering the packets it is possible to get a different type of scalability without decoding and coding again Applications of scalability: Progressive transmission over channels with low bandwidth: while the bits are ariving the decoder calculates better and better versions of the compressed image When printing on a greyscale printer the chrominance packets can be omitted Generating thumbnails on a web page by truncating high quality images 8b.5 version: 5/1/7 Zerotree coding... A. W. Pizurica, Philips, Universiteit Gent, 67 19986 The coefficients in a tree correspond with the same position in the image And are result of the same type of filtering applied to a lowpass (and subsampled) version of the image 8b.6

version: 5/1/7... Zerotree coding A. W. Pizurica, Philips, Universiteit Gent, 67 19986 N The children of a coefficient with value zero are often also zero zero trees are replaced by a single symbol 8b.7 version: 5/1/7 A. W. Pizurica, Philips, Universiteit Gent, 67 19986 Significance coding (JPEG) one precinct 4 5 6 7 1 codeblock One resolution level is composed of 3 subbands 1 3 8 9 1 11 Each resolution level is divided in precincts (regions): each region contains the coefficients from one spatial surrounding and from all 3 subbands of the resolution level Each region is split in a similar way into code blocks Code blocks are coded independently of one another method: context dependent encoding of bit planes, starting with the most significant bit plane k = image formed by kth bit of the absolute values of each coefficient in a code book 8b.8

version: 5/1/7 A. W. Pizurica, Philips, Universiteit Gent, 67 19986 Significance coding (JPEG) 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Each bit plane is subdivided into stripes of height 4 Order of arithmetic coding Most significant bit planes first Inside of the bit plane: stripe per stripe Inside a stripe: column per column Sign bit is separately encoded and not described as bit plane The compressed data are grouped into layers and packets: a packet consists of a (variable) number of bit planes of a number of code blocks from the same one region contains data of a given spatial location and resolution a layer consists of a packet of each region at each resolution level; a layer does not necessarily contain all the bit planes contains data that increase the quality of the whole image 8b.9 version: 5/1/7 Bit plane coding A. W. Pizurica, Philips, Universiteit Gent, 67 19986 Each bit plane is separately encoded, but coding is adaptive and makes use of context information of more significant bit planes Definition: a given wavelet coefficient becomes significant (in the sense of significance coding ) when at least one of its already coded bits is 1 The coding of a bit plane conists of 3 steps: step 1, significance propagation: coding the bits with value k of the coefficients that are not significant yet, but have at least one neighbor that is already significant step, magnitude refinement : coding of the bits of the coefficients that became significant in the previous bit plane step 3, cleanup pass : coding all the remaining bits Remark: when the coefficient become significant for the first time, its sign is coded immediately 8b.3

version: 5/1/7 1=+11 Bit plane coding: example Coefficients Step 1 1 3 7 3. clean up 1+ 1. significance. refinement sign bit 3. clean up 1 1. significance 1+. refinement 1 1 3. clean up 1. significance 1+. refinement 1 1 3. clean up 7=111 bit plane 3: value 3 bit plane : value e bit plane 1: value 1 A. W. Pizurica, Philips, Universiteit Gent, 67 19986 no remaining coefficients no work for clean up bit plane : value Remark: for the first bit plane the steps 1 and are not performed; there are no significant coefficients yet at that point 8b.31 version: 5/1/7 A. W. Pizurica, Philips, Universiteit Gent, 67 19986 Philosophy behind bit plane coding Philosophy of bit plane coding: sorting the bits for an optimal adaptive operation of the arithmetic coder in step 1, 1 bits are very likely: significant coefficients = large coefficients, and these are spatially grouped in step, 1 bits are equally likely as bits in step 3, bits are likely, typically the smallest coefficients coded in this step In each of the 3 steps we have a different statistics Arithmetic coder works better when encoding bits of a given type after one another instead of mixing all the types 8b.3

version: 5/1/7 Remarks A. W. Pizurica, Philips, Universiteit Gent, 67 19986 Not discussed aspects Runlegth coding is also used in some steps The image is first divided into tiles; these are subimages that are coded independently of one another extra high level scalability Why significance coding and not zerotree coding in JPEG? In zerotree coding the subbands are jointly coded less possibilities for scalability and more complex implementation! 8b.33 version: 5/1/7 Wavelet coding versus JPEG... A. W. Pizurica, Philips, Universiteit Gent, 67 19986 JPEG, factor 4 JPEG, factor 4 SPIHT, factor 4 SPIHT= Set Partitioning in Hierarchical Trees = wavelets+zero tree coding SPIHT is much better than JPEG at low bit rates The new JPEGstandard JPEG contains a wavelet algorithm Original: 56 kbyte, 8 bit/pixel Compressed: 65 byte,. bit/pixel 8b.34

version: 5/1/7 Wavelet coding versus JPEG... A. W. Pizurica, Philips, Universiteit Gent, 67 19986 JPEG, factor 4 JPEG, factor 1 JPEG, factor JPEG, factor 4 JPEG, factor 1 JPEG, factor cannot be realised 8b.35 version: 5/1/7... Wavelet coding versus JPEG A. W. Pizurica, Philips, Universiteit Gent, 67 19986 JPEG, factor 4 JPEG, factor 4 SPIHT, factor 4 Original: 64 kbyte, 8 bit/pixel Compressed: 16 byte,. bit/pixel SPIHT and JPEG never cause block distrortion Small images compress obviously worse than big images it is not the resolution of the image but its content that that finally determines the number of bits for a given quality 8b.36

version: 5/1/7 Bibliography A. W. Pizurica, Philips, Universiteit Gent, 67 19986 Technical overview of JPEG http://www.rii.ricoh.com/%7egormish/pdf/dcc_jpeg_note.pdf JPEG software implementation http://www.ece.uvic.ca/~mdadams/jasper/ (JasPer Project an opensource initiative to provide a free softwarebased reference implementation of the JPEG codec). 8b.37 version: 5/1/7 Commands A. W. Pizurica, Philips, Universiteit Gent, 67 19986 Conversion to jpeg factor 4: jasper input lena51x51.bmp outputformat jp output lena.jp O rate=.5 factor 1: jasper input lena51x51.bmp outputformat jp output lena.jp O rate=.1 Conversion from jpeg jasper input lena.jp outputformat pnm output lena.pnm Conversion to jpeg factor 4: convert quality 1 lena51x51.bmp lena.jpg factor 1: convert quality 3 lena51x51.bmp lena.jpg 8b.38