The range of pixel intensity of the birds image is 15 to 255 and the range of pixel
intensity of the building image is 0 to 255.
In birds, there are both high and low
frequencies. The low frequencies occur where there are homogeneous color shades
without fine detail, for example the gray areas in the background or the beaks.
frequencies occur where there is a great deal of small detail, for example the very detailed
body feathers of the birds are likely to be lost in high scale factors of compression.
are also high and low frequencies in the building image.
There are low frequencies in
areas of solid color like the sky in the upper right, the sidewalks around the pools, and the
water in the pools. There are high frequencies mainly in the trees in the upper corner and
the railing on the building.
The Birds image is 512x768 pixels and has a total of 393,216 pixels. The
Building image is 512x512 pixels and has a total of 262,144 pixels.
(0,0) is the sum of all the pixel intensities in the image divided by the square root of the
total number of pixels.
This value represents the average pixel intensity of the block,
whereas the higher values of u and v somehow represent the variation from that averaged
4.2.4.b. The quantization values in the table are different because by making the values in
the upper left side smaller, we are establishing a lower threshold value which thus allows
us to preserve the lower frequency variation from the average pixel intensity.
ideally we would like to preserve both low and high frequency details, the lower
frequency ones are more important because they are more noticeable to the human eye.
When compressing data, there is a tradeoff between preserving details and saving space,
and this quantization table allows a good balance without sacrificing too much detail.
I took the 1-D DCT of the columns and then did it again for the transpose of the
result, which basically took the 1-D DCT of the rows and then transposed it again to
compare with the result of the 2-D DCT. I then did the same thing for the IDCT but I only
did it for Q = 1.
birdsdct1 = blkproc(birdsMatrix, [8 8], @dct);
birdsdct1 = blkproc(transpose(birdsdct1), [8 8], @dct);
birdsdct1 = transpose(birdsdct1);
buildingdct1 = blkproc(buildingMatrix, [8 8], @dct);
buildingdct1 = blkproc(transpose(buildingdct1), [8 8], @dct);
buildingdct1 = transpose(buildingdct1);
isequal(birdsdct, birdsdct1); % returns true
isequal(buildingdct, buildingdct1); % returns true
birds1idct = blkproc(birdsinv1, [8 8], @dct);
birds1idct = blkproc(transpose(birds1idct), [8 8], @dct);
birds1idct = transpose(birds1idct);
building1idct = blkproc(buildinginv1, [8 8], @dct);
building1idct = blkproc(transpose(building1dct), [8 8], @dct);