Esempio n. 1
0
        private void RevreseFFT_Click(object sender, EventArgs e)
        {
            ImgFFT.InverseFFT(outtut);

            ImgFFT.InverseFFT(outtut);
            ImgFFT.InverseFFT(outtut);


            Dehologram.Image = (Image)ImgFFT.Obj;

            //Dehologram.Image = (Image)ImgFFT.Displayimage(output);

            /*
             *          ImgFFT = new FFT(mtwithKey);
             *
             *          ImgFFT.ForwardFFT();// Finding 2D FFT of Image
             *
             *
             *          ImgFFT.FFTShift();
             *          ImgFFT.FFTPlot(ImgFFT.FFTShifted);
             *          ImgFFT.InverseFFT();
             *          Dehologram.Image = (Image)ImgFFT.Obj;
             */
        }
Esempio n. 2
0
 private void button2_Click(object sender, EventArgs e)
 {
     //ImgFFT.RemoveFFTShift();
     ImgFFT.InverseFFT();
     InvFourier.Image = (Image)ImgFFT.Obj;
 }
Esempio n. 3
0
        private void button3_Click(object sender, EventArgs e)
        {
            //1. Create FFT Object
            FFT FourObj;

            FourObj = new FFT(bmp);
            FourObj.ForwardFFT();// Finding 2D FFT of Image

            FFT FourRef1;

            FourRef1 = new FFT(bmp1);
            FourRef1.ForwardFFT();// Finding 2D FFT of Image

            FFT FourRef2;

            FourRef2 = new FFT(bmp3);
            FourRef2.ForwardFFT();// Finding 2D FFT of Image

            FFT outTmp;

            outTmp = new FFT(bmp);



            //////////////////////////////////////////
            for (int i = 0; i < 255; i++)
            {
                for (int j = 0; j < 255; j++)
                {
                    outnew[i, j].real = FourObj.Output[i, j].real * FourRef1.Output[i, j].real * FourRef2.Output[i, j].real - FourObj.Output[i, j].imag * FourRef1.Output[i, j].real * FourRef2.Output[i, j].imag +
                                        FourObj.Output[i, j].real * FourRef1.Output[i, j].imag * FourRef2.Output[i, j].imag + FourObj.Output[i, j].imag * FourRef1.Output[i, j].imag * FourRef2.Output[i, j].real;
                    outnew[i, j].imag = FourObj.Output[i, j].real * FourRef1.Output[i, j].real * FourRef2.Output[i, j].imag + FourObj.Output[i, j].imag * FourRef1.Output[i, j].real * FourRef2.Output[i, j].real -
                                        FourObj.Output[i, j].real * FourRef1.Output[i, j].imag * FourRef2.Output[i, j].real + FourObj.Output[i, j].imag * FourRef1.Output[i, j].imag * FourRef2.Output[i, j].imag;
                }
            }

            outTmp.InverseFFT(outnew);

            //  Dehologram.Image = (Image)ImgFFT.Obj;


            int[,] FFTNormalized = new int[256, 256];

            double max = (outnew[0, 0].real * outnew[0, 0].real + outnew[0, 0].imag * outnew[0, 0].imag);

            for (int i = 0; i <= 255; i++)
            {
                for (int j = 0; j <= 255; j++)
                {
                    if ((outnew[i, j].real * outnew[i, j].real + outnew[i, j].imag * outnew[i, j].imag) > max)//Math.Log
                    {
                        max = (outnew[i, j].real * outnew[i, j].real + outnew[i, j].imag * outnew[i, j].imag);
                    }
                }
            }
            for (int i = 0; i <= 255; i++)
            {
                for (int j = 0; j <= 255; j++)
                {
                    /*   FFTLog[i, j] = FFTLog[i, j] / max;
                     * }
                     * for (i = 0; i <= Width - 1; i++)
                     * for (j = 0; j <= Height - 1; j++)
                     * {*/
                    FFTNormalized[i, j] = (int)(255 * (outnew[i, j].real * outnew[i, j].real + outnew[i, j].imag * outnew[i, j].imag) / max);
                }
            }
            //Transferring Image to Fourier Plot
            //  FourierPlot = Displayimage(FFTNormalized);
            Dehologram.Image = (Image)ImgFFT.Displayimage(FFTNormalized);

            ////////////////////////////////////////////////
        }