You are on page 1of 14
Image Compression s, . IA Motivation NUST * Storage needed for a two-hour standard television movie (Color) — Image size = 720 x 480 pixels — Frame rate = 30 fps (frame per seconds) 3 bytes _ frames i. 31,104,000 bytes/sec 30 HADES. (720 x 480) PIXE 3 sec frame pixel For 2 hour movie 31,104,000 22S x (602) = x 2 hrs = 2.24 x 10!' bytes = 224 GB sec ir Image Compression NusT Principal objective To minimize the number of bits required to represent an image Applications Transmission: Broadcast TV, remote sensing via satellite, military communications via aircraft, radar and sonar, teleconferencing, computer communications, ... Storage: Educational and business documents, medical images (CT, MRI and digital radiology), motion pictures, satellite images, weather maps, geological surveys, ... i wh Overview NUST * Image data compression methods fall into two common categories: * Information preserving compression — Especially for image archiving (storage of legal or medical records) — Compress and decompress images without losing information * Lossy image compression — Provide higher levels of data reduction — Result in a less than perfect reproduction of the original image i ae Data vs. Infortnation NUST * Data are the means to convey information; various amounts of data may be used to represent the same amount of information * Part of data may provide no relevant information: data redundancy * Probability and Information * Compression — Reducing the amount of data to represent a given quantity of information Relative Data Redundancy ed * Let b and b’ refer to amounts of data in two data sets that carry the same information Compression Ratio (C) = 2 Releative data redundancy (R) = of the first dataset b ifb = b’, C= 1 and R = 0, relative to the second data set, the first set contains no redundant data if b >> b’, C> ©» and R > 1, relative to the second data set, the first set contains highly redundant data ifb << b’, C-> O and R > -%, relative to the second data set, the first set is highly compressed 16 si eee Bit lt Nine Neen bacaten tine diven mew lc goalies Data Redundancy wr * Image compression techniques can be designed for reducing or eliminating the data redundancy * Three basic data redundancies — Spatial and Temporal redundancy — Coding redundancy — Irrelevant information Coding Redundancy neer + A natural m-bit coding method assigns m-bit to each gray level without considering the probability that gray level occurs ~ very likely to contain coding redundancy * Basic concept? — Utilize the probability of occurrence of each gray level (histogram) to determine length of code representing that particular gray level: variable-length coding — Assign shorter code words to the gray levels that occur most frequently or vice versa Coding Redundancy NUST Let 0 <1, $1:Gray levels (discrete random variable) P,(7,) :Propability of occurrence of 7, n, :Frequency of gray level 7, n_ :Total number of pixels in the image L_ :Total number of gray level 1(r,) :Number of bits used to represent 7, L,,, :Average length of code words assigned to gray levels ‘ave Lang = GIP) where P.()="* jk =O,1 2, b—1 Hence, the total number of bits required to code and MxN pixel image is MNL,,. For a natural m-bit coding L.,,,= Coding Redundancy - Exampie mor * Code 1: Natural code (m Lag = 8 bits ) is used, + Code 2: Variable length code Lag = (0.25)2 + 0.47(1) + 0.25(3) + 0.03(3) 81 bits 256x 256x8 © Compression Ratio = |———————— = 4.42 Acomputer generated 256x 256x 1.81 (synthetic) 8-bit image M=N=256 +R =1-1/4.42 =0.774 Tk PATE) Code 1 Ure) Code 2 12(rK) rs 0.25 01010111 8 o1 2 an 0.47 10000000 8 1 1 Ti86 0.25 11000100 8 000 3 ass 003 11111111 8 001 3 1 for k # 87, 128, 186,255 0 = 8 - 0 Coding Redundancy - Example HE, + Code 1: Natural code (m= 8) is used, Lg = 8 bits + Code 2: Variable length code Log = (0.25)2 + 0.47(1) + 0.25(3) + 0.03(3) = 1.81 bits + Compression Ratio = Acomputer generated (synthetic) 8-bit image M=N=256 + R=1-1/4.42 =0.774 77.4% data in the image is redundant Redundancy - recap Ate NUST Table 6.1 Variable-Length Coding Example n Ars) Code 1 I(r) Code 2 L(r,) 0 0.19 000 “il 1 2 v7 0.25 001 3 Ol az 2n 0.21 010 3 10 2 3/7 0.16 Ou 3 001 3 47 0.08 100 3 0001 4 S/T 0.06 101 S 00001 5 6/7 0.03 110 2: 000001 6 1 0.02 1 a 000000. 6 * Compression Ratio? * Relative Redundancy? Compression Techniques sees: * Run length coding * Huffman coding * Symbol-Based coding * Bit-Plane coding * Transform Coding * Arithmetic coding * LZW coding * Predictive Coding HUFFMAN CODING + Let an 8-level image has the gray-level distribution as

You might also like