Thursday, September 22, 2011

XIII

Image compression is a vital tool for getting a compromise between quality and file size of our images. This activity uses Principal Component Analysis results to represent images as a superposition of weighted eigenvectors.

Figure 1. Original Image

Fig. 1 shows the original image that will be used for demonstrating image compression. To simplify things, I will use the grayscale version of the image to flatten the hypermatrix to a normal matrix.

Now, the method works by cutting the image to 10x10 px segments and converting it to a single column, thus we end up with a 100 element column for every 10x10 segment. We do this again for all segments so we end up with a nxp matrix where n is the number of segments and p is the number of elements per block. After that, we now use the pca() function to this.



Figure 2. Top-Bottom: Correlation Circle, Eigenvalue distribution and Eigenimages

The output of pca() has eigenvectors and principal components. By adjusting the amount of elements that is multiplied (eigenvectors and principal components), we also vary the compression of the method. Then this is reassembled back to the matrix size of our image.

Figure 3. Images a-i corresponds to original then 2, 5, 10, 15, 20, 25, 50, and 70 Eigenvector & Principal Components pairs  

Fig 3. shows the resulting quality of images from the compression technique that is used in this work. There is a total of 100 available eigenvectors that can be used so the original image is equal to a full 100 of those pairs used.

Figure 4. Graph of file size vs eigenvector-principal component pairs used

Fig 4. illustrates that the maximum slope is at the 0-20 eigenvector region. This is then the most optimal setting, file size wise, in which there is a sharp decrease.

Self-Assessment: 10/10 

No comments:

Post a Comment