%
% New 3DQA
%
close all;
clear all;

load('ietr_dibr_data.mat');
 
% Read all file names
path = 'E:\3D Datasets\IETR_DIBR_Database\IETR_DIBR_database_PNG';
pathDepth = 'E:\3D Datasets\IETR_DIBR_Database\IETR_DIBR_database_original_texture_depth_images';

nImages = 140; 

score = double(zeros(nImages,1));
mos = double(zeros(nImages,1));
Q1 = double(zeros(nImages,1));
Q2 = double(zeros(nImages,1));

%% Read image and comput mean PC
% parfor i=1:nImages
for i=1:nImages
    % Read the rendered and reference views
    imDis = imread(strcat(path, '\', ietr_dibr_fname{i}));
    
    imOrg = imread(strcat(path, '\', ietr_dibr_refname{i})); 
    
    imDepth = imread(strcat(pathDepth, '\', ietr_dibr_ref_depth_fname{i}));
        
    % 3DLQM
    [Q1(i), Q2(i)] = LQMScore( imOrg, imDis, imDepth );
    score(i) = Q1(i)*0.6 + Q2(i)*0.4;
    
   
    mos(i) = ietr_dibr_dmos(i);
    
    fprintf('image: %d, Score: %f, MOS: %4.4f, %s, %s\n', i, score(i), mos(i), ietr_dibr_fname{i}, ietr_dibr_refname{i});
    
end

x = mos;
y = score;
Regression_Farid;
