20091ee114_1_CA7

20091ee114_1_CA7 - UCLA, Electrical Engineering Department...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
UCLA, Electrical Engineering Department Winter Quarter, 2009 EE 114, Part 2: Image Processing Assigned: February 25, 2009 Computer Assignment #7 Due: March 11, 2009 1. Introduction In this assignment you will implement an image compression algorithm. 2. Preliminary The following tools in Matlab will be useful: Discrete Cosine Transform of a 2-D array ( dct2 ) The Discrete Cosine Transform of a 2-D array can be performed by dct2 . coeff = dct2(array); Inverse Discrete Cosine Transform of a 2-D array ( idct2 ) The Inverse Discrete Cosine Transform of a 2-D array can be performed by idct2 . iarray = idct2(coeff); 3. Image compression format – gpj file In this assignment you will implement an image compression algorithm and associated format ( gpj file) that is designed specifically for this class. The gpj compression is similar to the methods used in the JPEG standard, though it has some simplifications that make it more practical for use as an EE114D computer assignment. Thus, gpj is not a true image compression standard like JPEG; it is used only for this computer assignment. a. gpj file syntax A gpj file has the syntax format shown in Figure 1.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Each of the blocks represents an 8-pixel by 8-pixel “block” of the image. The blocks are ordered from left to right within each row, and from top to bottom. b. gpj file header syntax The syntax of the file header is shown in Figure 2.
Background image of page 2
The fields in the gpj file have the following meanings and values: File Tag: 7-byte ASCII string, always “GPJFile”. Option: 3-byte ASCII string denotes the version and options of this file. Option is always “000” for this version. Quality: 3-byte ASCII string denotes the quality factor used in coding the blocks. (See below on quantization). Width: 7-byte ASCII string denotes the horizontal dimension of the image. Height: 7-byte ASCII string denotes the vertical dimension of the image. M: 1-byte marker with value 0x00 c. Blocks Each block in Figure 1 represents the data from an 8-pixel by 8-pixel block in the image. Each image block is encoded through the following steps: Step 1. Subtract 128 from each element of the block, so the values range between [-128, 127]. Note: The original picture is a 256-level grayscale image with values between 0 and 255. Step 2. Take the 2D DCT of the 8x8 block. This gives a DCT coefficient array of size 8x8. Step 3. The DCT coefficients are quantized with the following quantizer where i, j are the row and column numbers of the element in the quantizer matrix Q, and Quality is a parameter selectable by the user before encoding. i, j should range from 0 to 7 (not 1 to 8). This parameter is sent to the decoder via the Quality field in the file header. Figure 3 shows an example quantization table (also called a quantization matrix)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/10/2010 for the course EE EE114 taught by Professor Vanderschaar during the Spring '09 term at UCLA.

Page1 / 10

20091ee114_1_CA7 - UCLA, Electrical Engineering Department...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online