Question: Exercise 5. If A IEV and > 0 is the smallest singular value greater than zero then the matrix A has rank r and can
Exercise 5. If A IEV" and > 0 is the smallest singular value greater than zero then the matrix A has rank r and can be written as which is a decomposition of the matrix A as a sum of rank one matrices u, Moreover, the best 2-norm approximation of rank k (0SkS r) is given by rank(B)-k (a) Use MATLAB command load garlin to load the 480 x 640 pixel image. The image will be stored as 480 640 matrix in variable x and the image color map in variable map. You can display the original image using the MATLAB command image, i.e, load garlin.mat; colormapap); image (x); (b) Use the the MATLAB command svd to calculate a singular value decomposition of matrix X, i.e., X = U VT, what is the rank of rnatrix X? Plot the singular values of matrix X, ie, on z-axis the index i of the singular value and on y-axis the value of the i-th singular value -Use logarithmic scales if necessary (c) Write a MATLAB function bestApprox.m function [A_k, approx error,signa] bestApprox (A,k) which for a given matrix A and value k will return the best rank k approximation A approximation error lA-Aklla and the value k+1. of matrix A, the (d) Write a script imageCompression.m in which you will use function bestApproximation.m to get a compressed image Xk of the original image stored in matrix X For each value k 5, 10, 20, 40, 60 construct and display the compressed image Xk, compute the approximation error IA-Akla kth ++1/ok and the compression ratio (m + n)-k/(m-n), ie, 10 20 40 60 What can you say about the values llA-Aklla and +1? what is the meaning of the compression ratio and why it is important in practice? Why we can call Xx a compressed image? For which k is the compressed image Xs a good approximation of the original image X
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
