-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathQuality_Measures.m
More file actions
34 lines (23 loc) · 1.2 KB
/
Quality_Measures.m
File metadata and controls
34 lines (23 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
function [] = Quality_Measures(Query_Image, Final_Image)
disp('Calculating quality measures...');
% Ensure the images are of the same type
Query_Image = im2double(Query_Image);
Final_Image = im2double(Final_Image);
% ---------------------------- SNR ------------------------------
SNR_Value = snr(Query_Image, Query_Image - Final_Image);
fprintf('Signal-to-Noise Ratio between original and reproduction image: %d\n', SNR_Value);
% ---------------------------- MSE ------------------------------
MSE_Value = immse(Query_Image, Final_Image);
fprintf('Mean Squared Error between original and reproduction image: %d\n', MSE_Value);
% -------------------------- S-CIELAB ---------------------------
ppi = 132; % 15 tum, 1680 x 1050 (Macbook pro 15 inch 2019)
d = 20; % 20 inches from screen
sampPerDeg = ppi * d * tan(pi/180);
whitepoint = [95.05, 100, 108.9];
format = 'xyz';
Query_Image_CIEXYZ = rgb2xyz(Query_Image);
Final_Image_CIEXYZ = rgb2xyz(Final_Image);
S_CIELAB_Value = scielab(sampPerDeg, Query_Image_CIEXYZ, Final_Image_CIEXYZ, whitepoint, format);
Result_S_CIELAB_Value = mean(mean(S_CIELAB_Value));
fprintf('S_CIELAB value between original and reproduction image: %d\n', Result_S_CIELAB_Value);
end