240-373: Chapter 12: Image Compression 1 Montri Karnjanadecha ac.th/~montri 240-373 Image Processing.

Slides:



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

15 Data Compression Foundations of Computer Science ã Cengage Learning.
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.
Michael Alves, Patrick Dugan, Robert Daniels, Carlos Vicuna
SWE 423: Multimedia Systems
School of Computing Science Simon Fraser University
SWE 423: Multimedia Systems
CSCI 3 Chapter 1.8 Data Compression. Chapter 1.8 Data Compression  For the purpose of storing or transferring data, it is often helpful to reduce the.
Segmentation Divide the image into segments. Each segment:
Computer Science 335 Data Compression.
Transform Domain Distributed Video Coding. Outline  Another Approach  Side Information  Motion Compensation.
Fundamentals of Multimedia Chapter 7 Lossless Compression Algorithms Ze-Nian Li and Mark S. Drew 건국대학교 인터넷미디어공학부 임 창 훈.
CMPT 365 Multimedia Systems
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]
Chapter 7 Special Section Focus on Data Compression.
Data dan Teknologi Multimedia Sesi 08 Nofriyadi Nurdam.
Roger Cheng (JPEG slides courtesy of Brian Bailey) Spring 2007
Management Information Systems Lection 06 Archiving information CLARK UNIVERSITY College of Professional and Continuing Education (COPACE)
01/31/02 (C) 2002, UNiversity of Wisconsin, CS 559 Last Time Color and Color Spaces.
Image Compression - JPEG. Video Compression MPEG –Audio compression Lossy / perceptually lossless / lossless 3 layers Models based on speech generation.
CSE Lectures 22 – Huffman codes
Trevor McCasland Arch Kelley.  Goal: reduce the size of stored files and data while retaining all necessary perceptual information  Used to create an.
CS559-Computer Graphics Copyright Stephen Chenney Image File Formats How big is the image? –All files in some way store width and height How is the image.
Basics of Compression Goals: to understand how image/audio/video signals are compressed to save storage and increase transmission efficiency to understand.
Lecture 10 Data Compression.
1 Image Compression. 2 GIF: Graphics Interchange Format Basic mode Dynamic mode A LZW method.
CS Spring 2011 CS 414 – Multimedia Systems Design Lecture 7 – Basics of Compression (Part 2) Klara Nahrstedt Spring 2011.
JPEG. The JPEG Standard JPEG is an image compression standard which was accepted as an international standard in  Developed by the Joint Photographic.
Data Compression. Compression? Compression refers to the ways in which the amount of data needed to store an image or other file can be reduced. This.
Still-image compression Moving-image compression and File types.
JPEG CIS 658 Fall 2005.
Compression.  Compression ratio: how much is the size reduced?  Symmetric/asymmetric: time difference to compress, decompress?  Lossless; lossy: any.
8. 1 MPEG MPEG is Moving Picture Experts Group On 1992 MPEG-1 was the standard, but was replaced only a year after by MPEG-2. Nowadays, MPEG-2 is gradually.
Low-Power H.264 Video Compression Architecture for Mobile Communication Student: Tai-Jung Huang Advisor: Jar-Ferr Yang Teacher: Jenn-Jier Lien.
Addressing Image Compression Techniques on current Internet Technologies By: Eduardo J. Moreira & Onyeka Ezenwoye CIS-6931 Term Paper.
Digital Image Processing Image Compression
Image Compression – Fundamentals and Lossless Compression Techniques
1 Image Formats. 2 Color representation An image = a collection of picture elements (pixels) Each pixel has a “color” Different types of pixels Binary.
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.
Digital Image Processing Lecture 22: Image Compression
JPEG.
Page 11/28/2016 CSE 40373/60373: Multimedia Systems Quantization  F(u, v) represents a DCT coefficient, Q(u, v) is a “quantization matrix” entry, and.
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.
Lecture 12 Huffman Algorithm. In computer science and information theory, a Huffman code is a particular type of optimal prefix code that is commonly.
CS Spring 2012 CS 414 – Multimedia Systems Design Lecture 7 – Basics of Compression (Part 2) Klara Nahrstedt Spring 2012.
: Chapter 5: Image Filtering 1 Montri Karnjanadecha ac.th/~montri Image Processing.
By Dr. Hadi AL Saadi Lossy Compression. Source coding is based on changing of the original image content. Also called semantic-based coding High compression.
Software Design and Development Storing Data Part 2 Text, sound and video Computing Science.
Submitted To-: Submitted By-: Mrs.Sushma Rani (HOD) Aashish Kr. Goyal (IT-7th) Deepak Soni (IT-8 th )
Digital Image Processing Lecture 20: Image Compression May 16, 2005
3.3 Fundamentals of data representation
Data Compression.
JPEG.
JPG vs GIF vs PNG What is the difference?
Data Compression.
Data Compression CS 147 Minh Nguyen.
CMPT 365 Multimedia Systems
Image Processing, Leture #16
Image Compression Purposes Requirements Types
Image Coding and Compression
15 Data Compression Foundations of Computer Science ã Cengage Learning.
Chapter 8 – Compression Aims: Outline the objectives of compression.
Quantizing Compression
15 Data Compression Foundations of Computer Science ã Cengage Learning.
Quantizing Compression
Presentation transcript:

: Chapter 12: Image Compression 1 Montri Karnjanadecha ac.th/~montri Image Processing

: Chapter 12: Image Compression 2 Chapter 12 Image Compression

: Chapter 12: Image Compression 3 Image Compression Purposes –To minimize storage space –To maximize transfer speed –To minimize hardware costs Requirements –Speedy operation (compression and unpacking) –Significantly reduction in required memory –No significant loss of quality –Format of output suitable for transfer and storage

: Chapter 12: Image Compression 4 Image Compression Types –Statistical compression--based on pixels in whole image –Spatial compression--based on the spatial relationship of pixels of similar type –Quantizing compression--reducing number of gray levels and resolution –Fractal compression--based on fractal generating functions

: Chapter 12: Image Compression 5 Statistical Compression The Huffman Coding –Based on the assumption that the histogram is not normally flat –If 4 of 16 colors are used 60% of the time, 4 more for a further 30% and the rest for 10%, then we could use the following scheme: four frequently used colors

: Chapter 12: Image Compression 6 Statistical Compression next most frequently used colors the rest

: Chapter 12: Image Compression 7 Statistical Compression This means that the length (for an 640x480 image =150K) is reduced to [(0.6*3)+(0.3*4)+(0.1*5)] * 640 * 480 = K

: Chapter 12: Image Compression 8 –The average length has been reduced from 4 bits to 3.5 bits –It can be shown that with M gray levels, each with probability of P 0, P 1,.. P M-1, The number of bits required to code them is at least

: Chapter 12: Image Compression 9 Huffman Coding Technique 1: The Huffman Code USE: To reduce the space that an image uses on disk or in transit OPERATION: –Order the gray levels according to their frequency of use, most occurrence first –Combine the two least used gray levels into one group, combine their frequencies and reorder the gray levels

: Chapter 12: Image Compression 10 Huffman Coding OPERATION: (cont’d) –Continue to do this until only two gray levels are left –Now allocate a 0 to one of these gray-level groups and a 1 to the other –Work back through the groupings so that where two groups have been combined to form a new, larger, group which is currently coded as ‘ccc’ –Code one of the smaller groups as ccc0 and the other as ccc1

: Chapter 12: Image Compression 11 Huffman coding example Example: For a nine-color system, we obtain the following coding: Storage has improved from 19000*3 bits (57000) to bits.

: Chapter 12: Image Compression 12

: Chapter 12: Image Compression 13 Run Length Encoding Technique 2: Run length encoding USE: To reduce the space required by an image OPERATION: –The run is encoded by creating pairs of values: the first representing the gray level and the second how many of them are in the run

: Chapter 12: Image Compression 14 Run Length Encoding Example: image giving a sequence: (24 values) with run length encoding (1,1) (2,1) (1,5) (3,1) (4,4) (1,2) (3,3) (5,1) (1,4) (3,2) this would give: (20 values)

: Chapter 12: Image Compression 15 Run Length Encoding Notes –Huffman coding can be performed after Run length encoding –It might be possible to implement the Huffman code only on the run lengths

: Chapter 12: Image Compression 16 Run Length Encoding Contour Coding –Reducing the areas of pixels of the same gray levels to a set of contours that bound those areas –Consider the following image

: Chapter 12: Image Compression 17

: Chapter 12: Image Compression 18

: Chapter 12: Image Compression 19 Changing the Domain Technique 3: Compression using the frequency domain USE: To reduce space required for an image OPERATION: –Convert the image to the frequency domain using FFT or FHT –Threshold this new image removing all values less than k

: Chapter 12: Image Compression 20 Changing the Domain OPERATION: (cont’d) –If what is left is significantly less than the original image, using one of the spatial region techniques, store the rest of the image –If it is not significantly less, increase k-- more information will be lost

: Chapter 12: Image Compression 21 Quantizing Compression Involves reducing number of gray levels The easiest way is to divide all the gray levels by a factor Technique 4: Quantizing compression USE: To reduce storage space by limiting number of colors or gray levels

: Chapter 12: Image Compression 22 Quantizing Compression OPERATION: –Let P be the number of pixels in an original image to be compressed to N gray levels –Create a histogram of the gray level in the original image –Identify N ranges in the histogram such that approximately P/N lie in each range –Identify the median (the gray level with 50% of the pixels in the range on one side of it and 50% on the other) gray level in each range. These will be the N gray levels used to quantize the image –Store the N gray levels and allocate to each pixel a group (0 to n -1) according to which range it lies in

: Chapter 12: Image Compression 23 Quantizing compression example Consider the following image which is to be compressed to 2 bits/pixel, i.e. N = 4

: Chapter 12: Image Compression 24 Quantizing compression example histogram: 0** 1** 2********* 3*********** 4********* 5**** 6***** 7******** 8********* 9******

: Chapter 12: Image Compression 25 Quantizing compression example 65 pixels, down to 4 gray levels = in each range. The best range are: 0** 131** 2********* 3*********** 204********* 5**** 176***** 7******** 8********* 159******

: Chapter 12: Image Compression 26 Example: Cont’d With median gray levels 2,3,6 and 8, the new image become: Note that this technique is similar to the histogram equalization technique.

: Chapter 12: Image Compression 27 Fractal Compression –Yields 10000:1 compression ratio –Can also yield :1 compression ration with conventional algorithm added –Based on very simple functions to generate (in multi-dimensional space) highly complex and totally predictable pattern –Fractal graphics workstations: a 640x480 VGA image requires 5800 bytes of storage

: Chapter 12: Image Compression 28 Real-Time Image Transmission Compressing and sending a sequence of images in real-time Most of real-time vision systems send many images of the same type before changing the image to a new scene For example, most television program will dwell on a scene for at least 5 seconds

: Chapter 12: Image Compression 29 Real-Time Image Transmission Approach: the full first frame is sent, then only the differences of the next frames will be sent Run length encoding or simple vector encoding can be used for data reduction Example 3 bits/pixel x 48 pixels = 144 bits/image

: Chapter 12: Image Compression 30 Example (cont’d) If the first frame is sent, then the differences (mod 8) are now: vector encoded: (2,2)=2, (2,5)=5, (3,2)=3, (3,5)=5, (4,2)=3, (4,5)=6 6 vectors, 6 bits/position, 4 bits/difference = 60 bits

: Chapter 12: Image Compression 31 Example (cont’d) Modified run length encoded: bits/0 count, 4 bits/difference = 66 bits Difficulties arise when the scene does change, then the information may be too much to be transmitted in one frame time Solution: The receiver has a series of buffers for images to be displayed. The differences image must take less than the minimum ‘uncompressed’ frame time

: Chapter 12: Image Compression 32 Motion Prediction The image may still have the same constituent parts but they may have all shifted in one direction Technique 5: Block matching for motion prediction USE: Saving space by estimating what motion has occurred between past and present images, then only saving the changes.

: Chapter 12: Image Compression 33 Motion Prediction OPERATION: 1.Tile off the latest frame into blocks 2.Each of these blocks is then compared with blocks of the same size from the previous frame that are near in position to the block on the latest frame. 3.This has to be done for all blocks in the latest frame. Then the best match (and the corresponding predicted movement vector) is determined. This is called “ full-search block matching”

: Chapter 12: Image Compression 34 Motion Prediction n m p p Latest frame Previous frame Search area One of many blocks

: Chapter 12: Image Compression 35 Quadtrees A quadtree is a recursive segmenting of an image into four parts A suitable compression method for an image that has large area of the same colored pixels and rectangular in character

: Chapter 12: Image Compression 36 Quadtrees Operation: –the original image is cut into 4 equal quarter images and theses are cut into four, and so on… –consider each quarter image, break the image that has more than one color (non-homogeneous) and combine similar quarter –build a tree structure to store sub-images relationship Image standard –.BMP,.PIC,.PCX,.PIG,.TIFF,.GIF,.JPG, etc.

: Chapter 12: Image Compression 37 Quadtrees

: Chapter 12: Image Compression 38 Standard Image File Format –.BMP –.PIC –.PCX –.PIG –.TIFF –.GIF –.JPG –etc.

: Chapter 12: Image Compression 39 Image Compression Exercise Compare the compression of the following image using (a) Huffman coding (b) run length coding. The image has a gray level range of 0-7.