calibrationIm = 's1500.raw';
J = rawImport(calibrationIm);
dJ = uint8(demosaicing_v2(double(J),'gradient'));
saveas(gcf,'Histogram_Demosaicked.png')
saveas(gcf,'Image_Demosicked.png')
[dchart, dcolorTable, dccm] = calChartMeasure(dJ);
saveas(gcf,'Raw Chart Location.png')
displayColorPatch(dcolorTable);
saveas(gcf,'Raw Delta E values.png')
plotChromaticity(dcolorTable)
saveas(gcf,'Chromaticity Before Correction.png')
saveas(gcf,'Image_GammaCorrected.png')
[gchart, gcolorTable, gccm] = calChartMeasure(gJ);
saveas(gcf,'Gamma Chart Location.png')
displayColorPatch(gcolorTable);
saveas(gcf,'Gamma Delta E values.png')
plotChromaticity(gcolorTable)
saveas(gcf,'Chromaticity After Gamma.png')
ccJ = imapplymatrix(gccm(1:3,:)',gJ,gccm(4,:));
saveas(gcf,'Image_ColorCorrected.png')
[ccchart, cccolorTable, ccccm] = calChartMeasure(ccJ);
saveas(gcf,'CCM Chart Location.png')
displayColorPatch(cccolorTable);
saveas(gcf,'CCM Delta E values.png')
plotChromaticity(cccolorTable)
saveas(gcf,'Chromaticity After CCM.png')
delE = mean(cccolorTable.Delta_E);