Massachusetts Institute of Technology. Problem Set 2 Solutions. Solution to Problem 1: Is it Over Compressed or is it Modern Art?

Similar documents
Massachusetts Institute of Technology. Solution to Problem 1: Is it Over-Compressed or is it Modern Art?

Massachusetts Institute of Technology. Solution to Problem 1: Is it Over-Compressed or is it Modern Art?

7.5 Dictionary-based Coding

Optimization of Bit Rate in Medical Image Compression

Redundant Data Elimination for Image Compression and Internet Transmission using MATLAB

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

MRT based Fixed Block size Transform Coding

So, what is data compression, and why do we need it?

IMAGE COMPRESSION USING HYBRID QUANTIZATION METHOD IN JPEG

MRT based Adaptive Transform Coder with Classified Vector Quantization (MATC-CVQ)

An introduction to JPEG compression using MATLAB

Source coding and compression

Multimedia Signals and Systems Still Image Compression - JPEG

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

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

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

Dictionary Based Compression for Images

Modified SPIHT Image Coder For Wireless Communication

Lossless Compression Algorithms

Lecture 5: Compression I. This Week s Schedule

2-D SIGNAL PROCESSING FOR IMAGE COMPRESSION S. Venkatesan, Vibhuti Narain Rai

CSEP 521 Applied Algorithms Spring Lossy Image Compression

Video Compression An Introduction

Chapter 1. Digital Data Representation and Communication. Part 2

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

ECE 533 Digital Image Processing- Fall Group Project Embedded Image coding using zero-trees of Wavelet Transform

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

CHAPTER-4 WATERMARKING OF GRAY IMAGES

VIDEO SIGNALS. Lossless coding

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

Comparative Study of Partial Closed-loop Versus Open-loop Motion Estimation for Coding of HDTV

IMAGE COMPRESSION USING FOURIER TRANSFORMS

DIGITAL IMAGE WATERMARKING BASED ON A RELATION BETWEEN SPATIAL AND FREQUENCY DOMAINS

FRACTAL IMAGE COMPRESSION OF GRAYSCALE AND RGB IMAGES USING DCT WITH QUADTREE DECOMPOSITION AND HUFFMAN CODING. Moheb R. Girgis and Mohammed M.

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

Digital Image Processing

Lecture 8 JPEG Compression (Part 3)

Bits and Bit Patterns

Perceptual Coding. Lossless vs. lossy compression Perceptual models Selecting info to eliminate Quantization and entropy encoding

Engineering Mathematics II Lecture 16 Compression

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

THE TRANSFORM AND DATA COMPRESSION HANDBOOK

A Novel Image Compression Technique using Simple Arithmetic Addition

ROI Based Image Compression in Baseline JPEG

Distributed Video Coding

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

CHAPTER 9 INPAINTING USING SPARSE REPRESENTATION AND INVERSE DCT

Data Storage. Slides derived from those available on the web site of the book: Computer Science: An Overview, 11 th Edition, by J.

JPEG: An Image Compression System

Numbers and Computers. Debdeep Mukhopadhyay Assistant Professor Dept of Computer Sc and Engg IIT Madras

Tutorial on Image Compression

Enhancing the Image Compression Rate Using Steganography

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

Image Compression Algorithm and JPEG Standard

UNIVERSITY OF DUBLIN TRINITY COLLEGE

CPSC 301: Computing in the Life Sciences Lecture Notes 16: Data Representation

Source Coding Techniques

Image Compression Using SOFM

A Comprehensive Review of Data Compression Techniques

An Analytical Review of Lossy Image Compression using n-tv Method

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

Department of electronics and telecommunication, J.D.I.E.T.Yavatmal, India 2

A combined fractal and wavelet image compression approach

Image Compression Techniques

Overcompressing JPEG images with Evolution Algorithms

International Journal of Emerging Technology and Advanced Engineering Website: (ISSN , Volume 2, Issue 4, April 2012)

Intro. To Multimedia Engineering Lossless Compression

A QUAD-TREE DECOMPOSITION APPROACH TO CARTOON IMAGE COMPRESSION. Yi-Chen Tsai, Ming-Sui Lee, Meiyin Shen and C.-C. Jay Kuo

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

Chapter 1. Data Storage Pearson Addison-Wesley. All rights reserved

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

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

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

Comparative and performance analysis of HEVC and H.264 Intra frame coding and JPEG2000

Compression of Image Using VHDL Simulation

Lecture Coding Theory. Source Coding. Image and Video Compression. Images: Wikipedia

Image Compression With Haar Discrete Wavelet Transform

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

CHAPTER 6 INFORMATION HIDING USING VECTOR QUANTIZATION

JPEG decoding using end of block markers to concurrently partition channels on a GPU. Patrick Chieppe (u ) Supervisor: Dr.

A New Compression Method Strictly for English Textual Data

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

Compression of Stereo Images using a Huffman-Zip Scheme

CHAPTER-5 WATERMARKING OF COLOR IMAGES

Quantization, conversion of values into bits

Compression Part 2 Lossy Image Compression (JPEG) Norm Zeck

Welcome Back to Fundamentals of Multimedia (MR412) Fall, 2012 Lecture 10 (Chapter 7) ZHU Yongxin, Winson

A Reversible Data Hiding Scheme for BTC- Compressed Images

Compression; Error detection & correction

Data Representation. Types of data: Numbers Text Audio Images & Graphics Video

A Hybrid Image Compression Technique using Quadtree Decomposition and Parametric Line Fitting for Synthetic Images

IMAGE COMPRESSION TECHNIQUES

CMPT 365 Multimedia Systems. Media Compression - Video

JPEG 2000 compression

Chapter 7 Lossless Compression Algorithms

Lossless Image Compression with Lossy Image Using Adaptive Prediction and Arithmetic Coding

Image Compression. cs2: Computational Thinking for Scientists.

AN OPTIMIZED LOSSLESS IMAGE COMPRESSION TECHNIQUE IN IMAGE PROCESSING

MULTIMEDIA COMMUNICATION

Scalable Video Coding

Transcription:

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Department of Mechanical Engineering 6.050J/2.110J Information and Entropy Spring 2003 Problem Set 2 Solutions Solution to Problem 1: Is it Over Compressed or is it Modern Art? The following MATLAB code solves parts a to e: % Perform initialization as indicated in the problem set. load imdemos flower; flower=double(flower); colormap( gray ); % Since many figures will be produced by this script, we use meaningful labels. set(gcf, NumberTitle, off, Name, Flower ); imshow(flower,[0 255]); % Implement the comrpession scheme detailed in the problem set. encoded=blkproc(flower,[8 8], dct2 ); encoded(abs(encoded)<10)=0; decoded=round(blkproc(encoded,[8 8], idct2 )); % Provide the error value to check against the expected value from the set. sprintf( With cutoff=10, the mean squared error is %.4f,... mean2((flower decoded). 2)) The mean squared error you should have obtained is 10.6891. The next piece of code produces the graph of file size versus mean squared error. % Initialize the vectors that will store the data for the graph. x=[]; y=[]; % We need only encode the image once. After that, since we will be steadily % increasing the threshold, we need to reconvert again more because we will be % simply zeroing out more elements with each iteration through the for loop % (there is no reason to recover all the original elements and start from scratch % each time through the loop; we can progressively drop more and more data). encoded=blkproc(flower,[8 8], dct2 ); % Now we begin to collect data for the graph. for cutoff=0:4:100, encoded(abs(encoded)<cutoff)=0; decoded=round(blkproc(encoded,[8 8], idct2 )); % We will simply append to the vectors each time through this loop. x=[x,nnz(encoded)]; 1

2 y=[y,mean2((flower decoded). 2)]; % The next three lines can be commented out if they are not desired. They % will produce a new window, label it, and print a representation of the % newly decoded image for each cutoff threshold. This is for comparison % with the original image to answer the question in the set that asks at % which point the difference between the original image and the compressed % image becomes perceptible to the human eye. figure; set(gcf, NumberTitle, off, Name,sprintf( cutoff=%d,cutoff)); imshow(decoded,[0 255]); end % Now, plot the graph with a smooth curve and boxes around all the actual data points. figure; set(gcf, NumberTitle, off, Name, Graph for Problem 1 ); plot(x,y, s ) title( Comparison of File Size and Image Error ); xlabel( Non zero matrix values (number of bytes to store) ); ylabel( Mean squared error ); You should have gotten something remotely resembling the graph in Figure 1. As you can see, there is a point where the MSE increases exponentially giving a quantitative value to the degradation of the reconstructed picture. Medical applications such as in X rays tend to discourage the use of JPEG or similar lossy compression algorithms for saving images due to chances of distortion leading to an incorrect diagnosis. The largest byte size for which I could detect the difference between the original image and the reconstructed image by eye was 1,785 bytes, which corresponds to a cutoff of 24 and a mean square error of 42.2132. This is rather remarkable because the image started out over 16kb long, which means that less that an eighth of the data recorded is actually necessary to create the visual effect we experience when looking at the picture. Beyond that, the quality is not horrible, either, but we can begin to detect bands forming due to the fact that the pixels were processed as distinct 8 8 blocks. By the end of the experiment, where the cutoff is 100, the picture is not good, yet there is still enough data that it is recognizable as a flower and shows a resemblance to the original image. Solution to Problem 2: Compression is Fun and Easy Solution to Problem 2, part a. Table 1 represents the LZW analysis of the phrase peter piper picked a peck of pickled peppers. The resulting data stream is: 80 70 65 74 65 72 20 70 69 82 86 88 63 6B 65 64 20 61 87 65 8D 20 6F 66 87 8C 6B 6C 8F 93 70 8A 73 81 This is 34 bytes long, whereas the original message was 46 bytes long (including the start and stop control characters), which amounts to 26.1% compression. If we count bits, the original message could have been sent in 7 bits per character (total 322 bits) whereas the LZW code requires 8 bits per character (total 272 bits) so the compression is 15.5%. Of course, this is a short example but contrived to make the dictionary grow quickly. For a sizeable selection of average English text, LZW typically yields 50% compression.

3 Figure 1: Comparison of File Size and Image Error Solution to Problem 2, part b. This strategy has several advantages: we will stay within 7 bit data, hence more compression and faster encoder/decoder; moreover, the dictionary can be searched quickly. There is a major drawback, though. The dictionary can only have 16 entries beyond the ASCII characters. Except for very short and repetitive sequences of characters, the dictionary will overflow. Another drawback is that the text cannot include any of the ASCII characters being used for the dictionary; among the characters excluded are three that are often used (DC1, DC3, and ESC). On the other hand, the characters HEX 80 FF would now be available since the dictionary no longer is there, and this includes many common accented letters of Western European languages. A practical implementation of the coder and decoder would not be either easier or harder by very much, but new programs would have to be written because this proposed arrangement is not standard, and new software always brings with it a cost and risk of bugs.

4 New New Input dictionary Transmission dictionary Output entry entry {}}{{}}{{}}{{}}{{}}{ 02 STX 65 e 82 pe 74 t 83 et 65 e 84 te 72 r 85 er 20 space 86 r space 70 p 87 space p 69 i 88 pi 70 p 89 ip 72 r 8A per 20 space 70 p 8B r space p 69 i 63 c 8C pic 6B k 8D ck 65 e 8E ke 64 d 8F ed 20 space 90 d space 61 a 91 space a 20 space 92 a space 65 e 93 space pe 63 c 94 ec 6B k 20 space 95 ck space 6F o 96 space o 66 f 97 of 20 space 98 f space 69 i 99 space pi 63 c 6B k 9A ic 6C l 9B ckl 65 e 9C le 64 d 20 space 9D ed space 70 p 9E space pep 70 p 9F pp 72 r 73 s A0 pers 03 ETX 80 (start) STX p 65 e 80 pe e 74 t 81 et t 65 e 82 te e 72 r 83 er r 20 space 84 r space space 70 p 85 space p p 69 i 86 pi i 87 ip 82 pe pe 88 per 86 r space r space 89 r space p 88 pi pi 63 c 8A pic c 6B k 8B ck k 65 e 8C ke e 64 d 8D ed d 20 space 8E d space space 61 a 8F space a a 90 a space 87 space p space p 65 e 91 space pe e 92 ec 8D ck ck 20 space 93 ck space space 6F o 94 space o o 66 f 95 of f 96 f space 87 space p space p 97 space pi 8C pic pic 6B k 98 ic k 6C l 99 ckl l 9A le 8F ed ed 9B ed space 93 space pe space pe 70 p 9C space pep pp 9D pp 8A per per 73 s 9E pers s 81 (stop) ETX Table 1: Solution to Problem 2, part a

MIT OpenCourseWare http://ocw.mit.edu 6.050J / 2.110J Information and Entropy Spring 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.