1 / 2100%
MAT 133 Project Two SVD and Image Compression Overview
Think of a matrix whose elements are "one-byte" integers. Each value in the matrix is
represented by an integer in the range of 0 to 255 since one byte represents 8 bits of information.
The complete matrix needs bytes of storage space since each element in the matrix needs one
byte to be stored. An orthogonal decomposition of a matrix can be computed using the singular
value decomposition (SVD). Given the matrix, the SVD may be used to decompose the matrix
as, where,, and are rectangular diagonal matrices whose diagonals, respectively, contain the
singular values of. This representation resembles the eigenvalue diagonalization, also known as
the eigendecomposition, that was previously covered in the course. Nevertheless, SVD and
eigendecomposition vary primarily in that SVD may be applied to rectangular matrices whereas
eigendecomposition is only applicable to square matrices. A low-rank approximation of the
original matrix can be created using SVD. The matrix defined as: can be used to approximate if
just the first singular values are used.
where is a matrix that contains the first rows and columns of, is a matrix that contains the first
columns of, and is a matrix that contains the first columns of. Be aware that this approximation
effectively discards all the data contained in the dimensions and higher. We must be cautious to
ensure that the approximation has the proper data format after computing the image
approximation. An unsigned 8-bit integer data type must be used for all of the matrix's values.
We will round the elements in the approximation to the nearest integer and then convert the data
type to an integer because it is likely that the approximation now contains real-valued values.
This enables the image to be shown correctly in software applications like MATLAB. Hence,
following computation, we'll usually carry out an order similar to this:
There are a total number of entries in the matrix that need to be saved. Just the diagonal elements
need to be saved because it is a diagonal matrix. Entries in the matrix need to be saved. As a
result, there are a total of values that need to be stored for the low-rank matrix. By attempting an
approximation with solely singular values, we obtain a compression ratio of, which is equal to
the initial storage need of. The svd() function in MATLAB may be used to determine the singular
value decomposition (SVD) of a matrix. The three matrices that make up the SVD
decomposition are the outputs of the svd() function. To show an image in MATLAB, an empty
figure must first be established. The MATLAB instruction is: [U,S,V] = svd(A); Figure; is the
MATLAB command to use. An empty figure is initialized using this command. The following
command will show up in the figure as a plot or presentation of data.
To display an image in a figure, use the MATLAB function imshow(). The command imshow(A)
will display the picture if it is stored in a matrix. A figure's title can be changed using the
MATLAB command title(). The title() method takes a string as an input, such as title("My Image
Title"). It is simple to upload or download files using the MATLAB Online interface. There are
Upload and Download options located under the Home tab. The user will be prompted to choose
the file to upload after clicking the Upload button. The Download button can be used to
download just one file to the user's local computer (for example, project01Solution.pdf).
Students also viewed