1 % =================================================================
\r
2 % Sparse Feature Fidelity (SFF)
\r
4 % Copyright(c) 2013 Hua-wen Chang
\r
5 % All Rights Reserved.
\r
6 % ----------------------------------------------------------------------
\r
7 % Please refer to the following paper
\r
9 % Hua-wen Chang, Hua Yang, Yong Gan, and Ming-hui Wang, "Sparse Feature Fidelity
\r
10 % for Perceptual Image Quality Assessment", IEEE Transactions on Image Processing,
\r
11 % vol. 22, no. 10, pp. 4007-4018, October 2013
\r
12 % ----------------------------------------------------------------------
\r
13 % =================================================================
\r
14 function [OB,metrics] = LIVE()
\r
16 load('LIVE.mat'); % load database information and DMOS data
\r
17 load('W.mat'); % load the feature detector, W
\r
19 Score = zeros(779,1);
\r
20 h = waitbar(0,'Please wait...');
\r
23 if (live_imSTD(iPoint) == 0)
\r
26 %READ A REFERENCE IMAGE
\r
27 Ir = imread(['D:\IMDB\databaserelease2\refimgs\' live_imName{iPoint}]);
\r
29 %READ A DISTORTED IMAGE
\r
30 if (iPoint > 0)&&(iPoint <= 227) % JPEG2000
\r
31 Id = imread(['D:\IMDB\databaserelease2\jp2k\img' num2str(iPoint) '.bmp']);
\r
32 elseif (iPoint > 227)&&(iPoint <= 460) % JPEG
\r
33 Id = imread(['D:\IMDB\databaserelease2\jpeg\img' num2str(iPoint-227) '.bmp']);
\r
34 elseif (iPoint > 460)&&(iPoint <= 634) % White Noise
\r
35 Id = imread(['D:\IMDB\databaserelease2\wn\img' num2str(iPoint-460) '.bmp']);
\r
36 elseif (iPoint > 634)&&(iPoint <= 808) % Gaussian Blur
\r
37 Id = imread(['D:\IMDB\databaserelease2\gblur\img' num2str(iPoint-634) '.bmp']);
\r
38 elseif (iPoint > 808)&&(iPoint <= 982) % Fast Fading
\r
39 Id = imread(['D:\IMDB\databaserelease2\fastfading\img' num2str(iPoint-808) '.bmp']);
\r
42 Score(i) = SFF(Ir,Id,W);
\r
44 waitbar(iPoint/982);
\r
48 SB = live_imDMOS; % Subjective Score
\r
49 OB = Score; % Objective Score
\r
51 metric_1 = corr(SB, OB, 'type', 'pearson'); % Pearson linear correlation coefficient (without mapping)
\r
52 metric_2 = corr(SB, OB, 'type', 'spearman'); % Spearman rank-order correlation coefficient
\r
53 metric_3 = corr(SB, OB, 'type', 'kendall'); % Kendall rank-order correlation coefficient
\r
54 metrics = [metric_1;metric_2;metric_3];
\r
55 figure,scatter(OB,SB,'*');
\r