A New Technique for Image Compression Using PCA - International

0 downloads 0 Views 2MB Size Report
method is introduced to compress one coloured image using PCA technique. 1. Introduction. PCA method for images is called HOTELLING or KL transform.
ISSN:2249-5789 Mohammad Mofarreh Bonab et al, International Journal of Computer Science & Communication Networks,Vol 2(1), 111-116

A New Technique for Image Compression Using PCA Mohammad Mofarreh-Bonab1, Mostafa Mofarreh-Bonab2 1. University of Bonab, East Azerbaijan, Iran 2. Shahid Beheshti University, Tehran, Iran 1. [email protected] 2. [email protected]

Abstract PCA is a statistic approach which widely used in many fields of study. Recently, this technique is used in image processing as a powerful tool especially in face recognition and face database compression. By working on this method in the recently researches, this method has been improved and kernel PCA, 2D-PCA and some other methods has been introduced. Generally the methods have been used in face recognition and processing a group of images which belongs to similar objects, such as face image databases. In this paper a new method is introduced to compress one coloured image using PCA technique.

1. Introduction PCA method for images is called HOTELLING or KL transform. Common KL transform focuses on similarities between different images in the database. In this paper, we will show that by applying some changes in KL transform, we can use this technique for compressing just one coloured image. Keywords: Image compression, HOTELLING, KL transform, database compression, PCA.

matrix that its elements are the intensity values of images. F1 X= โ‹ฎ , Fi = xi1 , xi2 , โ€ฆ , xiQ 1ร—Q Eq. 1 FM Mร—Q

The term Fi indicates the ๐‘– ๐‘กโ„Ž image that converted to a vector. Now, in order to applying PCA method, we make some definitions; The mean vector, Mx : that contains mean values of each image and expressed as:

1

Mx = Q

Q k=1 x1k Q k=1 x2k

. .

Q k=1 xMk Mร—1

m1 m2 . = . . mM

Eq. 2

Mx matrix, that contains the values of Mx for M times and expressed as: Mx = [Mx , Mx , โ€ฆ , Mx ]Mร—Q

Eq. 3

Covariance matrix Cx for M row of X matrix[1]:

2. PCA method PCA is a statistical tool which has many applications especially in database processing [1],[2]. Suppose there are M square N ร— P monochrome images. This obligation doesnโ€™t make any restriction for colored images, since colored images can be supposed as 3 monochrome images that are red, green, and blue color components for each individual pixel. N ร— P monochrome images are equivalent to N ร— P matrixes that the values of the components of the matrixes are the light intensities of the corresponding pixel's location. Suppose N ร— P = Q. By reshaping the matrixes, the image can be expressed as 1 ร— Q vectors Fi in equation 1. In proposed approach, images are transferred to another field. All images are put in X

Cx = ci,j

Mร—M 1

That: ci,j = Qโˆ’1 ร—

Q k=1

(xik โˆ’ Mx (i, 1)) ร—

(xjk โˆ’ Mx (j, 1))

Eq. 4

For applying KL transform, M eigenvectors vi , i = 1,2, โ€ฆ , M and M eigenvalues ฮปi , i = 1,2, โ€ฆ , M can be found, which satisfy equation 5: โˆ€i โˆˆ 1,2, โ€ฆ , M v1 (i) v2 (i) vi = โ‹ฎ vM (i)

Cx . vi = ฮปi . vi Eq. 5

111

ISSN:2249-5789 Mohammad Mofarreh Bonab et al, International Journal of Computer Science & Communication Networks,Vol 2(1), 111-116

If we put all eigenvectors in a matrix, the modal matrix โ€ฮ›โ€ will be obtained that its columns are the eigenvectors of Cx as shown below[2]: ฮ› = [v1 , v2 , โ€ฆ , vM ]

mem 1

Eq. 7

Eq. 8

โŸน V = [v1 , v2 , โ€ฆ , vM ]T Mร—M

Eq. 9

So: vM (1) โ‹ฎ vM (M)

๏‚ท

mem1 is the required memory to save Vk T , Yk , Mx . mem2 is the required memory to save X.

โŸน Memory ratio =

kM +kQ +M MQ

Eq. 19

Eq.10 Mร—M

Y = V. X โˆ’ Mx

Eq. 11

Now we can obtain X with the inverse process of equation 11: Y = V. X โˆ’ Mx โ‡’ V โˆ’1 . Y = X โˆ’ Mx โ‡’ X = V โˆ’1 . Y + Mx

Eq. 12

According to equation 8 we can write: V โˆ’1 = (ฮ›T )โˆ’1 = (ฮ›โˆ’1 )โˆ’1 = ฮ› = V T

Eq. 13

Now, ๐‘‹ matrix can be retrieved using equation 14: X = V T . Y + Mx

Eq. 14

In order to compress ๐‘‹ some definitions are made as below[3]: Mร—k

๏‚ท

Eq. 18

3. PCA method for compressing one image

Applying KL transform makes Y matrix:

T

๐‘Ÿ๐‘’๐‘ž๐‘ข๐‘–๐‘Ÿ๐‘’๐‘‘ ๐‘š๐‘’๐‘š๐‘œ๐‘Ÿ๐‘ฆ ๐‘ก๐‘œ ๐‘ ๐‘Ž๐‘ฃ๐‘’ ๐‘‹ ๐‘Ÿ๐‘’๐‘ž๐‘ข๐‘–๐‘Ÿ๐‘’๐‘‘ ๐‘š๐‘’๐‘š๐‘œ๐‘Ÿ๐‘ฆ ๐‘ก๐‘œ ๐‘ ๐‘Ž๐‘ฃ๐‘’ ๐‘‹

โ‰œ mem 2

ฮ› is a unitary matrix. So: โˆ’1 ฮ› = ฮ›T โŸน V = ฮ›T

Vk โ‰œ v1 , v2 , โ€ฆ , vk

๐‘€๐‘’๐‘š๐‘œ๐‘Ÿ๐‘ฆ ๐‘Ÿ๐‘Ž๐‘ก๐‘–๐‘œ =

Eq. 6

Now we can define V matrix: V = ฮ›โˆ’1

v1 (1) โ‹ฏ โ‹ฎ โ‹ฑ V= v1 (M) โ‹ฏ

equation 18 shows:

, k โˆˆ {1,2, โ€ฆ , M}

Eq. 15

Commonly, PCA method is applied to group of images as we done for M images. Now we shall apply PCA to an image, so the image -which is generally a coloured image-, is divided to some rows. This division is based on variations in the image. Each row or section acts as an input for ordinary PCA and if the rows have high similarity, the HOTELLING transform will show better results. We should find an algorithm to sense the variations in rows and divide the image in rows that have the maximum variation in respect of the next row. After applying some statistical parameters such as variance, covariance, correlation and etc. the best results reached when covariance values between the rows of image matrix have been used. Suppose a MbyN image, since covariance of two random variables, such as a and b is defined as: cov a, b = E a โˆ’ ฮผa b โˆ’ ฮผb Eq. 20 in equation 20: ๏‚ท ฮผa = E a ๏‚ท ฮผb = E[b] Now, we define a CRITERION as below: similarity i โ‰œ cov iโ€ฒth row, i + 1 โ€ฒth row

Yk โ‰œ

Y 1,1 โ‹ฏ โ‹ฎ โ‹ฑ Y(k, 1) โ‹ฏ

X โ‰œ Vk T . Yk + Mx

Y(1, Q) โ‹ฎ Y(k, Q)

Eq.16 kร—Q

Eq. 17

Considering the first k Eigen vectors from the M Eigen vectors (K