Assignment
Assignment
Assignment
Technology (HCMUT)
REPORT SUBJECT
LINEAR ALGEBRA
STUDENT PERFORMANCE
ACKNOWLEGDEMENT
From the bottom of our heart, we want to
say thank to Mr. Dau The Phiet and Mr Nguyen Tien Dung
for teaching us all the basis and useful knowledge.
We are extremely grateful for it.
*Note: [1],[2],[3],[4] are references that you can check on the last page of this report
1. Introduction
Every day, enormous volumes of data are produced as technology becomes more and more integral
to our daily lives. This information can be in text, audio, video, and image formats, among others.
One of the most common ways to convey info is through images. Images are frequently used to
communicate information because "seeing is believing". The convenience of using image data has
increased because to the development of smartphones and smart gadgets. We data scientists use
this method to daily store, process, and communicate enormous volumes of digital data.
Uncompressed data storage can be quite costly in terms of space requirements. Furthermore,
uncompressed data transmission needs a lot of bandwidth. For these reasons, the scientific
community has become very interested in strategies for compressing data before storage and
transmission. It is particularly helpful in fields like signal processing, pattern recognition, and
artificial intelligence. The Singular Value Decomposition method will be highlighted in this article
as a way to decrease the amount of storage needed to store image data.
Reducing the amount of data needed to represent images is the subject of image compression.
Because digital images are represented digitally, the purpose of the image compression technique
is to do so with the fewest number of bits. It is possible to take advantage of redundant information
in the image file to cut down on the amount of bits needed. Redundancy is a roughly repeated
pattern that tends to increase the level of resolution in an image. The image's quality shouldn't be
degraded too much, though, lest the user find it confusing. This trade-off should be balanced with
a suitable image compression method. The balance between compression and data quality is often
determined by the needs of the application.
Typically, an image is represented by a matrix of size m×n. Here, m stands for the number of rows,
which represents the image's pixel height, and n stands for the number of columns, which
represents the image's pixel width. Every pixel that makes up the image is represented by one of
the matrix's elements. By allocating a number to each pixel in an image, the brightness or darkness
of a pixel in relation to neighboring pixels is represented. Each matrix member thus determines
the properties of the corresponding pixel. Each pixel's relative grayness is represented by a number
in the matrix that, for black-and-white images, spans from 0 (black) to 1 (one). Red, green, and
blue (RGB) are the three fundamental colors that make up colored imagery. The computer divides
each colored image into these three levels before storing it. When compared to grayscale
photographs, colorful images take up more space due to the additional layer needed. As a result,
each pixel in a colored image can be assigned to one of three values, ranging from 0 (not colored)
to 1 (saturated). Red, Green, and Blue are each given one of these three values. A 3000×3000
matrix, for instance, can be used to represent a 9 megapixel image. A grayscale 9 megapixel image
requires 9MB of storage space when taking into account a 1 byte per pixel storage space. An
number that ranges from 0 to 255 can be used to represent each pixel in the image matrix. The
image will have three parts (RGB) if it is colored. There needs to be a separate matrix for each
component. Therefore, in this scenario, storing a colored image requires 27Mb of storage space.
2. Background
The existence of redundancy in the data is one of the key elements that affect compression.
Redundancy may take the following forms:
+ Coding Redundancy: When less-than-ideal code words are used, there is redundant coding. The
implementation of the look up table makes the code reversible. Arithmetic coding and Huffman
coding are two examples of this method.
+ Inter-pixel Redundancy: A pixel's value is predicted based on the values of its nearby pixels. An
alternative format is chosen to map the original 2D pixel array. Inter-frame redundancy, geometric
redundancy, and spatial redundancy are additional names for inter-pixel redundancy.
+ Psycho-Visual Redundancy: The human eye is not perfectly calibrated to process all frequency
bands. As a result, not every piece of incoming data is treated with identical attention. The
information will include some elements that will stand out more than others. When picture
redundancies are eliminated, this fact can be taken advantage of. This component is used in
psycho-visual redundancy.
The purpose of the SVD implementations is to produce a smaller image by maximizing the use of
redundancy. This may be effective because the algorithm can only delete redundant parts after
being made aware of them in the image. The integrity of the image is preserved in this way.
In essence, SVD divides the supplied matrix into many matrices. The above matrix, which has m
rows and n columns, is factored by the SVD into three matrices, which are denoted by the
notation M = U ∑ 𝑉 𝑇 , where U and 𝑉 𝑇 are orthogonal matrices of orders m×m and n×n,
respectively, and ∑ is a diagonal matrix of order m×n. The singular values of M are nonnegative
real numbers that make up the diagonal matrix ∑. According to [1] and [2], the m columns of U
and the n columns of 𝑉 𝑇 are the left and right singular vectors of M, respectively.
Figure 1 shows the matrices obtained after splitting the original image matrix
Figure 1. Finding the matrices M = UΣVT
close all
clear all
clc
filename = 'image.jpg';
subplot(4,2,1);
imshow(X);
imwrite(X, '!original.jpg');
title('Original image')
R = X(:,:,1);
G = X(:,:,2);
B = X(:,:,3);
Red = double(R);
Green = double(G);
Blue = double(B);
r=[200,100,50,30,20,10,5,1];
for i=1:length(r)
C = S;
C(r(i)+1:end,:)=0;
C(:,r(i)+1:end)=0;
Dr=U*C*V';
C = S2;
C(r(i)+1:end,:)=0;
C(:,r(i)+1:end)=0;
Dg=U2*C*V2';
C = S3;
C(r(i)+1:end,:)=0;
C(:,r(i)+1:end)=0;
Db=U3*C*V3';
subplot(4,2,i+1);
imshow(uint8(Cimg));
title(buffer);
end
This algorithm has been implemented in Matlab programming platform. An image of size 487KB is
considered. It is run through the algorithm, considering different number of columns (k) each time. Size
of output image is evaluated each time.
200 104
100 89
50 60
30 58
20 56
10 55
5 49
1 44
The figure below shows the compression images with different values of k:
Reference:
[1]. Kotera H RGB to spectral lmage conversion using spectral pallete and compression by svd
461–464.
[2]. Jabbar S 2015 Using Approximate K-SVD Algorithm.
[3]. M.Dixit and P.K.Kulkarni 2012 Variable Scaling Factor based Invisible Image Watermarking
using Hybrid DWT-SVD Compression-Decompression Technique 2–5.
[4]. Rufai, A.M., Anbarjafari, G., &Demirel, Huffman Coding and Singular Value Decomposition