clear all;
clear classes;
clc;


referenceimages=ReferenceImageCollection('*.png');
coders=ImageCoderCollection;

jpeg_params.quality=[10 30 50];
jpeg2000_params.compressionratio=[10 500 1000];

coders.add('JPEG',jpeg_params);
coders.add('JPEG2000',jpeg2000_params);

imagemetrics=ImageMetricsCollection;
imagemetrics.add('PSNR');
imagemetrics.add('SSIM');

CompressedImages=coders.proc(referenceimages);
CompressedImages.addmetrics(imagemetrics);
CompressedImages.calcmetrics;

CompressedImages.fcc;

[refdata,matdata]=CompressedImages.makestatistics;
save(sprintf('refdata_matdata_image_%d.mat',...
    round(10000*rand)),'refdata','matdata');

makeplots(0,'refdata_matdata_image*.mat');