Unformatted Attachment Preview
Department of Computing
COURSE: Image Processing
MARKS:
COURSE CODE: BCM2063
SEMESTER: 2 2020-21
/100
TOPIC : Chapter 1-7
TYPE OF ASSESSMENT: ASSIGNMENT
ASSESSMENT NO: ASSIGNMENT
TIME / DEADLINE: 3 WEEKS
STUDENT NAME:
SIGNATURE:
STUDENT ID:
SECTION:
FEEDBACK (If Any):
LECTURER NAME: Ms. S. HAMEETHA BEGUM
SIGNATURE:
INSTRUCTIONS TO CANDIDATE
1. Read the following assignment task instruction and you are required to produce the source
code and report as per the instruction given.
2. Create your own folder and name it with your id number. Ex: MC14222
3. Submit the softcopy in Moodle LMS course page within the time given. (Late submission will
lead to mark deduction).
4. You are required to demonstrate the code. Describe the code and run the program during
your demonstration.
5. You should be able to make amendments to the code during the presentation session
according to the instruction.
6. All submitted source code will be checked for plagiarism.
Assignment Task Instruction
Guidelines for Assignment
i.
ii.
iii.
iv.
This assignment must be developed in a group (consists of max 3 students per group or
minimum 1 student per group) using MATLAB software.
Each group is allowed to implement only one (1) title of your own. (Refer to titles below)
Refer to the rubrics for the assessment criteria(s).
Softcopy of your source code and report must be submitted in Moodle LMS and
presented to your lecturer
Assignment Requirement
1. Must have at least one (1) of the following techniques/elements:
a. Intensity Transformation and Spatial Filtering
b. Frequency Domain Processing
c. Image Restoration and Noise Removal
d. Colour Image Processing
e. Image Compression
f. Image Segmentation
2. Nice Graphical User Interface
3. A Selection Menu (if any)
Suggested Assignment Titles:
• Car number plate Image Segmentation
• Segmentation of flower petals
• Image compression for database of Employee /Student photos
• Enhancing and restore Medical X-Ray images for better diagnosis
• Identifying Edges / Tumor in Brain –MRI -Medical images
Assignment Submission
1. Submit your Report (.DOCX) and source code project embedded in .ZIP or .RAR file format
(TWO FILES) in Moodle LMS (Refer Appendix 1)
2. Late submission will be given penalty (Marks deduction).
Refer to the rubric for assessment in the evaluation form.
BCM2063
Page 2 of 4
BCM2063 – Image Processing
Rubric for Assessment
(**** Should be attached with your report for marking purpose****)
Course Code : BCM2063
Course Name : Image Processing
Assignment Title :
Student Id Numbers
Group No
CRITERIA
LEVEL OF ACHIEVEMENT
WEIGHT
AGE
1
3
5
less than 40%
problem
identification
and
logical
proposal related
to
image
processing
techniques
apply
single
image input to be
tested
60% problem
identification
and logical
proposal
related
to
image
processing
techniques
3 images are
tested in the
experiment
More than 80%
problem
identification
and
logical
proposal related
to
image
processing
techniques
More than 5
images are tested
in
the
experiment
0.5
30% able to
discuss
and
analyze
the
results
60% able to
discuss and
analyze the
results
More than 80%
able to discuss
and analyze the
results
1.5
Presentation of
the final output,
30% complete
Presentation of
the final output,
100% complete
0.8
Calculation
without error
1
CO1
Report a propose
alternative
solutions.
Demonstrate
appropriate
image
input
relevant to the
problem
Analyze
the
experimental
results
CO2
The presentation
of final output
1
Usage
of
arithmetic
expression
(calculation)
The
overall
program
structure
6 or 7 errors.
Presentation
of the final
output, 60%
complete
2 or 3 errors.
6 or 7 errors.
2 or 3 errors.
Ability
to
execute without
error
1
correct usage of
selection
control
statement
(if/if..else/case)
6 or 7 errors.
2 or 3 errors.
The
selection
control
statement
without error
1.5
correct usage of
loops
statement
(for/dowhile/while...etc)
6 or 7 errors.
2 or 3 errors.
The
loops
control
statement
without error
1.5
SCORE
GAINED
MARK
able to process
array
data
(image) correctly
6 or 7 errors.
2 or 3 errors.
The programme
is
working
properly without
any error
1.5
Use
correct
calling function
30%
correct
usage
of
sequential
statement
60% correct
usage
of
sequential
statement
100%
correct
usage
of
sequential
statement
1.2
Use
appropriate
process for each
function body
6 or 7 errors.
2 or 3 errors.
The programme
is
working
properly without
any error
1.5
able
to
show
different types of
quality
image
measurements
1 parameter in
quality
image
measurements
3 parameters
in
quality
image
measurement
s
More than 5
parameters
in
quality
image
measurements
2
Less than 40%
assignment
organization
complete
Less
than
60%
assignment
organization
complete
6
logical
references in
the report
More than 80%
assignment
organization
complete
1
At least
10
logical
references in the
report
0.5
CO3
LL1:
Structure
Report
LL1:
(References)
LL2:
Learning
2
logical
references in the
report
Self
Limited ability
to
implement
knowledge
Able to to
implement
knowledge
with
assistance
from lecturer
Able
to
implement
knowledge to a
given problem
independenly
1
LL3:Effort
in
completing given
tasks
(experimental
results)
Less effort to
complete
task
30% complete
Sufficient
effort
to
complete task
60%
complete
Excellent effort
to complete task,
100% complete
0.5
Grand Total
90
Demonstration
10
Net Total
100
Overall Comments:
BCM2063
Page 4 of 4
Table of Contents
1.0 INTRODUCTION .......................................................................................... 2
2.0 OBJECTIVES ..............................................................................................2-3
3.0 MATLAB CODE .........................................................................................3-9
4.0 TESTED IMAGES (CANCER IMAGES) ..............................................10-11
5.0 RESULTS & DISCUSSION......................................................................... 12
5.1 Segmentation Techniques ............................................................................ 12
5.1.1 Thresholding basedmethod………………………………………………….……12
5.2 HSV COLOR Model………………………………………………………….……12
6.0 RUNNING THE APPLICATION ...........................................................13-19
7.0 CONCLUSION ............................................................................................ 19
8.0 REFERENCES.............................................................................................. 19
1.0INTRODUCTION
Nowadays people can manipulate digital photos by using computer to edit, change and improve
the image. Images can be obtained using different types of devices, such as: mobile phone and
digital computer. Social media programs are one of the most important programs that carry a
billion pictures in limited hours. People can share it through their programs and take the photos
they need in their daily practices.
Cancer is one of the chronic diseases that appeared in the current era and is called "the disease
of the age". This disease is more prevalent among age groups, and fortunately, there is a cure
for it. Royal Hospital is one of the most important hospitals in the Sultanate that revealed early
cancer in the body of a 34-year-old woman. This is done by applying a solution and making
the necessary radiation to detect the cancerous cells and knowing where these cells are
concentrated.
The person, when infected with cancer and visiting the hospital, the name is stored among the
infected patients and is stored in the hospital's database. The hospital performs medical
statistics that the Ministry of Health undertakes to know the number of the disease in the
oncology department, its purpose, in order to avoid and reduce the infection from the disease.
The process of storing names in the database is easy to refer to in order to know the infected
persons and treat them with chemical solutions to improve their physical condition.
Finally, in this project we have used various techniques to correctly identify cancer cells and
where these cells are located in the body, including: Logarithm, sharpening, histogram
equalization, restoration techniques, mean and median filtering, Salt and pepper noise and
segmentation.
2.0 OBJECTIVE
The project aims to develop cancerous cells in the body to help the doctor discover the affected
cell in the body by developing a graphical user interface using Matlab. Several images are
tested to find the position of cancer cells in the body, and this is done by the user's choice of
the image and the comparison of results to obtain an accurate result, in addition to the ability
to apply to remove any impurities on the images and improve them for the better. There are
also several techniques and functions used in this project, such as Image segmentation
technology with the aim of dividing the image into several parts and separating the affected
cancer cells. The main task is that the application should allow the user to perform image
improvement treatment and direct discovery of cancer cells and save them in another file
without the need to formally choose the image.
3.0 MATLAB CODE
Main program file (project.m)
clc;
while(1)
disp('Enter your choice:');
disp('1 - GrayScale images');
disp('2 - images Detection');
disp('3 - Exit');
choice = input('');
switch choice
case 1
dir_path = 'C:\Users\student\Desktop\MATLAB-projects\Project-IP\images\';
dir_path = strcat(dir_path,'\');
dirpath = strcat(dir_path,'*.jpg');
files = dir(dirpath);
file_names={files.name};
sf=size(file_names);
for i=1:sf(2)
fprintf('Image %d is in progress...\n',i);
s1 = strcat(dir_path,char(file_names{i}));
M = imread(s1);
M = rgb2gray(M);
s2 = strcat('C:\Users\student\Desktop\MATLAB-projects\Project-IP\GrayScaleimages\',char(file_names{i}));
imwrite(M,s2,'JPG');
clc;
continue;
end
case 2
dir_path = 'C:\Users\student\Desktop\MATLAB-projects\Project-IP\images\';
dir_path = strcat(dir_path,'\');
dirpath = strcat(dir_path,'*.jpg');
files = dir(dirpath);
file_names={files.name};
sf=size(file_names);
for i=1:sf(2)
fprintf('Image %d is in progress...\n',i);
s1 = strcat(dir_path,char(file_names{i}));
M = imread(s1);
M = Detection(M);
s2 = strcat('C:\Users\student\Desktop\MATLAB-projects\Project-IP\Detectedimages\',char(file_names{i}));
imwrite(M,s2,'JPG');
end
case 3
break;
otherwise
clc;
uiwait(msgbox('Please Enter correct choice!!!','','modal'));
end
end
clc;
disp('Application Closed!');
close all;
Select Image (Button)
[filename, pathname]= uigetfile({'*.jpg';'*.bmp';'*.png'},'file selector');
g=strcat(pathname,filename);
Originalimg =imread(g);
axes(handles.axes1);
imshow(Originalimg);title('Original image');
Gray Scale Image (Button)
Gray= getimage(handles.axes1);
Gray= rgb2gray(Gray);
axes(handles.axes2);
imshow(Gray);title('GrayScale image');
cla(handles.axes5);
set(handles.axes5,'visible','off');
cla(handles.axes6);
set(handles.axes6,'visible','off');
RGB to HSV Image (Button)
HSV= getimage(handles.axes1);
hsv = rgb2hsv(HSV);
axes(handles.axes3);
imshow(hsv);title('HSV image');
axes(handles.axes4);
imhist(hsv);title('Histogram of HSV image');
cla(handles.axes5);
set(handles.axes5,'visible','off');
cla(handles.axes6);
set(handles.axes6,'visible','off');
Cancer cells Segmented and Detected (Button)
x= getimage(handles.axes2);
x=double(x);
tot=0;
[a,b]=size(x);
y=zeros(a,b);
for i=1:a
for j=1:b
y(i,j)=0;
end
end
for i=1:a
for j=1:b
tot=tot+x(i,j);
end
end
thr=tot/(a*b);
for i=1:a
for j=1:b
if x(i,j) > thr
y(i,j)=0;
else
y(i,j)=1;
end
end
end
axes(handles.axes5);
imshow(y), title('Segmented Image');
x= getimage(handles.axes2);
C=double(x);
for i=1:size(C,1)-2
for j=1:size(C,2)-2
%Sobel mask for x-direction:
Gx=((2*C(i+2,j+1)+C(i+2,j)+C(i+2,j+2))(2*C(i,j+1)+C(i,j)+C(i,j+2)));
%Sobel mask for y-direction:
Gy=((2*C(i+1,j+2)+C(i,j+2)+C(i+2,j+2))(2*C(i+1,j)+C(i,j)+C(i+2,j)));
%The gradient of the image
x(i,j)=sqrt(Gx.^2+Gy.^2);
end
end
axes(handles.axes6);
imshow(x); title('Detected Image');
Clear ALL (Button)
cla(handles.axes1,'reset');
cla(handles.axes2,'reset');
cla(handles.axes3,'reset');
cla(handles.axes4,'reset');
cla(handles.axes5,'reset');
cla(handles.axes6,'reset');
Exit (Button)
close all;
Menu (Intensity transformation and spatial filtering)
❖
Power law transformation
delete(findall(findall(gcf,'Type','axe'),'Type','text'));
[filename, pathname]= uigetfile({'*.jpg';'*.bmp';'*.png'},'file selector');
g=strcat(pathname,filename);
g =imread(g);
f=rgb2gray(g);
f = im2double(f);
[m n]=size(f);
c = 2;
y=1.2;
for i=1:m
for j=1:n
s(i,j)=c*(f(i,j)^y);
end
end
axes(handles.axes1);
imshow(f),title('Original Image');
axes(handles.axes2);
imhist(f),title('Histogram of Original Image');
axes(handles.axes3);
imshow(s),title('After Power-Law Transformation');
axes(handles.axes4);
imhist(s),title('Histogram After Power-Law Transformation');
cla(handles.axes5);
set(handles.axes5,'visible','off');
cla(handles.axes6);
set(handles.axes6,'visible','off');
❖
Sharpening using Laplacian
delete(findall(findall(gcf,'Type','axe'),'Type','text'));
[filename, pathname]= uigetfile({'*.jpg';'*.bmp';'*.png'},'file selector');
g=strcat(pathname,filename);
g =imread(g);
A=rgb2gray(g);
axes(handles.axes1);
imshow(A),title('Original Image');
axes(handles.axes2);
imhist(A),title('Histogram of Original Image');
I1=A;
I=zeros(size(A));
I2=zeros(size(A));
F1=[0 1 0;
1 -4 1;
0 1 0];
A=padarray(A,[1,1]);
A=double(A);
for i=1:size(A,1)-2
for j=1:size(A,2)-2
I(i,j)=sum(sum(F1.*A(i:i+2,j:j+2)));
end
end
I=uint8(I);
axes(handles.axes3);
imshow(I);title('Filtered Image');
axes(handles.axes4);
imhist(I),title('Histogram of Filtered Image');
B=I1-I;
axes(handles.axes5);
imshow(B);title('Sharpened Image');
axes(handles.axes6);
imhist(B),title('Histogram of Sharpened Image');
❖
Logarithmic
delete(findall(findall(gcf,'Type','axe'),'Type','text'));
g=getimage(handles.axes1);
img= im2double(g);
c=6;
[M,N]=size(img);
for x = 1:M
for y = 1:N
m=double(g(x,y));
z(x,y)=c.*log10(1+m);
end
end
axes(handles.axes1);
imshow(g),title('Original Image');
axes(handles.axes2);
imhist(g),title('Histogram of Original Image');
axes(handles.axes3);
imshow(z),title('After Logarithmic');
axes(handles.axes4);
imhist(z),title('Histogram After Logarithmic');
cla(handles.axes5);
set(handles.axes5,'visible','off');
cla(handles.axes6);
set(handles.axes6,'visible','off');
❖
Histogram equalization
delete(findall(findall(gcf,'Type','axe'),'Type','text'));
h=getimage(handles.axes1);
axes(handles.axes1);
imshow(h), title('Original Image');
axes(handles.axes2);
imhist(h), title('Histogram of Original Image');
q= histeq(h);
axes(handles.axes3);
imshow(q), title('Enhanced Image');
axes(handles.axes4);
imhist(q), title('Histogram of Enhanced Image');
cla(handles.axes5);
set(handles.axes5,'visible','off');
cla(handles.axes6);
set(handles.axes6,'visible','off');
Menu (ImageRestoration.m)
clc;
while(1)
disp('Enter your choice:');
disp('1 - Select Image');
disp('2 - Add Noise');
disp('3 - Add Filter');
disp('4 - Exit');
choice = input('');
switch choice
case 1
[filename, pathname] =
uigetfile({'*.jpg';'*.bmp';'*.png'},'File Selector');
img = strcat(pathname, filename);
if isempty(img)
clc;
continue;
end
img = imread(img);
img_gray = rgb2gray(img);
axes(handles.axes1);
imshow(img),title('Original Image');
axes(handles.axes2);
imshow(img_gray),title('Grayscale Image');
cla(handles.axes3,'reset');
cla(handles.axes4,'reset');
clc;
case 2
clc;
while(1)
img_gray = getimage(handles.axes2);
if isempty(img_gray)
message = msgbox('Please Select Image!!!');
disp(message);
clc;
break;
end
disp('Enter your choice:');
disp('Type of Noise :');
disp('1 - Speckle Noise');
disp('2 - Salt and Pepper Noise');
disp('3 - Back');
type = input('');
switch type
case 1
speckle = imnoise(img_gray,'speckle');
axes(handles.axes3);
imshow(speckle),title('Speckle Noise');
clc;
cla(handles.axes4,'reset');
break;
case 2
salt_pepper = imnoise(img_gray,'salt &
pepper',0.13);
axes(handles.axes3);
imshow(salt_pepper),title('Salt and Pepper Noise');
clc;
cla(handles.axes4,'reset');
break;
case 3
clc;
break;
otherwise
clc;
message = msgbox('Please Enter correct choice!');
disp(message);
end
end
case 3
clc;
while(1)
noise_img = getimage(handles.axes3);
if isempty(noise_img)
message = msgbox('Please select image and add noise to
it!');
disp(message);
clc;
break;
end
disp('Enter your choice:');
disp('Filter Technique :');
disp('1 - Average Filter');
disp('2 - Median Filter');
disp('3 - Back');
type = input('');
switch type
case 1
I = double(noise_img);
for i=1:size(I,1)-2
for j=1:size(I,2)-2
%Calculate Average:
Average =
round((I(i,j)+I(i+1,j)+I(i+2,j)+I(i,j+1)+I(i+1,j+1)+I(i+2,j+1)+I(i,j+2)+I(i
+1,j+2)+I(i+2,j+2))/9);
noise_img(i,j) = Average;
end
end
filtered_img = noise_img;
axes(handles.axes4);
imshow(filtered_img),title('Average Filter');
clc;
break;
case 2
I = double(noise_img);
for i=1:size(I,1)-2
for j=1:size(I,2)-2
%Find Median:
Median = [I(i,j) I(i+1,j) I(i+2,j) I(i,j+1)
I(i+1,j+1) I(i+2,j+1) I(i,j+2) I(i+1,j+2) I(i+2,j+2)];
Median = sort(Median);
Med = Median(5);
noise_img(i,j) = Med;
end
end
filtered_img = noise_img;
axes(handles.axes4);
imshow(filtered_img),title('Median Filter');
clc;
break;
case 3
clc;
break;
otherwise
clc;
message = msgbox('Please Enter correct choice!');
disp(message);
end
end
case 4
project
otherwise
clc;
message = msgbox('Please Enter correct choice!');
disp(message);
end
end
clc;
disp('Application Closed!');
close all;
Detection function (Detection.m)
function x = Detection(x)
x= rgb2gray(x);
C=double(x);
for i=1:size(C,1)-2
for j=1:size(C,2)-2
%Sobel mask for x-direction:
Gx=((2*C(i+2,j+1)+C(i+2,j)+C(i+2,j+2))(2*C(i,j+1)+C(i,j)+C(i,j+2)));
%Sobel mask for y-direction:
Gy=((2*C(i+1,j+2)+C(i,j+2)+C(i+2,j+2))(2*C(i+1,j)+C(i,j)+C(i+2,j)));
%The gradient of the image
%B(i,j)=abs(Gx)+abs(Gy);
x(i,j)=sqrt(Gx.^2+Gy.^2);
end
end
4.0 TESTED IMAGES (Cancer cells)
Type: jpg
Type: jpg
Type: jpg
Type: jpg
Type: png
Type: jpg
Type: jpg
Type: jpg
Type: jpeg
Type: jpg
Type: jfif
Type: jpg
Type: jpg
Type: jpg
Type: tiff
Type: bmp
Type: bmp
Type: bmp
5.0 Results & Discussion
5.1 Segmentation Techniques :
Image segmentation technology is one of the most important techniques used to detect objects
and image processes with high accuracy. The process of segmentation is one of the most
important techniques in the image processing domain and known as the technique of splitting
the images into several parts called segmented. Image segmentation techniques are work
properly based on image criteria such as intensity, color, texture, and others. There are different
types of image segmentation processing such as (“Region-based method”, “Thresholdingbased method”, “Clustering-based method”, “watershed based-method” and etc )[1].
5.1.1 Thresholding-based method
Threshold methods are one of the simplest ways to segment images into several parts. This
method is works based on the intensity level or image intensity properties. It is appropriate
with the image that has a black background and bright object to separate the object with
different colors and separate backgrounds with other colors like (black and white).
5.2 HSV color model :
This model defines the color space in terms of three main components which are Hue,
saturation, and value. Hue is a type of color that includes various colors such as red, magenta,
blue, cyan, and green or yellow. The range of hue between 0 to 360 degrees. Saturation is the
amount of gray level and refers to how much the color is polluted with white colors. The
intensity of saturation between 0 to 255 intensities, where 1 refers to white and 0 refers to black.
Value considered as the luminance of elements or values[2]. The application of “cancer cells
detection Using image processing ” will use the HSV color model to detect the cell who has
the disease and make the affected cell clearer.
6.0 Running the Application
When running the application, the program will allow the user to select the images from
the file by clicking the select image button. After that, the image selected by the user
will appear which is called the Original image, the application allows the user to convert
the image into gray level intensities and converted the cancer cells to the HSV color
model. Furthermore, This application is useful to know the affected cell by using a
segmentation technique such as Threshold methods to splitting the affected cell and
make clear to the doctor as shown in figure 1.
Figure 1
The program shall display the detected cancer cell after the user clicking “cancer cell
segmented and detected button”, the program shall allow the user to clear all images and exit
from the application as shown in Figure 2.
Figure 2
Figure 3
As shown in figure3 the program shall allow the user to select a choice by using the switch
statement, the user can enter 1 to select the image, the user can enter 2 to add noise. There are
two types of noise are used in this project which are Speckle noise, salt, and pepper noise.
Furthermore, the application shall allow the user to exit from the application as shown in figure
3. When the user enters 2, the application shall allow the user to select three choices as shown
in figure 4.
Figure 4
Figure 5
As shown in figure 5, the application shall allow the user to enter 1 to apply average filtering
which is used to remove noise from the image. In addition, the application shall allow the user
to enter 2 to apply the median filter which is used to remove noise from an image and enter 4
to back to the previous page.
Figure 6
Figure 7
This project will use image restoration techniques for restoring the image that has been
degraded by various reasons, For example, Noise, pixel value errors, out of focus blurring or
camera motion blurring. (attempts to restore the image that has degraded for many reasons like
motion blur, noise and camera misfocus).As shown in figure 6 and figure 7.
Figure 8
Figure 9
When the user clicks the advanced button, the application shall allow the user to enter the
choice. If the user enters 1, all the images which are stored in a folder called “images” will be
converted to grayscale images in a folder called “GrayScale-images” as shown in figure9.
Figure 10
Figure 11
When the user clicks the advanced button, the application shall allow the user to enter the
choice. If the user enters 2, all the images which are stored in a folder called “images” will be
Detected by using image detection techniques in a folder called “Detected-images” images as
shown in figure11.
Figure 12
The program shall display error messages as shown in Figure 12 whenever the user enters
incorrect choice.
Figure 13
When the user clicks the advanced button, the application shall allow the user to enter the
choice. If the user enters 1, the application will be closed.
7.0 Conclusion:
Finally in this project, after developing a GUI application to find the best techniques for
accurately identifying cancerous cells in the body. We have learned that each of these
techniques has the ability to know the location of cancer cells and know their greater focus to
reduce peak and treatment in the body early. Doctors can use these techniques to quickly
identify and treat a patient's condition and avoid medical errors by eliminating cancer cells
finally.
8.0 References
[1], “IMAGE SEGMENTATION TECHNIQUES”, Available on :
https://shodhganga.inflibnet.ac.in/bitstream/10603/50846/10/10_chapter%203.pdf [Accessed
January. 3, 2020].
[2], “The HSV Color Model in Graphical Design ” Available on
https://www.lifewire.com/what-is-hsv-in-design-1078068[Accessed January. 3, 2020].
Table of Contents
1.0 INTRODUCTION ............................................................................................... 2
2.0 OBJECTIVES .................................................................................................. 2-3
3.0 MATLAB CODE ........................................................................................... 3-12
4.0 TESTED IMAGES (STUDENTS PHOTOGRAPHS) ...................................... 12
5.0 RESULTS & DISCUSSION.............................................................................. 13
5.1 COMPRESSION ALGORITHMS USED .............................................. 13
5.1.1 DCT ............................................................................................ 13
5.1.2 LBG ............................................................................................ 13
5.2 RUNNING THE APPLICATION ..................................................... 14-16
5.3 COMPRESSION TECHNIQUES (RESULTS & COMPARISON) 16-18
6.0 CONCLUSION .................................................................................................. 18
7.0 REFERENCES............................................................................................. 19-20
Page | 1
1.0 INTRODUCTION
Nowadays, the digital image can be processed by a digital computer, where we are able
to edit, change and improve the quality of an image [1]. The first process to get the image in the
image processing procedure is called as image acquisition, where we obtain the image using a
different type of camera devices such as mobile phones, digital cameras, computers, etc.
In social media applications such as Facebook, Instagram, Twitter, WhatsApp, etc. there are
many images that are uploaded every day. According to the statistic that in 2014 there are 2088
digital images are uploaded every second. That’s 1.8 billion digital images every day and 657
billion digital images per year [2]. Also, in many of the organization such as universities,
colleges, schools, police, etc. a large number of digital images are stored in the database. In the
colleges every new year there are new students are joining college and their information needs to
be stored in the college database including a photograph of each student. Therefore, they will be
a large number of digital images that consume a large space from storage. One of the most
important things for the college is to store these photographs in less space where it can be used in
the future to recognize students' faces from the photographs. In this project, an application shall
be developed to find the best compression technique to store Muscat College students’
photographs in less storage.
There are different image compression techniques used in different applications to store a large
number of digital images in less storage such as Huffman code, run-length code, Discrete Cosine
Transform DCT, Linde Buzo Gray LBG, etc. some type of compression techniques called
lossless compression which maintain the quality of the images and some type of compression
techniques called lossy compression which will not maintain the quality of the images but will
save more storage.
2.0 OBJECTIVE
The main objective of this project is to develop an application to find the best
compression technique to store Muscat College students' photographs in less storage. MATLAB
software will be used to develop a Graphical User Interface GUI application and implement two
image compression techniques which are lossless compression using the DCT algorithm and
lossy compression using the LBG algorithm.
Page | 2
The application shall allow the user to select and test a sample image using both these techniques
for any student image he\she selects in order to compare the results and find the most suitable
compression technique. Also, the application shall show the size of images before and after
applying the compression process and show the compression ratio and relative data redundancy
of compressed image/images. The main functionality is that the application shall allow the user
to do bulk processing to apply image enhancement and image compression technique to enhance
and compress all the photographs of students and store them in less space.
3.0 MATLAB CODE
Main program file (Project.m)
clc;
global OriginalImageSize;
global CompressedImageSize;
while(1)
dlgtitle = 'Enter your choice:';
prompt = sprintf("1 - Select Image\n2 - Low Compression Test\n3 - High
Compression Test\n4 - Compress Students Photographs\n5 - Exit");
dims = [1 50];
value = inputdlg(prompt,dlgtitle,dims);
choice = str2double(value);
switch choice
case 1
[filename, pathname] = uigetfile({'*.jpg';'*.bmp';'*.png'},'File
Selector');
file = strcat(pathname, filename);
if isempty(file)
clc;
continue;
end
img = imread(file);
axes(handles.axes1);
imshow(img);
OriginalImageSize = CalSize(file);
OriginalImageSize = round(OriginalImageSize,1);
set(handles.text1,'string',"Image size: "+OriginalImageSize+"
KB");
axes(handles.axes2);
imhist(img);
cla(handles.axes3,'reset');
cla(handles.axes4,'reset');
cla(handles.axes5,'reset');
cla(handles.axes6,'reset');
set(handles.text2,'string',"");
set(handles.text6,'string',"");
set(handles.text3,'string',"");
set(handles.text7,'string',"");
set(handles.text23,'string',"");
set(handles.text24,'string',"");
Page | 3
case 2
img = getimage(handles.axes1);
if isempty(img)
uiwait(msgbox('Please Select Image!!!','','modal'));
continue;
end
img = imresize(img,[1048 1048]);
compressedImage = DCT(img);
compressedImage = imresize(compressedImage,[264 264]);
axes(handles.axes3);
imshow(compressedImage);
imwrite(compressedImage,'Compressed.jpg');
CompressedImageSize = CalSize('Compressed.jpg');
CompressedImageSize = round(CompressedImageSize,1);
set(handles.text2,'string',"Image size: "+CompressedImageSize+"
KB");
CR = OriginalImageSize/CompressedImageSize;
CR = round(CR,2);
set(handles.text6,'string',"Compression Ratio: "+CR);
RD = 1 - (1/CR);
RD = RD * 100;
RD = round(RD,2);
set(handles.text23,'string',"Relative Data Redundancy: "+RD+"%");
axes(handles.axes4);
img = imread('Compressed.jpg');
imhist(img);
case 3
img = getimage(handles.axes1);
if isempty(img)
uiwait(msgbox('Please Select Image!!!','','modal'));
continue;
end
img = imresize(img,[1048 1048]);
compressedImage = LBG(img);
compressedImage = imresize(compressedImage,[264 264]);
axes(handles.axes5);
imshow(compressedImage);
imwrite(compressedImage,'Compressed.jpg');
CompressedImageSize = CalSize('Compressed.jpg');
CompressedImageSize = round(CompressedImageSize,1);
set(handles.text3,'string',"Image size: "+CompressedImageSize+"
KB");
CR = OriginalImageSize/CompressedImageSize;
CR = round(CR,2);
set(handles.text7,'string',"Compression Ratio: "+CR);
RD = 1 - (1/CR);
RD = RD * 100;
RD = round(RD,2);
set(handles.text24,'string',"Relative Data Redundancy: "+RD+"%");
axes(handles.axes6);
img = imread('Compressed.jpg');
imhist(img);
case 4
while(1)
dlgtitle = 'Images Type:';
Page | 4
prompt = sprintf("1 - JPG\n2 - BMP\n3 - PNG\n4 - TIFF\n5 Cancel Progress");
dims = [1 50];
value = inputdlg(prompt,dlgtitle,dims);
c = str2double(value);
if c ==1
type = 'JPG';
break;
elseif c ==2
type = 'BMP';
break;
elseif c ==3
type = 'PNG';
break;
elseif c ==4
type = 'TIFF';
break;
elseif c ==5
break;
else
uiwait(msgbox('Please Enter correct
choice!!','','modal'));
continue;
end
end
if c == 5
continue;
end
while(1)
dlgtitle = 'Compression Type:';
prompt = sprintf("1 - Low Compression\n2 - High
Compression\n3 - Cancel Progress");
dims = [1 50];
value = inputdlg(prompt,dlgtitle,dims);
t = str2double(value);
if t ==1
break;
elseif t ==2
break;
elseif t ==3
break;
else
uiwait(msgbox('Please Enter correct
choice!!','','modal'));
continue;
end
end
if t == 3
continue;
end
dir_path =
'C:\Users\moaya\Documents\MATLAB\Workspace\Project\Students Images\';
dir_path = strcat(dir_path,'\');
dirpath = strcat(dir_path,['*.' type]);
files = dir(dirpath);
Page | 5
file_names={files.name};
sf=size(file_names);
OriginalImage= 0;
CompressedImage = 0;
for i=1:sf(2)
fprintf('Image %d is in progress...\n',i);
s1 = strcat(dir_path,char(file_names{i}));
M = imread(s1);
M = Laplacian_sharpening(M);
M = Filtering(M);
if t==1
M = imresize(M,[1048 1048]);
M = DCT(M);
M = imresize(M,[264 264]);
else
M = imresize(M,[1048 1048]);
M = LBG(M);
M = imresize(M,[264 264]);
M = pwr_law_transformation(M);
M = logarithmic(M);
end
BW = im2bw(M,0.6);
s2 =
strcat(['C:\Users\moaya\Documents\MATLAB\Workspace\Project\Compressed
Images\'],char(file_names{i}));
imwrite(M,s2,type);
s3 =
strcat(['C:\Users\moaya\Documents\MATLAB\Workspace\Project\Compressed Black
and White Images\'],char(file_names{i}));
imwrite(BW,s3,type);
OriginalImage = OriginalImage + CalSize(s1);
CompressedImage = CompressedImage + CalSize(s2);
end
if OriginalImage ~= 0
CR = OriginalImage / CompressedImage;
OriginalImage = round(OriginalImage,1);
CompressedImage = round(CompressedImage,1);
CR = round(CR,2);
RD = 1 - (1/CR);
RD = RD * 100;
RD = round(RD,2);
disp('Images has been compressed successfuly.');
fprintf('\nTotal size of the original images is: %.1f
KB',OriginalImage);
fprintf('\nTotal size of the compressed images is: %.1f
KB\n',CompressedImage);
fprintf('Compression Ratio: %.2f',CR);
fprintf('\nRelative Data Redundancy: %.2f%%\n\n',RD);
else
uiwait(msgbox(['There are no ' type ' images in this
folder!!'],'','modal'));
end
case 5
break;
otherwise
Page | 6
uiwait(msgbox('Please Enter correct choice!!','','modal'));
end
end
disp('The Application is Closed!!');
close all;
DCT function:
function L = DCT(img)
I1 = img;
R = img(:,:,1);
I = im2double(R);
T = dctmtx(8);
B = blkproc(I,[8 8],'P1*x*P2',T,T');
mask = [1 1 1 1 0 0 0 0
1 1 1 0 0 0 0 0
1 1 0 0 0 0 0 0
1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0];
B2 = blkproc(B,[8 8],'P1.*x',mask);
I2 = blkproc(B2,[8 8],'P1*x*P2',T',T);
G = img(:,:,2);
I = im2double(G);
T = dctmtx(8);
B = blkproc(I,[8 8],'P1*x*P2',T,T');
mask = [1 1 1 1 0 0 0 0
1 1 1 0 0 0 0 0
1 1 0 0 0 0 0 0
1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0];
B2 = blkproc(B,[8 8],'P1.*x',mask);
I3 = blkproc(B2,[8 8],'P1*x*P2',T',T);
B = img(:,:,3);
I = im2double(B);
T = dctmtx(8);
B = blkproc(I,[8 8],'P1*x*P2',T,T');
mask = [1 1 1 1 0 0 0 0
1 1 1 0 0 0 0 0
1 1 0 0 0 0 0 0
1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0];
B2 = blkproc(B,[8 8],'P1.*x',mask);
I4 = blkproc(B2,[8 8],'P1*x*P2',T',T);
L(:,:,:) = cat(3,I2, I3, I4);
end
Page | 7
LBG function (LBG.m)
function out = LBG(A)
A = rgb2gray(A);
[row, col]=size(A);
N=row*col;
p=8;
n=p*p;
Nb=N/n;
Nc=64;
tSet=zeros(Nb,n);
indexCM=1;
for i= 1 : p : row
for j=1 : p : col
temp=blocImage(i,j,A(:,:),n,p);
for l = 1 : n
tSet(indexCM,l)=temp(1,l);
end
indexCM=indexCM+1;
end
end
temp=randi(Nb,1,Nc);
temp=double(temp);
codebook=zeros(Nc,n);
for i = 1 : Nc
for j=1 : n
codebook(i,j)=tSet( temp(1,i), j);
end
end
x=double(1);
distort_fact=1 ;
%tSet
iterations = 0;
while x > 0.0005
iterations = iterations+1;
distort_fact_prev=distort_fact;
%%creating Nc classes
%%Nb rows with n elements and Nc channels
container_cb=zeros(Nc,n);
%Maintains the upper filled limit of the container_class
count_container=ones(1,Nc);
%This stores the indices of the closest codevector present in codebook with
%a particular training vector
indexClosestMatch=zeros(1,Nb);
for i= 1 : Nb
index = ClosestMatch( tSet(i,:) , codebook(: , : ) );
indexClosestMatch(1,i)=index;
container_cb( index ,: ) =container_cb( index ,: ) + tSet(i,:);
count_container(1,index) = count_container(1,index) + 1;
end
%This updates the codebook using the container_cb
codebook=updateCodeBook(container_cb(:,:,:) , codebook(:,:) ,
count_container(:,:));
%This function updates the value of distortion factor
Page | 8
distort_fact=distortion(codebook(:,:) , indexClosestMatch(:,:) , tSet(:,:) )
;
%This calculates the converence of distortion factor
x=abs(distort_fact_prev - distort_fact);
x=x/distort_fact_prev;
end
%%creates the compressed image using codebook and indexClosestMatch
out = createCompressedImage(indexClosestMatch,codebook,A,p);
update code book function (updateCodeBook.m)
function y = updateCodeBook(container,cb,count)
[Nc, n]=size(container);
for i= 1: Nc
temp=zeros(1,n);
temp(1,:)=container(i,:);
temp = temp/count(1,i);
if all(temp == 0)
else
cb(i,:)=temp(1,:);
end
end
y=cb(:,:);
end
get closest match training vectors function (ClosestMatch.m)
function y = ClosestMatch(TV,cb)
[Nc, n] = size ( cb ) ;
index = 0 ;
dist = 2 ^ 32 ;
for i=1 : Nc
tempdist = 0 ;
for j= 1 : n
tempdist = tempdist + ( TV( 1 , j ) - cb( i , j ) ) ^ 2 ;
end
if dist > tempdist
dist = tempdist ;
index = i ;
end
end
y = index ;
end
distortion function (distortion.m)
function y = distortion(cb,indexClosestMatch,tset)
[Nb, n]=size(tset);
sum=0;
for i=1:Nb
for j=1:n
sum = sum + ( cb( indexClosestMatch( 1, i ), j ) - tset( i, j ) )^2;
end
end
sol = sum/(Nb*n);
y = sol;
end
Page | 9
obtain training vector function (blocImage.m)
function y = blocImage( i, j, A, n, p)
y = zeros(1, n);
k = 1;
for a = i : p+i-1
for b = j : j+p-1
y( 1, k ) = A( a, b );
k = k+1;
end
end
end
create compressed image function (createCompressedImage.m)
function out = createCompressedImage(indexClosestMatch,codebook,A,p)
[row ,col]=size(A);
B = zeros (row,col) ;
indexCM=1;
for i=1 : p : row
for j=1 : p :col
index=indexClosestMatch(1,indexCM);
l=1;
for k=0:p-1
for t=0:p-1
B(i+k,j+t)=codebook(index,l);
l = l + 1;
end
end
indexCM=indexCM+1;
end
end
out=uint8(B);
imwrite(B,'Compressed.jpg')
end
calculate image size function (CalSize.m)
function out = createCompressedImage(indexClosestMatch,codebook,A,p)
[row ,col]=size(A);
B = zeros (row,col) ;
indexCM=1;
for i=1 : p : row
for j=1 : p :col
index=indexClosestMatch(1,indexCM);
l=1;
for k=0:p-1
for t=0:p-1
B(i+k,j+t)=codebook(index,l);
l = l + 1;
end
end
indexCM=indexCM+1;
end
end
out=uint8(B);
imwrite(B,'Compressed.jpg')
Page | 10
end
average filter function (Filtering.m)
function f = Filtering(img)
f = img;
I = double(f);
for i=1:size(I,1)-2
for j=1:size(I,2)-2
Average =
round((I(i,j)+I(i+1,j)+I(i+2,j)+I(i,j+1)+I(i+1,j+1)+I(i+2,j+1)+I(i,j+2)+I(i+1
,j+2)+I(i+2,j+2))/9);
f(i,j) = Average;
end
end
end
function to obtain sharpened image using Laplacian filter
(Laplacian_sharpening.m)
function sh = Laplacian_sharpening(img)
A=img;
I1=A;
I=zeros(size(A));
F1=[0 1 0;
1 -4 1;
0 1 0];
A=padarray(A,[1,1]);
A=double(A);
for i=1:size(A,1)-2
for j=1:size(A,2)-2
I(i,j)=sum(sum(F1.*A(i:i+2,j:j+2)));
end
end
I=uint8(I);
sh = I1 - I;
end
logarithmic function (logarithmic.m)
function l = logarithmic(g)
g = im2double(g);
c=3;
[M,N]=size(g);
for x = 1:M
for y = 1:N
m=double(g(x,y));
l(x,y)=c.*log10(1+m);
end
end
end
power law transformation function (pwr_law_transformation.m)
function t = pwr_law_transformation(f)
f = im2double(f);
[m n]=size(f);
c = 1;
y=1.2;
Page | 11
for i=1:m
for j=1:n
t(i,j)=c*(f(i,j)^y);
end
end
end
4.0 TESTED IMAGES (STUDENTS PHOTOGRAPHS)
Type: jpg
Dimensions: 277 x 231
Size: 31.2 KB
Type: jpg
Dimensions: 348 x 321
Size: 40.7 KB
Type: jpg
Dimensions: 595 x 576
Size: 48.2 KB
Type: jpg
Dimensions: 329 x 286
Size: 33.9 KB
Type: jpg
Type: jpg
Type: jpg
Dimensions: 316 x 223 Dimensions: 465 x 366 Dimensions: 853 x 610
Size: 31.0 KB
Size: 44.1 KB
Size: 77.8 KB
Type: jpg
Type: jpg
Type: jpg
Type: jpg
Dimensions: 1538 x 1228 Dimensions: 496 x 436 Dimensions: 383 x 295 Dimensions: 595 x 688
Size: 42.8 KB
Size: 58.2 KB
Size: 716 KB
Size: 99.4 KB
Type: jpg
Dimensions: 288 x 239
Size: 36.1 KB
Type: jpg
Dimensions: 292 x 238
Size: 36.2 KB
Type: jpg
Dimensions: 329 x 271
Size: 33.7 KB
Type: jpg
Dimensions: 396 x 426
Size: 47.1 KB
Page | 12
5.0 Results & Discussion
5.1. Compression Algorithms Used
5.1.1. DCT
The full form of DCT is Discrete Cosine Transform. DCT is a lossless compression
technique applies a transformation to the image by converts the spatial domain into the frequency
domain [3].
The algorithm program of DCT works by reading the image and take the red color value of the
image then convert it to a double image matrix. Then Compute the two-dimensional DCT of 8by-8 blocks in the image using the function dctmtx which returns the N-by-N DCT transform
matrix [4]. After that, it will apply DCT on each block and design a filter to remove the
coefficients in a zig-zag manner [7]. The same procedure shall be applied to the green color
value and blue color value and then combine the output of the three-color components in one
image using the cat function.
5.1.2. LBG
The full form of LBG is Linde Buzo Gray. LBG is a lossy compression technique that
proposes a vector quantization algorithm based on a training sequence [5]. LBG is the most
popular approach for obtaining a vector quantizer codebook.
The codebook is a source input group in some vector to find the closest value with codebook
values. The set of quantizer output points is called a codebook of the quantizer. LBG is based on
a k-means algorithm that applies a clustering procedure to a large set of output vector called a
training set. K-means set an initial set of k representative patterns. This representative pattern is
updated by computing the centroid of training set vectors. In LBG the distortion from one
iteration to the next will not increase [6].
Page | 13
5.2. Running the Application
When running the application, the program will keep on asking the user to enter his/her choice
initially and after the finish from each operation until the user chooses the exit option to close the
application as shown in Figure 1.
Figure 1
The program shall display error messages as shown in Figure 2 whenever the user enters
incorrect choice.
Figure 2
Users can choose to select a sample image as shown in Figure 3 in order to apply low
compression (Lossless) and high compression (Lossy) test to the selected image.
Figure 3
Page | 14
After selecting an image and applying both compression methods, the program will display the
compressed images along with the size of images, compression ratio, relative data redundancy
and histogram as shown in Figure 4. Now the user can compare the results and decide what is the
best compression type to be applied for the Muscat College students’ photographs.
Figure 4
After decide which is the best compression method and choose the fourth option (Compress
Students Photographs), the program shall ask to select the type of images to be compressed and
then choose the compression type as shown in Figure 5 and Figure 6 in order to do bulk
processing to enhance and compress all photographs of the students.
Figure 5
Figure 6
When user select compression type, the program will compress and enhance all the images
which are stored in a folder called “Students Images” Figure 7 and then store the compressed
images in a folder called “Compressed Images”. Then will convert the compressed images into
black and white images and store them in folder called “Compressed Black and White Images”.
Page | 15
Figure 7
All compression progress will be shown in the command window as shown in Figure 8 and
Figure 9 to provide information to the user about which image is in compression progress in the
current time and how many images are compressed. Also, the program will display a success
message after finishing the progress and show the size of the images before and after
compression along with compression ratio and relative data redundancy.
Figure 8 Low Compression Results
Figure 9 High Compression Results
5.3. Compression Techniques (Results & Comparison)
Figure 10 shows the output of the compressed image using a low compression method
(Lossless). The images are compressed using the DCT algorithm, enhanced using the average
filter and resized to 524 x 524 x 3.
Page | 16
Figure 10
Figure 11 shows the output of the compressed image using a high compression method (Lossy).
The images are compressed using the LBG algorithm, enhanced using the average filter,
logarithmic, power law transformation and resized to 264 x 264.
Figure 11
Figure 12 shows the output of the compressed black and white image after applying low or high
compression method. The compressed images are converted into black and white.
Figure 12
In comparison, the lossless compression algorithm (DCT) has saved the color, quality, and
information of the images after compression as shown in Figure 10. On the other hand, the lossy
compression algorithm (LBG) has achieved a higher compression ratio and higher relative data
Page | 17
redundancy percentage and store the images in less storage as compare to lossless compression
as shown in Table 1 below.
Table 1 Lossless & Lossy Compression results
Compression Type
Lossless (DCT)
Lossy (LBG)
Original Images Size
1377.5 KB
1377.5 KB
Compressed Images Size
106.9 KB
82.8 KB
12.89
16.63
92.24%
93.99%
Result Type
Compression Ratio
Relative Data Redundancy
Lossy compression has saved the information of the images as shown in Figure 11. Although
Lossy compression did not save the color like lossless compression. However, Lossy
compression is the most appropriate compression technique to save Muscat College students’
photographs in less storage, because the main goal is to save the images in less storage where we
can recognize the faces in the future, but the color and the quality is not much important.
6.0 Conclusion
All in all, after developing the GUI application to find the best compression technique to store
Muscat College students' photographs in less storage, I concluded that:
•
In lossless compression, only the two-dimensional matrix M x N is affected but in lossy
compression, the three-dimensional matrix M x N x 3 is affected.
•
Lossless compression using the DCT algorithm is suitable to compress the image without
quality loss.
•
The compression techniques are very important to reduce utilized space in memory in
order to store more information.
•
Lossy compression using LBG is not suitable to save the color and quality of the images.
But is suitable to save the images in less space as compared to lossless compression.
•
Lossy compression using LBG is suitable for high-resolution images only, therefore
resizing the low-resolution image to the high resolution before compression is most.
•
Lossy compression is good to achieve a high compression ratio.
Page | 18
7.0 References
[1] Sachin Seth, “What are the advantages of digital image processing”, www.quora.com, Mar.
22, 2017. [online]. Available: https://www.quora.com/What-are-the-advantages-of-digitalimage-processing. [Accessed Oct. 19, 2019].
[2] Mary Meeker, “Internet Trends 2018”, www.kleinerperkin.com, May. 30, 2018. [online].
Available: https://www.kleinerperkins.com/files/INTERNET_TRENDS_REPORT_2018.pdf.
[Accessed January. 2, 2020].
[3] Shrenik Jain, “(DCT) Discrete Cosine Transform in image processing”, www.youtube.com,
December. 13, 2017. [online]. Available: https://youtu.be/tW3Hc0Wrgl0. [Accessed January. 3,
2020].
[4] MathWorks, “Discrete Cosine Transform”, www.mathworks.com. [online]. Available:
https://www.mathworks.com/help/images/discrete-cosine-transform.html. [Accessed January. 3,
2020].
[5] MathWorks, “IMAGE COMPRESSION USING LBG ALGORITHM”,
www.mathworks.com. [online]. Available:
https://www.mathworks.com/matlabcentral/fileexchange/10457-image-compression-using-lbgalgorithm. [Accessed January. 3, 2020].
[6] ITechnica, “Linde Buzo Gray (LBG) algorithm step by step with example”,
www.youtube.com, May. 1, 2018. [online]. Available: https://youtu.be/_S-5M8Zf6hc. [Accessed
January. 3, 2020].
[7] Dr.K.Somasundaram & Dr.T.Kalaiselvi, “Image Compression using Discrete Cosine
Transform(DCT) using MATLAB blockproc() Function”, www.researchgate.net, February. 23,
2015. [online]. Available:
https://www.researchgate.net/publication/272676573_Image_Compression_using_Discrete_Cosi
ne_TransformDCT_using_MATLAB_blockproc_Function. [Accessed January. 3, 2020].
Page | 19
[8] MathWorks, “How can I display image size, dimensions and color type in the GUI?”,
www.mathworks.com, Aug. 18, 2014. [online]. Available:
https://www.mathworks.com/matlabcentral/answers/151331-how-can-i-display-image-sizedimensions-and-color-type-in-the-gui. [Accessed December. 12, 2019].
[9] MathWorks, “msgbox”, www.mathworks.com. [online]. Available:
https://www.mathworks.com/help/matlab/ref/msgbox.html. [Accessed December. 12, 2019].
[10] MathWorks, “imresize”, www.mathworks.com. [online]. Available:
https://www.mathworks.com/help/images/ref/imresize.html. [Accessed December. 12, 2019].
[11] Ulmer Louis, “Image-Compression-Using-Vector-Quantization-with-LBG-algorithm”,
getlab.insa-rouen.fr. [online]. Available: https://gitlab.insarouen.fr/lulmer/ASI4_LouisULMER/tree/2f2582aeb2d10a136c3259e5e26513416005b28e/TI/pr
ojet_quantification/partie_vectorielle. [Accessed January. 2, 2020].
[12] MathWorks, “How to round a result to two decimal places”, www.mathworks.com, Oct. 24,
2016. [online]. Available: https://www.mathworks.com/matlabcentral/answers/308927-how-toround-a-result-to-two-decimal-places. [Accessed January. 3, 2020].
[13] MathWorks, “How do I print a "%" when using fprintf?”, www.mathworks.com, Mars. 26,
2019. [online]. Available: https://www.mathworks.com/matlabcentral/answers/452606-how-doi-print-a-when-using-fprintf. [Accessed January. 3, 2020].
[14] MathWorks, “im2bw”, www.mathworks.com. [online]. Available:
https://www.mathworks.com/help/images/ref/im2bw.html. [Accessed January. 5, 2020].
Page | 20