コード例 #1
0
        public void DCT_Insertion_Test()
        {
            var bmap = new Bitmap(inputImagePath);

            double[] pixelArray = getPixelArray(bmap);

            IDCT dct = DCT.CreateParallelDCT();

            double[] forward = dct.Forward(pixelArray);

            double[] signal = Enumerable.Repeat(0d, 5000).ToArray();

            signal[3000] = 750;
            var insert_point = 30000;
            var fSignal      = dct.Forward(signal);

            for (int i = insert_point; i < insert_point + fSignal.Length; i++)
            {
                forward[i] += fSignal[i - insert_point];
            }

            var output = setPixelMatrix(bmap, dct.Backward(forward));

            output.Save(outputImagePath);
        }
コード例 #2
0
        public void DCT_Back_Fort_Test()
        {
            var bmap = new Bitmap(inputImagePath);

            double[] pixelArray = getPixelArray(bmap);

            IDCT dct = DCT.CreateParallelDCT();

            var output = setPixelMatrix(bmap, dct.Backward(dct.Forward(pixelArray)));

            output.Save(outputImagePath);
        }
コード例 #3
0
        public void DCT_detection_Test()
        {
            var bmap = new Bitmap(inputImagePath);

            double[] pixelArray = getPixelArray(bmap);

            IDCT dct = DCT.CreateParallelDCT();

            double[]  forward    = dct.Forward(pixelArray);
            const int signalSize = 5000;

            double[] signal = Enumerable.Repeat(0d, signalSize).ToArray();

            signal[3000] = 750;
            var insert_point = 30000;
            var fSignal      = dct.Forward(signal);

            for (int i = insert_point; i < insert_point + fSignal.Length; i++)
            {
                forward[i] += fSignal[i - insert_point];
            }

            var output = setPixelMatrix(bmap, dct.Backward(forward));

            output.Save(outputImagePath);

            var bmapMarked = new Bitmap(outputImagePath);

            var forwardedMarked = dct.Forward(getPixelArray(bmapMarked));

            double[] extractedSignal = Enumerable.Repeat(0d, signalSize).ToArray();

            for (int i = insert_point; i < insert_point + fSignal.Length; i++)
            {
                extractedSignal[i - insert_point] = Math.Abs(forward[i] - forwardedMarked[i]);
            }

            var bacwardextractedSignal = dct.Backward(extractedSignal);

            var mean = bacwardextractedSignal.Sum() / bacwardextractedSignal.Length;

            Console.WriteLine(mean);
        }