IMAGE PROCESSING IMAGE COMPRESSION

Slides:



Advertisements
Similar presentations
T.Sharon-A.Frank 1 Multimedia Compression Basics.
Advertisements

Data Compression CS 147 Minh Nguyen.
Image Compression. Data and information Data is not the same thing as information. Data is the means with which information is expressed. The amount of.
SWE 423: Multimedia Systems
Spatial and Temporal Data Mining
JPEG.
Image Compression (Chapter 8)
Data Compression Basics
JPEG Still Image Data Compression Standard
Fundamentals of Multimedia Chapter 7 Lossless Compression Algorithms Ze-Nian Li and Mark S. Drew 건국대학교 인터넷미디어공학부 임 창 훈.
CMPT 365 Multimedia Systems
T.Sharon-A.Frank 1 Multimedia Image Compression 2 T.Sharon-A.Frank Coding Techniques – Hybrid.
Department of Computer Engineering University of California at Santa Cruz Data Compression (2) Hai Tao.
2007Theo Schouten1 Compression "lossless" : f[x,y]  { g[x,y] = Decompress ( Compress ( f[x,y] ) | “lossy” : quality measures e 2 rms = 1/MN  ( g[x,y]
CS430 © 2006 Ray S. Babcock Lossy Compression Examples JPEG MPEG JPEG MPEG.
Why Compress? To reduce the volume of data to be transmitted (text, fax, images) To reduce the bandwidth required for transmission and to reduce storage.
Software Research Image Compression Mohamed N. Ahmed, Ph.D.
Lossy Compression Based on spatial redundancy Measure of spatial redundancy: 2D covariance Cov X (i,j)=  2 e -  (i*i+j*j) Vertical correlation   
Chapter 2 Source Coding (part 2)
Compression is the reduction in size of data in order to save space or transmission time. And its used just about everywhere. All the images you get on.
Computer Vision – Compression(2) Hanyang University Jong-Il Park.
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.
ECE472/572 - Lecture 12 Image Compression – Lossy Compression Techniques 11/10/11.
Prof. Amr Goneid Department of Computer Science & Engineering
Image Processing and Computer Vision: 91. Image and Video Coding Compressing data to a smaller volume without losing (too much) information.
CIS679: Multimedia Basics r Multimedia data type r Basic compression techniques.
Image Compression Supervised By: Mr.Nael Alian Student: Anwaar Ahmed Abu-AlQomboz ID: IT College “Multimedia”
1 Classification of Compression Methods. 2 Data Compression  A means of reducing the size of blocks of data by removing  Unused material: e.g.) silence.
Hardware/Software Codesign Case Study : JPEG Compression.
Digital Image Processing Image Compression
Image Compression – Fundamentals and Lossless Compression Techniques
Outline Kinds of Coding Need for Compression Basic Types Taxonomy Performance Metrics.
Image Compression Fasih ur Rehman. Goal of Compression Reduce the amount of data required to represent a given quantity of information Reduce relative.
COMPRESSION. Compression in General: Why Compress? So Many Bits, So Little Time (Space) CD audio rate: 2 * 2 * 8 * = 1,411,200 bps CD audio storage:
Computer Vision – Compression(1) Hanyang University Jong-Il Park.
Chapter 17 Image Compression 17.1 Introduction Redundant and irrelevant information  “Your wife, Helen, will meet you at Logan Airport in Boston.
Advances in digital image compression techniques Guojun Lu, Computer Communications, Vol. 16, No. 4, Apr, 1993, pp
Lecture 4: Lossless Compression(1) Hongli Luo Fall 2011.
CS654: Digital Image Analysis
CS654: Digital Image Analysis Lecture 34: Different Coding Techniques.
Digital Image Processing Lecture 22: Image Compression
STATISTIC & INFORMATION THEORY (CSNB134) MODULE 11 COMPRESSION.
Chapter 7 Lossless Compression Algorithms 7.1 Introduction 7.2 Basics of Information Theory 7.3 Run-Length Coding 7.4 Variable-Length Coding (VLC) 7.5.
Image Compression (Chapter 8)
JPEG Compression What is JPEG? Motivation
Compression & Huffman Codes
EE465: Introduction to Digital Image Processing
Digital Image Processing Lecture 20: Image Compression May 16, 2005
IMAGE PROCESSING INTRODUCTION TO DIGITAL IMAGE PROCESSING
IMAGE COMPRESSION.
CS644 Advanced Topics in Networking
Data Compression.
Multimedia Outline Compression RTP Scheduling Spring 2000 CS 461.
Algorithms in the Real World
IMAGE PROCESSING IMAGE RESTORATION AND NOISE REDUCTION
JPEG Image Coding Standard
Image Compression The still image and motion images can be compressed by lossless coding or lossy coding. Principle of compression: - reduce the redundant.
Discrete Cosine Transform
IMAGE PROCESSING INTENSITY TRANSFORMATION AND SPATIAL FILTERING
Data Compression.
Data Compression CS 147 Minh Nguyen.
CH 8. Image Compression 8.1 Fundamental 8.2 Image compression models
Image Compression 9/20/2018 Image Compression.
CMPT 365 Multimedia Systems
Why Compress? To reduce the volume of data to be transmitted (text, fax, images) To reduce the bandwidth required for transmission and to reduce storage.
UNIT IV.
Image Transforms for Robust Coding
JPEG Still Image Data Compression Standard
Image Coding and Compression
Presentation transcript:

IMAGE PROCESSING IMAGE COMPRESSION By DR. FERDA ERNAWAN Faculty of Computer Systems & Software Engineering ferda@ump.edu.my

Today’s Lesson Introduction to Image Compression General JPEG Image Compression Lossless & Lossy compression Data Redundancies Lossless Compression Methods Huffman Coding, Lossless Predictive Coding Lossy Compression Methods Block Transform Coding Learning Outcomes: To understand image compression processing and the basic operation

Introduction Image compression is a method to reduce the redundancies in image representation in order to decrease data storage requirements (Gonzalez and Woods, 2013). It is a technique used to compress an image without visually reducing the quality of the image itself. Data vs. Information. The goal of these processes is to represent an image with the same quality level, but in a more solid form.

Why the image must be compressed? The large storage requirement of multimedia data. The video or image files consume large amount of data and it always required very high bandwidth networks in transmission as well as communication costs.

Aims of Image Compression Reduce the data storage and maintain the visual image quality (Gonzalez, Woods and Eddins, 2017). Increase the speed of transmission by using the repetition property of data. The goal of these processes is to represent an image with the same quality level, but in a more solid form.

General JPEG Compression

General Image Compression Model Images taken from Gonzalez & Woods, Digital Image Processing Encoder Decoder

Image Compression (Encoder) Image Transformation Image Quantization Entropy Coding Color components (Y, Cb, Cr) 8x8 DCT Transform Scalar Uniform Quantization Zig-zag Reordering Difference Encoding Huffman Coding Bit-stream AC Huffman Table DC Huffman Table Quantization Table AC DC

Block Transform Coding System An image is divided into 8x8 pixels of non-overlapping blocks. Each block is transformed by the transform function (e.g. DCT) Compression is achieved during the quantization of the transformed coefficients.

DCT Transformation DCT of an input image A is defined as follows where The inverse of DCT is given as follows:

Quantization Process The JPEG quantization are given as follows: Where is the frequency image signals at coordinates (i,j) in the k block.

Differential Pulse Code Modulation (DPCM) for DC Coefficients The DC coefficients of each block are encoded with a DPCM instead of block-based prediction. The DC coefficients are coded by DPCM as follows: Where is the current block and represents the previous block of DC coefficient.

Differential Pulse Code Modulation of DC Coefficients Then the difference is encoded using Huffman coding together with the encoding of AC coefficients.

Zigzag Pattern for AC coefficients The zigzag pattern is an important part of encoding process which gives effect to the statistic of symbols used in entropy coding. Zigzag order under regular of 8×8 discrete transform

DCT as choice of Transform Original Image Compressed Image JPEG image compression produces visible artifact image, less computational complexity and it has a good energy compactness properties.

Other Compression Method Symbol-based Coding – JBIG2 format compression for binary images. LZW (Lempel-Ziv-Welch) Coding – integrated into GIF, TIFF, PDF. Arithmetic Coding. Golomb Coding. Lossy Predictive Coding – DPCM (Differential pulse code modulation). Wavelet Coding – Haar, Daubechies wavelets. JPEG-2000

Compression Ratio (CR) Compression is measured in compression ratio denoted by: Example: The original image is 256×256 pixels, 8-bits per pixel grayscale. The file is 65536 bytes (64 kb) in size. After compression the image file is 6554 bytes. The compression ratio is

Relative Data Redundancy () The relative data redundancy, R can be determined as: This indicates that 90% of its data is redundant. The higher the RD value, the more data is redundant and will be compressed. If RD=0, (no redundant data)

Redundancy

Type of Redundancy There are three types of redundancy: Coding redundancy Interpixel redundancy Psychovisual redundancy

Coding Redundancy A code is a symbol (letters, numbers, bits) used to represent a body of information (Gonzalez and Woods, 2016). Each information is assigned a sequence of code symbols, called a code word. The number of symbols in each code word is its length. Symbols with higher appearing probabilities are assigned with codes of less amount of data. Symbol: codes that human represent information E.g., Chinese characters, English letters, … Coding: transform symbols into more efficient codes E.g., A: 00, B: 01, C: 10, …

Coding Redundancy: Example Average bit length (Lavg1)=3 bits, Average bit length (Lavg2)=2.7 bits, Compression ratio= 3/2.7=1.11, Relative Redundancy=0.099

Inter-pixel Redundancy Also called spatial redundancy, geometric redundancy, inter-frame redundancy. Results from structural or geometric relationships between objects and the image. Adjacent pixels are usually highly correlated (pixel similar or very close to neighboring pixels), thus information is unnecessarily replicated in the representations. Neighboring pixels in a natural image are highly correlated. In natural images, local area usually contains pixels of same or similar gray level.

Inter-pixel Redundancy: Example Pixels of line 128 of Tiffany: Pixels of line 128 of wheel:

Inter-pixel Redundancy: Example Pixels of line 128 of wheel: n1 represent data information and n2 is amounts of data to represent the same information. Similar segments (graylevel, number): (77, 1), (206, 30), (121, 88), (77,18), (121, 88), (206, 30), (77, 1) Coding each segment with 16 bits: CR=(256x8) / (7x16)=18.3 RD=1-1/18.3=0.95

Psychovisual Redundancy For human visual perception, certain information has less relative importance. E.g,: appropriate quantization of gray levels does not impact its visual quality, e.g.,: Tiffany Can be eliminated without significant quality loss. Use Lossy compression or Irreversible compression. “Quantization”.

Information Theory

Basic Information Theory Measuring amount of information: I(p) = log 1/p = – log p Average amount of information: entropy. Theoretically, the lowest average number of bits required to represent one symbol.

Example: In average, minimum 2 bits required. Symbol Probability A 1/4 B C D In average, minimum 2 bits required. Symbol Probability A ½ B 1/8 C D 1/4 In average, minimum 1.75 bits required.

Compression Method There are two types of compression methods: Lossy image compression Lossless image compression

Lossy Compression Methods Lossy image compression methods are required to achieve high compression ratios for complex images. An image reconstructed Lossy compression can be performed in both spatial or transform domains. The process of quantization-dequantization introduces loss in the reconstructed image and is inherently responsible for the “lossy” nature of the compression scheme. The quantized transform coefficient is computed by Where is the frequency image signals at coordinates (i,j) in the k block.

Lossy Compression Methods During dequantization, approximate DCT coefficients are obtained by multiplying the corresponding quantization threshold with the quantized coefficient as follows:

Lossless Compression Methods Lossless compression methods are needed in some digital imaging applications, such as: medical images, x-ray images, etc. Lossless compression techniques: run-length coding, Huffman coding, lossless predictive coding etc.

Run-Length Encoding of AC Coefficients The frequency image signals after quantization process consist of many zeros. Then, a special condition as known end-of-block (EOB) is applied to get an efficient in the entropy code. A symbol of EOB indicates that the rest of the coefficients in the block are zero. Next, run-length encoding exploits the repeating frequency image signals as the symbols in the sequence a set of the AC coefficients. The output of run-length encoding represents a sequence value with the consecutive repetition as symbols and the length of occurrence of the symbols

Huffman Coding Huffman coding is a famous method that uses variable-length codes (VLC) tables for compressing data (Jayaraman, Veerakumar, and Esakkirajan, 2017). Given a set of data symbols and their probabilities, the method creates a set of variable-length codeword with the shortest average length and assigns them to the symbols.

Huffman Coding (cont..)

Example I

Example I- Cont..

Example I- Cont..

Example II

Example II

Example II- Cont.. Binary coderwork tree representation

Example II- Cont.. Note: Log2 x = Log10 . Log2 (10) = 3.3219 Log10 x Log2 x = Log10 X Log2 (10) = 3.3219 Log10 x

Summary of Huffman Code Achieve minimal redundancy subject to the constraint that the source symbols be coded one at a time. Sorting symbols in descending probabilities is the key in the step of source reduction. The codeword assignment is not unique. Exchange the labeling of “0” and “1” at any node of binary codeword tree would produce another solution that equally works well. Only works for a source with finite number of symbols (otherwise, it does not know where to start).

References R.C. Gonzalez and R.E. Woods, 2016. Digital Image Processing, Pearson Education India; Third edition. A.K. Jain, 2015. Fundamentals of Digital Image Processing, Pearson Education India; First edition. R.C. Gonzalez, R.E. Woods and S.L. Eddins, 2017. Digital Image Processing Using MATLAB. McGraw Hill Education; 2 edition. S. Jayaraman, T. Veerakumar, S. Esakkirajan, 2017.Digital Image Processing, McGraw Hill Education; 1 edition.