Presentation is loading. Please wait.

Presentation is loading. Please wait.

Quantizing Compression

Similar presentations


Presentation on theme: "Quantizing Compression"— Presentation transcript:

1 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 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 16/05/62 Image Processing

2 Quantizing compression example
Consider the following image which is to be compressed to 2 bits/pixel, i.e. N = 4 histogram: 0 ** 1 ** 2 ********* 3 *********** 4 ********* 5 **** 6 ***** 7 ******** 8 ********* 9 ****** 65 pixels, down to 4 gray levels = in each range. The best range are: 13 1 ** 20 4 ********* 17 6 ***** 15 9 ****** 16/05/62 Image Processing

3 Example: Cont’d Fractal Compression
With median gray levels 2,3,6 and 8, the new image become: Note that this technique is similar to the histogram equalization technique. 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 16/05/62 Image Processing

4 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 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 16/05/62 Image Processing

5 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 Modified run length encoded: 6 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 16/05/62 Image Processing

6 Previous frame Latest frame m n p p Motion Prediction Search area
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. 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” Previous frame Latest frame m Search area n p p One of many blocks 16/05/62 Image Processing

7 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 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 2 1 Image standard .BMP, .PIC, .PCX, .PIG, .TIFF, .GIF, .JPG, etc. 16/05/62 Image Processing

8 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. 16/05/62 Image Processing


Download ppt "Quantizing Compression"

Similar presentations


Ads by Google