Project 5, Numbers 3-6 on 11.2
This project was mainly about comprssing an image by using either the JPEG or the 2D-DCT method using and choosing
a black and white image
(which is 2D) or using an RGB image (which is 3D, a color image) and seing how the picture would change after reconstructing
it. We also changed the variable p
which is the loss paramater to see what would happen with the image. As p gets larger, the more enries of the matrix are zeroed
by the quantization procedure,
the smaller are the data requirements for reprsenting the pixels, and the less faithfully the original image has been reconstructed.
 |
3:Obtain a grayscale image file of your choice, and use the imread command to
import into Matlab. Crop the resulting matrix so that each
dimension is a multiple
of 8. If necessary, converting a color RGB image to gray scale
can be accomplished by the standard formula (11.15).
3(A):Extract an 8x8 pixel block, for example, by using the Matlab command
xb=x(81:88,81:88). Display the block with the imagesc command.
code
3(B):Apply the 2D-DCT.
code
3(C):Quantize by using linear quantization with p = 1,2, and 4.
Print out each YQ.
code
3(D):Reconstruct the block by using the inverse 2D-DCT, and compare
with the original. Use Matlab commands colormap(gray) and
imagesc(X,[0 255]).
code
3(E):cary out(a)-(d) for all 8x8 blocks, and reconstitute the image in each case
code
4:Carry out the steps of Computer Problem 3, but quantize by the
JPEG-suggested matrix (11.25) with p=1.
4
5:Obtain a color image file of your choice. Carry out the steps
of Computer Problem 3 for colors R,G, and B separately
,using linear quantization, and recombine as a color image.
5
6:Obtain a color image, and transform the RGB values to luminance/color
difference coordinates. Carry out the steps of
Computer Problem 3 for Y,U, and V
separately by using JPEG quantization, and recombine as a color image.
6