Presentation is loading. Please wait.

Presentation is loading. Please wait.

2006134009 Ganbat OIP Lab 2006-12-05.

Similar presentations


Presentation on theme: "2006134009 Ganbat OIP Lab 2006-12-05."— Presentation transcript:

1 Ganbat OIP Lab

2 What is JPEG? Comparison Why ? Base line JPEG Structure of JPEG file Jpeg to BMP

3 Joint Photographic Expert Group(1987)
CCITT(International Telegraph and Telephone Consultative Committee)(1986) Fax 24 bits/pixel (16 million colors)

4 FORMAT NOTES BEST USED FOR ADVANTAGES DISADVANTAGES BMP Microsoft Windows native format. Logos and icons. Within Microsoft Office. Word, Excel, PowerPoint, Publisher, and Access can all view and share BMPs. Retains its quality even when the image is enlarged. Loads onto the screen quickly because it is not compressed. Cannot be used on the Web. Most non-Microsoft programs cannot view or save BMPs. JPG Used commonly on the Internet. Photographs. Scanned images which will not be edited in the future. Can be used on the Web. Small file sizes. Great for floppy disks or ing. Good for Photographs. Saving an image repeatedly in this format will result in loss of quality. GIF A cross-platform format. Both Windows and Macintosh can view a GIF. Line drawings, logos, and clip art. The standard file format for the Web. Option of transparent background. Limited to 256 colors which is not useful for photographs.

5 JPG=4 KB GIF=22 KB GIF=5 KB JPG [15%] JPG [60% ] 6 KB 4 KB

6 Compression rate Color Size GIF 4:1-10:1 JPEG 5:1-10:1 20:1-40:1
JPEG 24bit/pixel GIF 256 color Size

7 Compressed JPEG image Decoded Image Change the color model
Partition to 8x8 blocks DCT Quantization Zigzag Huffman Coding Compressed JPEG image Headers Data Decoded Image

8 The human eye is not as sensitive to high frequency chrominance (color) components as it is to luminance (intensity) components. The brightness and color information in an image are separated. Y component represents the color intensity of the image (equivalent to a black and white television signal). U and V represent the relative redness and blueness of the image. YUV (YCrCb) Color Space. Y = 0.299R G B U = R G + 0.5B + 128 V = 0.5R – G – B + 128 R = Y V G = Y – (U – 128) – (V – 128) B = Y (U – 128)

9 Due to the human vision is not sensitive to the chrominance domain, we can apply the subsampling filter to reduce the data size.

10 From spatial domain to frequency domain:

11 F'[u, v] = round ( F[u, v] / q[u, v] ).
Why? -- To reduce number of bits per sample Example: = 45 (6 bits). q[u, v] = 4 --> Truncate to 4 bits: 1011 = 11. The Luminance Quantization Table q(u, v)                 The Chrominance Quantization Table q(u, v)

12 Quantization error is the main source of the Lossy Compression.

13 Why? -- to group low frequency coefficients in top of vector.
Maps 8 x 8 to a 1 x 64 vector −26, −3, 0, −3, −2, −6, 2, −4, 1, −4, 1, 1, 5, 1, 2, −1, 1, −1, 2, 0, 0, 0, 0, 0, −1, −1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

14 Variable-length encoding technique Tree structure Binary tree
−26, −3, 0, −3, −2, −6, 2, −4, 1, −4, 1, 1, 5, 1, 2, −1, 1, −1, 2, 0, 0, 0, 0, 0, −1, −1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 Variable-length encoding technique Tree structure Binary tree −26, −3, 0, −3, −2, −6, 2, −4, 1, −4, 1, 1, 5, 1, 2, −1, 1, −1, 2, 0, 0, 0, 0, 0, −1, −1, EOB

15 A=1 C=01 B=001 D=0001 E=0000 ASCII code A= B= C= D= E= 17 11 1 7 1 4 1 1 E D B C A

16 HUFFMAN DECODING Huffman BCA 001011 1 E D B C A ASCII code
1 BCA ASCII code B C A

17

18 Start of Image SOI: (16 bits) Start of image is given by SOI(0xFFD8)

19 SOF(FFC0) Lf: (16 bit) Frame header length in bytes. P: (8 bit) Bits/Sample precision. Y: (16 bit) Number of lines in the source image (Height). X: (16 bit) Number of samples in one line(Width). Nf: (8 bit) Number of image component in the frame. C1: (8 bit) Component identifier label. H1: (4 bit) Horizontal sampling factor. V1: (4 bit) Vertical sampling factor. Tq1: (8 bit) Quantization table destination selector.

20

21 DQT (16bit) 0xFFDB Lq: (16bit) Quantization Table Length Pq: (4bit ) table element Qk’s precision. ‘0’=8bit, ‘1’=16bit . Tq: (4 bit) Quantization table destination identifier. Qk: (8 bit) Quantization table elements in zig-zag scan order.

22 Luminance Chrominance Define Quantization Table Length: 67
Table Index Precision Table length Q1 Q64 Luminance Chrominance Define Quantization Table Length: 67 Table Index: 0 Table Precision: 0 Table Values: A 0C 14 0D 0C 0B 0B 0C 0F 14 1D 1A 1F 1E 1D 1A 1C 1C E 2C 23 1C 1C C F 27 39 3D C 2E

23 DHT (16 bit) The define Human table symbol is 0xFFC4.
Lh: (16 bit) Human table definition length Tc: (4 bit) Table class, 0 = DC table, 1 = AC table Th: (4 bit) Human table destination identifier Li: (8 bit) Number of Human codes of length i. (1 <i< 16) Vi;j : (8bit) Value associated with each Human code.

24 Luminance DC Chrominance DC Luminance AC Chrominance AC Length: 31(001F) Table class: DC(0 ) Table Index: 0 Number of Human codes of length Value associated with each Human code A 0B

25 SOS (16 bit) Start scan segment code given by 0xFFDA.
Ls: (16 bit) Scan header length. Ns: (8 bit) Number of image components in this scan segment. Csj : (8 bit) scan component selector. Tdj : (4 bit) DC Human table destination selector. Taj : (4 bit) AC Human table destination selector. Ss: (8 bit) Start of spectral selection. Specify the first DCT coefficient in zig-zag order, to be coded. Se: (8 bit) End of spectral selection. Specify the last DCT coefficient in zig-zag order, to be coded. Ah: (4 bit) Set to zero in Sequential DCT. Al: (4 bit) Set to zero in Sequential DCT.

26 Length:. 12 Scan Count:. 3 Component ID:. 1 AC Entropy Table:
Length: 12  Scan Count: 3  Component ID: 1  AC Entropy Table: 0  DC Entropy Table: 0  Component ID: 2  AC Entropy Table: 1  DC Entropy Table: 1  Component ID: 3  AC Entropy Table: 1  DC Entropy Table: 1  Spectral Selection Start: 0  Spectral Selection End: 63

27 JPEG to BMP RB.JPG Image.bmp

28 Thank you Q&A


Download ppt "2006134009 Ganbat OIP Lab 2006-12-05."

Similar presentations


Ads by Google