1 / 121

این دو عالم علم دارد در نهاد منتخب       وان جهانی رمز دارد در حروف مختصر

این دو عالم علم دارد در نهاد منتخب       وان جهانی رمز دارد در حروف مختصر سنایی غزنوی. Image/Video Compression & VOD. برنا فيروزي نويد زرين درفش محمود قديمي مهندسي فناوري اطلاعات بهار 88. Image Compression. Compression.

nitsa
Download Presentation

این دو عالم علم دارد در نهاد منتخب       وان جهانی رمز دارد در حروف مختصر

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. این دو عالم علم دارد در نهاد منتخب       وان جهانی رمز دارد در حروف مختصر سنایی غزنوی

  2. Image/Video Compression & VOD برنا فيروزي نويد زرين درفش محمود قديمي مهندسي فناوري اطلاعات بهار 88

  3. Image Compression

  4. Compression • فشرده سازی (Compression)، پردازشی است که با حذف اطلاعات اضافی، داده ها را به علایم دیجیتالی کاهش می دهد. • این پردازش بسته به پهنای باند مورد نیاز برای انتقال داده ها و میزان فضای ذخیره سازی، داده ها را کاهش می دهد. • کاهش پهنای باند مورد نیاز امکان انتقال داده های بیشتری را در یک زمان واحد می دهد. • كاهش افزونگی (redundancy)

  5. ديجيتال ،آنالوگ • پردازش تصاوير در فضاي ديجيتال انجام مي شود • اگر ما يك منبع تصويري آنالوگ داشته باشيم بايد قبل از انجام هر عمل فشرده سازي ابتدا به آن را به ديجيتال تبديل كنيم 5

  6. Purpose of Image Compression • Saving storagespace • Saving transfer time • Easy processing • Easy to transmitted over network • reducecost

  7. هدف • در حالت ايده آل ما خواستار • حداكثر كيفيت تصوير • حداقل فضاي ذخيره سازي و پردازش منابع • ما نمي توانيم هر دو هدف را در بهترين شرايط داشته باشيم • بهترين فشرده سازي چگونه است؟

  8. Why we want to compress? To transmit an RGB 512X512, 24 bit image via modem 28.2 kbaud(kilobits/second)

  9. Huffman Coding lossless compression Run-length encoding Image Compression Predictive Coding lossy compression Transform Coding Image Compression Coding

  10. Lossless (بدون اتلاف( از روي ديتاهاي تصوير ذخيره شده مي توان دقيقا به تصوير اصلي رسيد تصویر ذخیره شده بدون از دست دادن كمترين داده ای، خود تصویر است. Compression rate: 2:1 (at most 3:1) )Lossyپراتلاف( از روي ديتاهاي تصوير ذخيره شده مي توان به تصويري نزديك به تصوير اصلي رسيد تصویر ذخیره شده خود تصویر اصلی نیست، بلکه شبیه آن است و اطلاعاتی را از دست داده است Compression rate: high compression دو كلاس اصلي فشرده سازي تصاوير

  11. General compression system model

  12. Compressed File Preprocessing Encoding Input Compressed File Decoding Postprocessing Output Compression System Model • Compression • Decompression 12

  13. Compression Ratio Ex Image 256X256 pixels, 256 level grayscale can be compressed file size 6554 byte. Original Image Size = 256X256(pixels) X 1(byte/pixel) = 65536 bytes

  14. (2) Bits per Pixel Ex Image 256X256 pixels, 256 level grayscale can be compressed file size 6554 byte. Original Image Size = 256X256(pixels) X 1(byte/pixel) = 65536 bytes Compressed file = 6554(bytes)X8(bits/pixel) = 52432 bits

  15. Key of compression • Reducing Data but Retaining Information Various amounts of data can be used to represent the same amount of information. It’s “Data redundancy” Relative data redundancy

  16. Entropy • Average information in an image. • Average number of bits per pixel

  17. Compression Standard Standard:

  18. Huffman Coding lossless compression Run-length encoding Image Compression Predictive Coding lossy compression Transform Coding Image Compression Coding

  19. Loseless Compression • No data are lost • Can recreated exactly original image • Often the achievable compression is mush less

  20. Huffman Coding ( VLC,Entropy) • Using Histogram probability • 5 Steps • Find the histogram probabilities • Order the input probabilities(smalllarge) • Addition the 2 smallest • Repeat step 2&3, until 2 probability are left • Backward along the tree assign 0 and 1

  21. 40 30 20 10 0 1 2 3 Huffman Coding(cont) • Step 1 Histogram Probability p0 = 20/100 = 0.2 p1 = 30/100 = 0.3 p2 = 10/100 = 0.1 p3 = 40/100 = 0.4 • Step 2 Order p3 0.4 p1 0.3 p0 0.2 p2 0.1 21

  22. Huffman Coding(cont) • Step 3,4 Add 2 smallest • Step 5 assign 0 and 1

  23. Huffman Coding(cont) • The original Image :average 2 bits/pixel • The Huffman Code:average

  24. Run Length Encoding • Run-length encoding (RLE) is a very simple form of data compression in which runs of data (that is, sequences in which the same data value occurs in many consecutive data elements) are stored as a single data value and count, rather than as the original run. This is most useful on data that contains many such runs: for example, relatively simple graphic images such as icons, line drawings, and animations.

  25. Run-Length Coding • Counting the number of adjacent pixels with the same gray-level value • Used primarily for binary image • Mostly use horizontal RLC

  26. Run-Length Coding(cont) horizontal Binary Image 8X8

  27. Example of RLE • Let us take a hypothetical single scan line, with B representing a black pixel and W representing white: WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWBWWWWWWWWWWWWWW If we apply the run-length encoding (RLE) data compression algorithm to the above hypothetical scan line, we get the following:12W1B12W3B24W1B14W

  28. Lossy Compression • Allow a loss in the actual image data • Can not recreated exactly original image • Commonly the achievable compression is mush more • Such as JPEG

  29. DM (Delta Modulation) DPCM (Differential Pulse Code Modulation) Predictive Coding Common Predictive Coding

  30. The principle of Predictive Coding • The system consists of an encoder and a decoder, each containing an identical predictor. As each successive pixel of the input image, is introduced to the encoder, the predictor generates the anticipated value of that pixel based on some number of past inputs. The output of the predictor is then rounded to the nearest integer.

  31. Predictive coding model I

  32. Predictive coding model II The predictor: The symbol encoder:generate the next element of the compressed data stream Decoder:perform the inverse of encoding The linearity predictor :

  33. Delta Modulation I Delta modulation (DM or Δ-modulation) is an analog-to-digital and digital-to-analog signal conversion technique used for transmission of voice information where quality is not of primary importance. DM is the simplest form of differential pulse-code modulation (DPCM) where the difference between successive samples is encoded into n-bit data streams. In delta modulation, the transmitted data is reduced to a 1-bit data stream.

  34. Differential Pulse Code Modulation • Differential Pulse Code Modulation (DPCM) compares two successive analog amplitude values, quantizes and encodes the difference, and transmits the differential value.

  35. Transform Coding I (DCT) • Transform coding is a type of data compression for "natural" data like audio signals or photographic images. • The transformation is typically lossy, resulting in a lower quality copy of the original input.

  36. Transform Coding II

  37. Transform Coding III A transform coding system

  38. BMP (Bitmap) - lossless • Use 3 bytes per pixel, one each for R, G, and B • Can represent up to 224 = 16.7 million colors • No entropy coding • File size in bytes = 3*length*height, which can be very large • Can use fewer than 8 bits per color, but you need to store the color palette • Performs well with ZIP, RAR, etc.

  39. GIF (Graphics Interchange Format) • Can use up to 256 colors from 24-bit RGB color space • If source image contains more than 256 colors, need to reprocess image to fewer colors • Suitable for simpler images such as logos and textual graphics, not so much for photographs

  40. JPEG (Joint Photographic Experts Group) - lossly • Most dominant image format today • Typical file size is about 10% of that of BMP (can vary depending on quality settings) • Unlike GIF, JPEG is suitable for photographs, not so much for logos and textual graphics

  41. Joint Picture Expert Group • The name "JPEG" stands for Joint Photographic Experts Group, the name of the committee that created the standard. The group was organized in 1986, issuing a standard in 1992, which was approved in 1994 as ISO 10918-1. JPEG is a commonly used method of compression for photographic images. The degree of compression can be adjusted, allowing a selectable tradeoff between storage size and image quality.

  42. JPEG2000 • JPEG 2000 is a wavelet-based image compression standard. It was created by the Joint Photographic Experts Group committee in the year 2000 with the intention of superseding their original discrete cosine transform-based JPEG standard (created about 1991).

  43. JPEG Encoding Steps • Preprocess image • Apply 2D forward DCT • Quantize DCT coefficients • Apply RLE, then entropy encoding

  44. JPEG Block Diagram 8x8 blocks SourceImage B G R DCT-based encoding Compressedimage data FDCT Quantizer EntropyEncoder Table Table

  45. Image Compression- JPEG • Using the DCT, the entries in Y will be organized based on the human visual system. • The most important values to our eyes will be placed in the upper left corner of the matrix. • The least important values will be mostly in the lower right corner of the matrix. Most Important Semi- Important Least Important

  46. JPEG 8 x 8 Pixels Image

  47. Image Compression • Gray-Scale Example: • Value Range 0 (black) --- 255 (white) 63 33 36 28 63 81 86 98 27 18 17 11 22 48 104 108 72 52 28 15 17 16 47 77 132 100 56 19 10 9 21 55 187 186 166 88 13 34 43 51 184 203 199 177 82 44 97 73 211 214 208 198 134 52 78 83 211 210 203 191 133 79 74 86

  48. Image Compression • 2D-DCT of matrix -304 210 104 -69 10 20 -12 7 -327 -260 67 70 -10 -15 21 8 93 -84 -66 16 24 -2 -5 9 89 33 -19 -20 -26 21 -3 0 -9 42 18 27 -7 -17 29 -7 -5 15 -10 17 32 -15 -4 7 10 3 -12 -1 2 3 -2 -3 12 30 0 -3 -3 -6 12 -1

  49. Image Compression -304 210 104 -69 10 20 -12 0 -327 -260 67 70 -10 -15 0 0 93 -84 -66 16 24 0 0 0 89 33 -19 -20 0 0 0 0 -9 42 18 0 0 0 0 0 -5 15 0 0 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 As you can see, we save a little over half the original memory.

  50. Reconstructing the Image • New Matrix and Compressed Image 55 41 27 39 56 69 92 106 35 22 7 16 35 59 88 101 65 49 21 5 6 28 62 73 130 114 75 28 -7 -1 33 46 180 175 148 95 33 16 45 59 200 206 203 165 92 55 71 82 205 207 214 193 121 70 75 83 214 205 209 196 129 75 78 85

More Related