Loading in 3 Seconds
240-373 Image Processing. Montri Karnjanadecha [email protected] http://fivedots.coe.psu.ac.th/~montri. Chapter 12. Image Compression. Image Compression. Purposes To minimize storage space To maximize transfer speed To minimize hardware costs Requirements
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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
240-373 Image Processing
Montri Karnjanadecha
http://fivedots.coe.psu.ac.th/~montri
240-373: Chapter 12: Image Compression
Chapter 12
Image Compression
240-373: Chapter 12: Image Compression
240-373: Chapter 12: Image Compression
240-373: Chapter 12: Image Compression
four frequently used colors
000
001
010
011
240-373: Chapter 12: Image Compression
next most frequently used colors
1000
1001
1010
1011
the rest
11000
11001
11010
11011
11100
11101
11110
11111
240-373: Chapter 12: Image Compression
This means that the length (for an 640x480 image =150K) is reduced to
[(0.6*3)+(0.3*4)+(0.1*5)] * 640 * 480 = 131.25K
240-373: Chapter 12: Image Compression
240-373: Chapter 12: Image Compression
Technique 1: The Huffman Code
USE: To reduce the space that an image uses on disk or in transit
OPERATION:
240-373: Chapter 12: Image Compression
OPERATION: (cont’d)
240-373: Chapter 12: Image Compression
0 1000005 01
1 100016 000
2 1017 1001
3 0018 100001
5 11
Storage has improved from 19000*3 bits (57000) to 51910 bits.
240-373: Chapter 12: Image Compression
240-373: Chapter 12: Image Compression
Technique 2: Run length encoding
USE: To reduce the space required by an image
OPERATION:
240-373: Chapter 12: Image Compression
Example: image
giving a sequence: 1 2 1 1 1 1 1 3 4 4 4 4 1 1 3 3 3 5 1 1 1 1 3 3
(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: 1 1 2 1 1 5 3 1 4 4 1 2 3 3 5 1 1 4 3 2
(20 values)
240-373: Chapter 12: Image Compression
240-373: Chapter 12: Image Compression
240-373: Chapter 12: Image Compression
240-373: Chapter 12: Image Compression
240-373: Chapter 12: Image Compression
Technique 3: Compression using the frequency domain
USE: To reduce space required for an image
OPERATION:
240-373: Chapter 12: Image Compression
OPERATION: (cont’d)
240-373: Chapter 12: Image Compression
Technique 4: Quantizing compression
USE: To reduce storage space by limiting number of colors or gray levels
240-373: Chapter 12: Image Compression
OPERATION:
240-373: Chapter 12: Image Compression
which is to be compressed to 2 bits/pixel, i.e. N = 4
240-373: Chapter 12: Image Compression
histogram:
0**
1**
2*********
3***********
4*********
5****
6*****
7********
8*********
9******
240-373: Chapter 12: Image Compression
65 pixels, down to 4 gray levels = 16.24 in each range. The best range are:
0**
131**
2*********
3***********
204*********
5****
176*****
7********
8*********
159******
240-373: Chapter 12: Image 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.
240-373: Chapter 12: Image Compression
240-373: Chapter 12: Image Compression
240-373: Chapter 12: Image Compression
3 bits/pixel x 48 pixels = 144 bits/image
240-373: Chapter 12: Image Compression
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
240-373: Chapter 12: Image Compression
Modified run length encoded:
18 2 2 2 5 4 3 2 5 4 3 2 6 10
6 bits/0 count, 4 bits/difference = 66 bits
240-373: Chapter 12: Image Compression
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.
240-373: Chapter 12: Image Compression
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”
240-373: Chapter 12: Image Compression
Previous frame
Latest frame
m
Search area
n
p
p
One of many blocks
240-373: Chapter 12: Image Compression
240-373: Chapter 12: Image Compression
2
1
2
1 2 1
240-373: Chapter 12: Image Compression
2
1
2
1 2 1
240-373: Chapter 12: Image Compression
240-373: Chapter 12: Image Compression
240-373: Chapter 12: Image Compression