Example #1
0
        //FUNCTIONS
        /**
         * Runs all the benchmarking tests.
         *
         * @param original The original image to compare against.
         * @param stego The stego image to test.
         * @return All the results as text.
         * @throws IllegalArgumentException If the stego image is null.
         * @throws Exception If it has problems reading the images.
         */
        public string Run(Bitmap original, Bitmap stego)
        {
            if (original == null)
                throw new ArgumentNullException(nameof(original));
            if (stego == null)
                throw new ArgumentNullException(nameof(stego));

            //setup temp variables
            Analysis bench;
            mResultsString = "Results of benchmark tests\n"
                             + "==========================\n\n";

            //run all the tests...
            if (mRunAverageAbsoluteDifference)
            {
                bench = new AverageAbsoluteDifference();
                mResultsString = mResultsString
                                 + bench
                                 + ": "
                                 + bench.Calculate(original, stego)
                                 + "\n";
            }
            if (mRunMeanSquaredError)
            {
                bench = new MeanSquaredError();
                mResultsString = mResultsString
                                 + bench
                                 + ": "
                                 + bench.Calculate(original, stego)
                                 + "\n";
            }
            if (mRunLpNorm)
            {
                bench = new LpNorm();
                mResultsString = mResultsString
                                 + bench
                                 + ": "
                                 + bench.Calculate(original, stego)
                                 + "\n";
            }
            if (mRunLaplacianMeanSquaredError)
            {
                bench = new LaplacianMeanSquaredError();
                mResultsString = mResultsString
                                 + bench
                                 + ": "
                                 + bench.Calculate(original, stego)
                                 + "\n";
            }
            if (mRunSignalToNoiseRatio)
            {
                bench = new SignalToNoiseRatio();
                mResultsString = mResultsString
                                 + bench
                                 + ": "
                                 + bench.Calculate(original, stego)
                                 + "\n";
            }
            if (mRunPeakSignalToNoiseRatio)
            {
                bench = new PeakSignalToNoiseRatio();
                mResultsString = mResultsString
                                 + bench
                                 + ": "
                                 + bench.Calculate(original, stego)
                                 + "\n";
            }
            if (mRunNormalisedCrossCorrelation)
            {
                bench = new NormalizedCrossCorrelation();
                mResultsString = mResultsString
                                 + bench
                                 + ": "
                                 + bench.Calculate(original, stego)
                                 + "\n";
            }
            if (mRunCorrelationQuality)
            {
                bench = new CorrelationQuality();
                mResultsString = mResultsString
                                 + bench
                                 + ": "
                                 + bench.Calculate(original, stego)
                                 + "\n";
            }

            return mResultsString;
        }
Example #2
0
        //FUNCTIONS

        /**
         * Runs all the benchmarking tests.
         *
         * @param original The original image to compare against.
         * @param stego The stego image to test.
         * @return All the results as text.
         * @throws IllegalArgumentException If the stego image is null.
         * @throws Exception If it has problems reading the images.
         */

        public string Run(Bitmap original, Bitmap stego)
        {
            if (original == null)
            {
                throw new ArgumentNullException(nameof(original));
            }
            if (stego == null)
            {
                throw new ArgumentNullException(nameof(stego));
            }

            //setup temp variables
            Analysis bench;

            mResultsString = "Results of benchmark tests\n"
                             + "==========================\n\n";


            //run all the tests...
            if (mRunAverageAbsoluteDifference)
            {
                bench          = new AverageAbsoluteDifference();
                mResultsString = mResultsString
                                 + bench
                                 + ": "
                                 + bench.Calculate(original, stego)
                                 + "\n";
            }
            if (mRunMeanSquaredError)
            {
                bench          = new MeanSquaredError();
                mResultsString = mResultsString
                                 + bench
                                 + ": "
                                 + bench.Calculate(original, stego)
                                 + "\n";
            }
            if (mRunLpNorm)
            {
                bench          = new LpNorm();
                mResultsString = mResultsString
                                 + bench
                                 + ": "
                                 + bench.Calculate(original, stego)
                                 + "\n";
            }
            if (mRunLaplacianMeanSquaredError)
            {
                bench          = new LaplacianMeanSquaredError();
                mResultsString = mResultsString
                                 + bench
                                 + ": "
                                 + bench.Calculate(original, stego)
                                 + "\n";
            }
            if (mRunSignalToNoiseRatio)
            {
                bench          = new SignalToNoiseRatio();
                mResultsString = mResultsString
                                 + bench
                                 + ": "
                                 + bench.Calculate(original, stego)
                                 + "\n";
            }
            if (mRunPeakSignalToNoiseRatio)
            {
                bench          = new PeakSignalToNoiseRatio();
                mResultsString = mResultsString
                                 + bench
                                 + ": "
                                 + bench.Calculate(original, stego)
                                 + "\n";
            }
            if (mRunNormalisedCrossCorrelation)
            {
                bench          = new NormalizedCrossCorrelation();
                mResultsString = mResultsString
                                 + bench
                                 + ": "
                                 + bench.Calculate(original, stego)
                                 + "\n";
            }
            if (mRunCorrelationQuality)
            {
                bench          = new CorrelationQuality();
                mResultsString = mResultsString
                                 + bench
                                 + ": "
                                 + bench.Calculate(original, stego)
                                 + "\n";
            }


            return(mResultsString);
        }