20111ee114_1_CA6

20111ee114_1_CA6 - UCLA Electrical Engineering Department...

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

View Full Document Right Arrow Icon
UCLA, Electrical Engineering Department Winter Quarter, 2011 EE 114: Image Processing Due: March 7, 2011 Computer Assignment #6 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.
Image of page 1

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

View Full Document Right 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.
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.
Image of page 3

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern