You are on page 1of 4

Speech & Image Communications

Assignment 2
1. Comparing quality versus compression

The theoretical size of the non-compressed
image can be calculated by n * m * bit depth /
8. The picture in figure 1 uses RGB color space
with 8 bits per channel which gives a total of 24
bit.
512 * 512 * 24 / 8 = 768,432 bytes or 768KB.






Compression ratio is given by filesize of uncompressed image over filesize of
compressed image. Below is a table of the compression ratio based on the
uncompressed image file size of 768KB.
JPG
Quality
filesize
(KB)
Compressi
on Ratio
0 6 128
5 7 109.7
10 9 85.3
15 11 69.8
20 13 59.1
25 15 51.2
30 17 45.2
35 20 38.4
40 21 36.6
45 23 33.4
50 25 30.8
55 27 28.4
60 30 25.6
65 33 23.3
70 37 20.8
75 42 18.3
80 50 15.4
85 59 13.0
90 77 9.98
95 112 6.86
100 224 3.43

Graph plot of SAD (Sum of Absolute Difference) quality metric against compression
ratio












A positive correlation between compression ratio and SAD can be observed. As
compression ratio increases the SAD also increases however the increase is not linear.
The region between 15 and 70 compression ratio has is fairly linear. Beyond
compression ratios of 70 the SAD increases much more rapidly. We predict that the
image quality will deteriorate exponentially when compression ratio is past 70.
The image on the far left has a
compression ratio of 38.4 while
the picture to the right has a
compression ratio of 3.4. They
are very similar as we
predicted, as they look fairly
similar to the eye until zoomed
or evaluated in detail.


When compression ratio goes above 45, the picture quality starts to deteriorate very
quickly as the compression goes up. Picture below on the left has a compression ratio of
45 while the picture below on the right has a compression ratio of 85. The aliasing of
the image becomes increasing apparent and more colour banding can be seen.
We predicted that the image
quality would start to
deteriorate when compression
ratio is above 70. However in
our simulation, the picture
quality deteriorated at a
compression ratio of 45. The
SAD metric is a way to
measure picture quality
objectively however it is not a
means of definitive measure of picture quality that is relevant to our sight. Our
subjective test shows that the distortion in the image becomes apparent when the SAD
0
2000000
4000000
6000000
8000000
10000000
12000000
14000000
0 50 100 150
S
A
D

Q
u
a
l
i
t
y

M
e
t
r
i
c

Compression Ratio
Series1
metric was above 4106705. There is metric is only relevant to this particular picture as
different pictures will most likely have a different value before we perceive the image
as distorted.

2. Convolution filters for image improvement



This part of the experiment uses matlab to apply a 3x3 matrix to the distorted image in
an attempt to recover the original image. In these two examples the distorted picture has
noise added to it so we applied an averaging filter to smooth out the noise. The matrix
of [ 1/9, 1/9, 1/9; 1/9, 1/9, 1/9; 1/9, 1/9, 1/9] was used. It is apparent on the left side that
the image is noticeably smoother with less noise. The SAD between the original and the
first distorted image is 14972799 while the lowpass filter increased the SAD but
appears to have less distortion compared to the original.
In the lower set, the SAD between the original and distorted was 52113568. After
applying the filter the SAD was reduced to 30638080. Also appears to have less noise
and distortion than the unfiltered image.

The second part of the experiment is to de-blur an image. We tried using the filter
medfilt2 and also a high pass filter using filter_1 = [0,-1/4,0;-1/4,2,-1/4;0,-
1/4,0];
We found that there was a small noticeable improvement to the sharpness of the image
but at the same time the SAD values went up from 9062002 to 9115801 & 9195435
respectively. The SAD increase means it is starting to deviate away from the original
image so more information is loss and is becoming increasingly distorted.

Conclusions
We found that by applying various filters, the image can appear to be subjectively better
even though the SAD metric suggest otherwise. This means the SAD metric is not a
reliable means to determine quality for humans. We may not be able to perceive all
subtle differences that a computer can measure. We found the best way to improve the
quality of the image was to compare the images visually.
References
Image processing in Matlab, Todd Wittman (2008)
http://www.math.ucla.edu/~wittman/reu2008/matlabIP.pdf

You might also like