Вы находитесь на странице: 1из 21

IMAGE COMPRESSION

USING
LINEAR ALGEBRA

Why image compression?


Suppose we have an 9 megapixel gray-scale image,
which is 3000 3000pixels (a 3000 3000 matrix).
For each pixel, we have some level of black and white,
given by some integer between 0 and 255.
Each of these integers(and hence each pixel) requires
approximately 1 byte to store, resulting in an
approximately 8.6 Mb image.
A colour image usually has three components, a red, a
green, and a blue (RGB).
Each of these is represented by a matrix, so storing
colour images takes three times the space (25.8 Mb)

Digital images are very large in size and hence occupy


larger storage space.
Due to their larger size, they take larger bandwidth and
more time for upload or download through the Internet.
This makes it inconvenient for storage as well as file
sharing.
To combat with this problem, the images are compressed in size
with special techniques
This compression not only helps in saving storage space but also
enables easy sharing of files.
Image compression applications reduce the size of an image file
without causing major degradation to the quality of the image.

Maximum quality

File size: 35.6KB

Medium quality
File size: 20.2KB

Using the averaging and differencing


process
64
9

17

40

A
32

41
49

2 3 61 60 6 7 57
55 54 12 13 51 50 16
47 49 20 21 43 42 24

26 27 37 36 30 31 33
34 35 29 28 38 39 25

23 22 44 45 19 18 48
15 14 52 53 11 10 56

58 59 5 4 62 63 1

Averaging and Differencing


8X8 matrix, process involve three steps (2=8)
Step 1
[3 5 4 8 13 7 5 3]
Averaging

Differencing

[4 6 10 4 -1 -2 3 1]

ex. (3 + 5)/2 = 4
3 - 4 = -1

detail coefficient

Averaging and Differencing


Step 2
[4 6 10 4 -1 -2 3 1]
Averaging

Differencing

[5 7 -1 3 -1 -2 3 1]
detail coefficient

ex. (4 + 6)/2 = 5
4 - 5 = -1
9

Averaging and Differencing


Step 3
[5 7 -1 3 -1 -2 3 1]
Averaging
Differencing

[6 -1 -1 3 -1 -2 3 1]
detail coefficient
row average

ex. (5 + 7)/2 = 6
5 - 6 = -1
10

Using the averaging and differencing process


64
9

17

40

A
32

41
49

2 3 61 60 6 7 57
55 54 12 13 51 50 16
47 49 20 21 43 42 24

26 27 37 36 30 31 33
34 35 29 28 38 39 25

23 22 44 45 19 18 48
15 14 52 53 11 10 56

58 59 5 4 62 63 1

11

Image Representation
first row
[64

61 60

7 57]

Step1 [33 32
33 32 31 -29 27 -25]
Step2 [32.5 32.5 0.5 0.5 31 -29 27 25]
Step3 [32.5 0 0.5 0.5 31 -29 27 -25]

12

Image Representation
rows the results
32.5
32.5

32.5

32.5
32.5

32.5
32.5

32.5
row average

0 0.5
0.5
31 29 27 25
0 0.5 0.5 23 21 19 17
0 0.5 0.5 15 13 11
9

0 0.5
0.5
7
5
3
1
0 0.5
0.5
1
3
5
7

0 0.5 0.5
9
11 13 15
0 0.5 0.5 17 19 21 23

0 0.5
0.5 25 27 29 31
detail coefficients
13

Image Representation
columns the results
choose some number () and set equal to
zero
05
32.5 32.
0 0

0
0 00

0
0

0
0 00

00
0 0
0

0 00

0 0 00
0 0 00
0 0 00
0
00.5
0.5
00.5
0.5

0
0

0
0

0
0

04
40
04
40
0 00
25 23
00.50
7
0 .50 11 9
7
9
00.50 05
0 .50 21 23 25
40
40
27

04

04
21

50
11

27
0
0

=5

Image Representation
apply the inverse of the averaging the
differencing operations
59.5
5.5

21.5

43.5
32.5

32.5
53.5

11.5

5.5 7.5 57.5 55.5 9.5 11.5 53.5


59.5 57.5 7.5 9.5 55.5 53.5 11.5
43.5 41.5 23.5 25.5 39.5 32.5 32.5

21.5 23.5 41.5 39.5 25.5 32.5 32.5


32.5 39.5 25.5 23.5 41.5 21.5 43.5

32.5 25.5 39.5 41.5 23.5 43.5 21.5


11.5 9.5 55.5 57.5 7.5 5.5 59.5

53.5 55.5 9.5 7.5 57.5 59.5 5.5


15

Using Linear Algebra


Step1

A1

1
2
1

1
2
1

1
2
1
2
0
0

1
2
1
2

Average

1
2
1
2

1
2
1

0
0
1
2
1

1
2
1

2

Difference
16

Using Linear Algebra


Step3

Step2

A2

1
2
1

0
0

0
0
1
2
1
2
0

1
2
1

1
2
1

2
0

0
0

0
0

A3

1
2
1

2
0
0

0
0

1
2
1

2
0

0
0

0
0

17

Using Linear Algebra


W = A1A2A3A

T W T AW
T 1

(W )

AW

1
8
1

8
1
8
1

8
1
8
1

8
1
8
1

1
8
1
8
1
8
1
8
1

8
1

8
1

8
1

1
4
1
4
1

4
1

4
0
0
0
0

0
0

1
2
1

1
4
1
4
1

4
1

1
2
1

0
0
1
2
1

1
2
1

2

A : Original Matrix
W : Transforming
Matrix
T : Compressed Matrix
18

Image Representation

Original Image

Decompressed Image

19

signal x

coefficients
C

C(many
zeros)

x = C1W1 +...........+ C8W8.

HAAR WAVELET BASIS

THANK YOU

N.VINAY(10BEC0037)
K.SAI ADARSH BABU(10BEC0086)
CH.PAVAN KUMAR(10BEC0246)
K.SAI KIRAN(10BEC0258)
R.SANTHOSH KUMAR(10BEC0390)

Вам также может понравиться