Presentation is loading. Please wait.

Presentation is loading. Please wait.

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]

Similar presentations


Presentation on theme: "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]"— Presentation transcript:

1 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] - f[x,y] ) 2 SNR rms = 1/MN  g[x,y] 2 / e 2 rms subjective: how does it look to the eye application: how does it influence the final results for both: the attained compression ratio the time and memory needed for compression the time and memory needed for decompression

2 2007Theo Schouten2 Coding redundancy Average number of bits for code 2: 2.7 bits Compression ratio: C r = 3/2.7 = 1.11

3 2007Theo Schouten3 Interpixel redundancy Run Length Encoding (RLE): For whole binary image: C r = 2.63

4 2007Theo Schouten4 Psycho-visual redundancy

5 2007Theo Schouten5 General Model The "mapper" transforms the data to make it suitable for reducing the inter-pixel redundancies. This step is generally reversible and can reduce the amount of data, e.g. RLE, but not in transformations to the Fourier or Discrete Cosinus domains. The "quantizer" reduces the precision of the output of the mapper according to the determined reliability criteria. This especially reduces psycho-visual redundancies and is irreversible. The "symbol encoder" makes a static or variable length of code to represent the quantizer's output. It reduces the coding redundancy and is reversible.

6 2007Theo Schouten6 Information theory Questions such as: "what is the minimum amount of data needed to represent an image" will be answered in "information theory“. The generation of information is modeled as a statistical process that can be measured in the same manner as the intuition of information. An event E with a probability P(E) has: I(E) = - log r P(E) r-ary units of information P(E) = 1/2 then: I(E) = -log 2 1/2 = 1 bit information If a source generates symbols a i with a probability of P(a i ), then the average information per output is: H(z) = -  P(a i ) log r P(a i ) the insecurity of entropy of the source This is maximal when every symbol has an equal probability (1/N). It indicates the minimal average length (for r=2 in bits per symbol) needed to code the symbols.

7 2007Theo Schouten7 Huffman coding Under the condition that the symbols are coded one by one, an optimal code for the set of symbols and probabilities is generated. block code: every source symbol is mapped to a static order of code symbols instantaneous code: every code is decoded without reference to the previous symbols and is uniquely decodable

8 2007Theo Schouten8 Lempel Ziv Welch coding This translates variable length arrays of source symbols (with about the same probability) to a static (or predictable) code length. The method is adaptive: the table with symbol arrays is built up in one pass over the data set during both compression and decompression. Just as Huffman, this is a symbol encoder which can be used directly on the input or after a mapper and quantizer. It is used in GIF, TIFF, PDF and in Unix compress.

9 2007Theo Schouten9 Predictive coding 1D: p n = round (  i=1 m a i f n-i ), first f must be passed in another way 2D: p(x,y)= round (a 1 f[x,y-1] + a 2 f[x-1,y])

10 2007Theo Schouten10 Lossy predictive coding

11 2007Theo Schouten11 Delta modulation Delta Modulation is a simple but well known form of it: p n =  pi n with  < 1 (here, pi stands for the "predictor input") q n =  sign( e n ) and can be represented by a 1-bit value: -  or + 

12 2007Theo Schouten12 Differential Pulse Code modulation With DPCM, p n =  i=1 m  i pi n-i. Under the assumption that the quantization error (e n -q n ) is small, the optimal values of  i can be found by minimizing E{e n 2 } = E{ [f n -p n ] 2 }. These calculations are almost never done for each single image but rather for a few typical images or models of them. Original image

13 2007Theo Schouten13 4 prediction methods fig. 8.24 prediction 0.97 f(x,y-1) 0.5(f(x,y-1)+f(x-1,y)) 0.75 (f(x,y-1)+f(x-1,y)) -0.5f(x-1,y-1) 0.97 f(x,y-1) or 0.97 f(x-1,y)

14 2007Theo Schouten14 Lloyd-Max quantizer Instead of one level more levels can be used. They might be unequal, e.g. factor 2 beween them. With a Lloyd-Max quantizer the steps are optimized to achieve a minimum error. Adjusting the level  ( for each n, e.g. 16 pixels) with a restricted amount (for example 4) scale factors yields a substantial improvement of the error in the decoded image with a small reduction of the compression ratio.

15 2007Theo Schouten15 Adaption Using the 3 point prediction with the best of 4 quantizers per 16 bits error *8 for compression in bits/pixel: 1.0 1.125 2.0 2.125 3.0 3.125

16 2007Theo Schouten16 Transform coding JPEG makes use of 8*8 sub-images, DCT transformation, quantization of the 64 coeffients by dividing with a quantization matrix [e.g. fig. 8.37b ], a zigzag ordering [fig. 8.36d] of the matrix followed by a Huffman encoder, separately for the DC component. It uses a YUV color model, for the U and V component blocks of 2 by 2 pixels are combined into 1 pixel. The quantization matrixes can be scaled to yield several compression ratios. There are standard coding tables and quantization matrices, but the user can also indicate others to obtain better results for a certain image.

17 2007Theo Schouten17 examples 25% DCT 8x8 zoomed org 2 x 2 4x4 8x8 DCT + norm arr 34:1 (3.42) 67:1 (6.33)

18 2007Theo Schouten18 Wavelet transform Type wavelet Operaties per pixel Aantal 0’s (<1,5)

19 2007Theo Schouten19 4 wavelets

20 2007Theo Schouten20 Wavelet Compression ratio’s 34:1 (2.29) 67:1 (2.96) 108:1 (3.72) 167:1 (4.73)

21 2007Theo Schouten21 JPEG 2000 Uses wavelets (optionally on parts, tiles, of image) different for error-free and lossy compression gray and color images (upto 16 bit signed values) conversion to (about) YCbCr color space –Cb, Cr components peak around 0 complicated coding of wavelet values –organised in layers and finally packets –allowing more and more refined decoding (and storage) –and access to parts of the image

22 2007Theo Schouten22 Fractal compression GIF original Image (161x261 pixels, 8 bits/pixel), JPEG compression 15:1, JPEG compression 36:1, Fractal compression 36:1.

23 2007Theo Schouten23 MPEG (1,2,4) video I-frame (Intraframe or independent frame), JPEG like P-frame (predictive frame): difference between frame and prediction from I-frame, motion compensated B-frame (bidirectional): previous I or P and next P

24 2007Theo Schouten24 File formats The header contains information about: type: black and white, 8-bit gray level/color, 3-byte color size: number of rows, columns and bands, number of images compression method, possible parameters thereof data format: for example band or colors per pixel or separated origin of the image or conditions during acquisition manipulations previously done on the image A few well-known formats are: GIF for binary, gray level and 8-bits color images TIFF a multi-type format with many possibilities JFIF: JPEG coded, for color or gray images of natural origin MPEG for a series of images PBM, PGM, PPM: the PBMPLUS formats BMP: Microsoft's format


Download ppt "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]"

Similar presentations


Ads by Google