svd_gray, an Octave code which reads a file containing a grayscale image and uses the singular value decomposition (SVD) to compute and display a series of low rank approximations to the image.
Images can be thought of as numeric arrays (although you do have to convert them from the uint8 numeric format used for images to the double format used for numeric arrays.)
Therefore, an MxN image A has an SVD decomposition A = U*S*V'.
For any 1 <= R <= min(M,N), a low rank approximation to A is formed by
Ar = U(1:m,1:r) * S(1:r,1:r) * V(1:n,1:r)';Properties of the SVD guarantee that Ar is the best possible rank R approximation to the data in A. This means it is often possible to get a good approximation to A using much less data.
The computer code and data files described and made available on this web page are distributed under the MIT license
svd_gray is available in a MATLAB version and an Octave version.
svd_basis, an Octave code which applies the singular value decomposition (SVD) to a collection of data vectors, extracting dominant modes;
svd_faces, an Octave code which applies singular value decomposition (SVD) analysis to a set of images.
svd_fingerprint, an Octave code which reads a file containing a fingerprint image and uses the singular value decomposition (SVD) to compute and display a series of low rank approximations to the image.
svd_lls, an Octave code which uses the singular value decomposition (SVD) to construct and plot the best affine and linear relationships in the sense of least square, between two vectors of data.
svd_powers, an Octave code which applies singular value decomposition (SVD) analysis to powers x(i)^(j-1).
svd_snowfall, an Octave code which reads a file containing historical snowfall data and analyzes the data with the singular value decomposition (SVD).
svd_sphere, an Octave code which analyzes a linear map of the unit sphere caused by an arbitrary 3x3 matrix A, using the singular value decomposition (SVD).
svd_test, an Octave code which demonstrates the singular value decomposition (SVD) for a simple example.
svd_truncated_test, an Octave code which demonstrates the computation of the reduced or truncated singular value decomposition (SVD) that is useful for cases when one dimension of the matrix is much smaller than the other.