Presentation is loading. Please wait.

Presentation is loading. Please wait.

Image Processing, Leture #16

Similar presentations


Presentation on theme: "Image Processing, Leture #16"— Presentation transcript:

1 240-373 Image Processing, Leture #16
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 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 08/12/61 Image Processing, Leture #16

2 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: frequently used four colors 000 001 010 011 next most frequently used colors 1000 1001 1010 1011 the rest 11000 11001 11010 11011 11100 11101 11110 11111 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 08/12/61 Image Processing, Leture #16

3 240-373 Image Processing, Leture #16
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 P0, P1, .. PM-1 , The number of bits required to code them is at least 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 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 08/12/61 Image Processing, Leture #16

4 Huffman coding example
Example: For a nine-color system, we obtain the following coding: 5 11 Storage has improved from 19000*3 bits = bits to bits. 08/12/61 Image Processing, Leture #16

5 240-373 Image Processing, Leture #16
08/12/61 Image Processing, Leture #16

6 240-373 Image Processing, Leture #16
Spatial Compression 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 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) 08/12/61 Image Processing, Leture #16

7 Spatial Compression: Cont’d
Notes Huffman coding can be performed after Run length encoding It might be possible to implement the Huffman code only on the run lengths 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 08/12/61 Image Processing, Leture #16

8 240-373 Image Processing, Leture #16
08/12/61 Image Processing, Leture #16

9 240-373 Image Processing, Leture #16
08/12/61 Image Processing, Leture #16

10 240-373 Image Processing, Leture #16
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 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 08/12/61 Image Processing, Leture #16


Download ppt "Image Processing, Leture #16"

Similar presentations


Ads by Google