Example details.
clear all;
clc;
close all;
imagePath = 'Ber256.jpg';
blockWidth = 8;
publicKey = 17;
rotate = 1;
Example using method 1) (DCT Approach for the image approximation)
method1 = 'DCT';
PSNR = 40.17;
privateKey1 = 987654321;
tic;
[mFoldedImage, cIndex, mImage, maxIntensity ] = ...
FoldImage(imagePath, method1, PSNR, blockWidth,publicKey,privateKey1,rotate);
saveImagePath1 = ['folded_', method1 '.jpg'];
SaveImage(mFoldedImage,saveImagePath1,maxIntensity);
privateKey2 = 123456789;
mLoadedImageDCT = double(imread(saveImagePath1));
mRecoveredImageDCT1 = ExpandImage(mLoadedImageDCT, cIndex, method1, blockWidth, publicKey, privateKey2, rotate);
timeDCT = toc;
PSNR1 = CalcPSNR(mImage,mRecoveredImageDCT1);
fprintf('PSNR in recovery with INCORRECT key: %.2f\n',PSNR1);
privateKey1 = 987654321;
mRecoveredImageDCT2 = ExpandImage(mLoadedImageDCT, cIndex, method1, blockWidth, publicKey, privateKey1, rotate);
PSNR2 = CalcPSNR(mImage,mRecoveredImageDCT2);
fprintf('PSNR in recovery with the CORRECT key: %.2f\n',PSNR2);
FoldImage Routine Called
************************
Approximation Processing Ber256.jpg in blocks of 8x8 pixels using DCT
*********************************************************************
Approximation time: 0.47 seconds
PSNR in approximation: 40.3156 dB for an SR of 2.9113
Folding
*******
Time: 0.86 seconds
ExpandImage Routine Called
**************************
Time to seperate the embedded image (F) from the host image: 1.42 seconds
Time to reconstruct the rest of the image: 0.02 seconds
PSNR in recovery with INCORRECT key: 8.54
ExpandImage Routine Called
**************************
Time to seperate the embedded image (F) from the host image: 1.68 seconds
Time to reconstruct the rest of the image: 0.02 seconds
PSNR in recovery with the CORRECT key: 40.11
Example using method 2) (RDCDB Approach for the image approximation)
method2 = 'RDCTDB';
saveImagePath2 = ['folded_', method2 '.jpg'];
PSNR = 40.57;
privateKey1 = 987654321;
tic
[ mFoldedImage, cIndex, mImage, maxIntensity ] = ...
FoldImage(imagePath, method2, PSNR, blockWidth,publicKey,privateKey1,rotate);
SaveImage(mFoldedImage,saveImagePath2,maxIntensity);
privateKey2 = 123456789;
mLoadedImageRDCTDB = double(imread(saveImagePath2));
mRecoveredImageRDCTDB1 = ExpandImage(mLoadedImageRDCTDB, cIndex, method2, blockWidth, publicKey, privateKey2, rotate);
PSNR1 = CalcPSNR(mImage,mRecoveredImageRDCTDB1);
fprintf('PSNR in recovery with an INCORRECT key: %.2f\n',PSNR1);
timeRDCTDB = toc;
privateKey1 = 987654321;
mRecoveredImageRDCTDB2 = ExpandImage(mLoadedImageRDCTDB, cIndex, method2, blockWidth, publicKey, privateKey1, rotate);
PSNR2 = CalcPSNR(mImage,mRecoveredImageRDCTDB2);
fprintf('PSNR in recovery with the CORRECT key: %.2f\n',PSNR2);
FoldImage Routine Called
************************
Approximation Processing Ber256.jpg in blocks of 8x8 pixels using RDCTDB
************************************************************************
Approximation time: 6.2 seconds
Approximaton time can be reduced by up to 10 times by using the RDCDBMex option!
PSNR in approximation: 40.8833 dB for an SR of 4.5717
Folding
*******
Time: 0.51 seconds
ExpandImage Routine Called
**************************
Time to seperate the embedded image (F) from the host image: 1.30 seconds
Time to reconstruct the rest of the image: 0.02 seconds
PSNR in recovery with an INCORRECT key: 7.44
ExpandImage Routine Called
**************************
Time to seperate the embedded image (F) from the host image: 1.62 seconds
Time to reconstruct the rest of the image: 0.02 seconds
PSNR in recovery with the CORRECT key: 40.67
Example using method 2) (RDCDB Approach for the image approximation using OMP2D.mex)
method2 = 'RDCTDBMex';
FoldImage Routine Called
************************
Approximation Processing Ber256.jpg in blocks of 8x8 pixels using RDCTDBMex
***************************************************************************
Approximation time: 0.58 seconds
PSNR in approximation: 40.8833 dB for an SR of 4.5717
Folding
*******
Time: 0.47 seconds
ExpandImage Routine Called
**************************
Time to seperate the embedded image (F) from the host image: 1.30 seconds
Time to reconstruct the rest of the image: 0.02 seconds
PSNR in recovery with an INCORRECT key: 7.44
ExpandImage Routine Called
**************************
Time to seperate the embedded image (F) from the host image: 1.62 seconds
Time to reconstruct the rest of the image: 0.02 seconds
PSNR in recovery with the CORRECT key: 40.67
Display processing time;
PrintWithStars('Processing Time');
fprintf('Time for %s: %.2f seconds\n',method1,timeDCT);
fprintf('Time for %s: %.2f seconds\n',method2,timeRDCTDB);
Processing Time
***************
Time for DCT: 2.52 seconds
Time for RDCTDB: 7.43 seconds
Time for RDCTDBMex: 1.47 seconds
Display images
MakeFigures(mImage,mLoadedImageDCT,mRecoveredImageDCT1,mRecoveredImageDCT2,method1,maxIntensity);
MakeFigures(mImage,mLoadedImageRDCTDB,mRecoveredImageRDCTDB1,mRecoveredImageRDCTDB2,method2,maxIntensity);