CS4770 Pattern Recognition Monsoon 2006 Assignment 2 Karhunen-Loeve Transform using PCA Due date: Sep 19, 2006 1. Read about the Karhunen-Loeve Transform (KLT) which is the most optimal compression scheme for different data such as images. KLT is a data-dependent compression scheme unlike JPEG and other schemes and hence is not very popular though it gives the best results. 2. KLT is based on eigendecomposition of the image or data. For this assignment, you have to compress images using KLT and study its performance. 3. For KLT-based compression, treat the entire image as an N x N array of numbers. (Convert all images to gray-level and deal with the intensities. Ignore colour!) Treat the array like a matrix and compute its eigenvalues and eigenvectors. Arrange the eigenvalues in decreasing order. 4. Select top K eigenvalues and corresponding eigenvectors to represent the image. Represent the image using its projection to the reduced eigenmatrix (of size K x N). 5. Recover the full image by undoing the projection using K eigenvectors. There will be a loss which may or may not be visible. You can compute the mean-squared error by summing the squares of the pixel-wise differences and dividing by (N*N). [Those who want to can also compute the PSNR or the peak signal to noise ratio.] 6. Repeat 4 and 5 for different values of K. If K is low, high compression is obtained at the expense of quality and vice versa. Repeat this for the noiseless and noisy versions of the images given to you. 7. Compress the given image with JPEG controlling the compression ratio using the Quality Factor of JPEG. (You can use the "convert" command from the ImageMagick library to do this and control the quality factor.) 8. Plot the error vs compression ratio curve for both JPEG and the KLT compressed images and discuss the results. The TA will have lots of supporting material on the webpage. Don't try to write the eigenanalysis function yourself. Use Octave or Matlab for it. If you need any help with Octave or Matlab in which the project can be done, contact him. Each of you have to submit a report (in HTML perferrably) that explains the KLT=based compression, give results on different images as well as give the plots etc. It should be like a report that analyzes the issue critically. More credits to those who do more work!