clear;
fl=dir('fcc_data*.mat');
nf=length(fl);


jpeg_scores=[];
jpeg2000_scores=[];
for iif=1:length(fl),
    load(fl(iif).name);
    jpeg_scores=[jpeg_scores jpeg_data(:,4)];
    jpeg2000_scores=[jpeg2000_scores jpeg2000_data(:,4)];
end


jpeg_std=std(jpeg_scores,0,2);
jpeg2000_std=std(jpeg2000_scores,0,2);

jpeg_mean=mean(jpeg_scores,2);
jpeg2000_mean=mean(jpeg2000_scores,2);

jpeg_scores=[jpeg_mean-jpeg_std jpeg_mean jpeg_mean+jpeg_std];
jpeg2000_scores=[jpeg2000_mean-jpeg2000_std jpeg2000_mean jpeg2000_mean+jpeg2000_std];


figure(1),
subplot(2,2,1),
plot(jpeg_data(:,2),jpeg_data(:,3),'*:'),xlabel('SSIM'),ylabel('PSNR');title('JPEG');
subplot(2,2,2),
plot(jpeg_data(:,2),jpeg_scores,'*:'),xlabel('SSIM'),ylabel('Scores');title('JPEG');
subplot(2,2,3),
plot(jpeg_data(:,3),jpeg_scores,'*:'),xlabel('PSNR'),ylabel('Scores');title('JPEG');


figure(2),
subplot(2,2,1),
plot(jpeg2000_data(:,2),jpeg2000_data(:,3),'*:'),xlabel('SSIM'),ylabel('PSNR');title('JPEG2000');
subplot(2,2,2),
plot(jpeg2000_data(:,2),jpeg2000_scores,'*:'),xlabel('SSIM'),ylabel('Scores');title('JPEG2000');
subplot(2,2,3),
plot(jpeg2000_data(:,3),jpeg2000_scores,'*:'),xlabel('PSNR'),ylabel('Scores');title('JPEG2000');

figure(3),
ciplot(jpeg_scores(:,1),jpeg_scores(:,3),jpeg_data(:,1),'r'); hold on; alpha 0.5
%plot(jpeg_data(:,1),jpeg_scores(:,2),'k-'); hold on;

ciplot(jpeg2000_scores(:,1),jpeg2000_scores(:,3),jpeg2000_data(:,1),'b'); hold on; alpha 0.5
%plot(jpeg2000_data(:,1),jpeg2000_scores(:,2),'k-'); hold on;
xlabel('File size'),ylabel('Score'),legend('JPEG','JPEG2000');


figure(4),
ciplot(jpeg_scores(:,1),jpeg_scores(:,3),jpeg_data(:,2),'r'); hold on; alpha 0.5
ciplot(jpeg2000_scores(:,1),jpeg2000_scores(:,3),jpeg2000_data(:,2),'b'); hold on; alpha 0.5
xlabel('SSIM'); ylabel('Scores');
legend('JPEG','JPEG2000');

figure(5),
ciplot(jpeg_scores(:,1),jpeg_scores(:,3),jpeg_data(:,3),'r'); hold on; alpha 0.5
ciplot(jpeg2000_scores(:,1),jpeg2000_scores(:,3),jpeg2000_data(:,3),'b'); hold on; alpha 0.5
xlabel('PSNR'); ylabel('Scores');
legend('JPEG','JPEG2000');



