Exemplo n.º 1
0
        /// <summary>
        /// Finding Forward FFT of Selected Bitmap
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            //1. Create FFT Object
            ImgFFT = new FFT(bmp);

            ImgFFT.ForwardFFT();// Finding 2D FFT of Image
            ImgFFT.FFTShift();
            ImgFFT.FFTPlot(ImgFFT.FFTShifted);
            FourierMag.Image   = (Image)ImgFFT.FourierPlot;
            FourierPhase.Image = (Image)ImgFFT.PhasePlot;



            //InvFourier.Image = (Image)ImgFFT.Displayimage();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Finding Forward FFT of Selected Bitmap
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            //1. Create FFT Object
            ImgFFT = new FFT(bmp);

            ImgFFT.ForwardFFT();        // Finding 2D FFT of Image
            ImgFFT.FFTShift();
            for (int i = 0; i < 255; i++)
            {
                for (int j = 0; j < 255; j++)
                {
                    Out1[i, j] = ImgFFT.FFTShifted[i, j];
                    // OutReal[i, j] = (int)ImgFFT.FFTShifted[i, j].real;
                    // OutImag[i, j] = (int)ImgFFT.FFTShifted[i, j].imag;
                }
            }

            ImgFFT.FFTPlot(ImgFFT.FFTShifted);

            //ImgFFT.InverseFFT();
            for (int i = 0; i < 255; i++)
            {
                for (int j = 0; j < 255; j++)
                {
                    M1[i, j] = ImgFFT.PhasePlot1[i, j];
                    P1[i, j] = ImgFFT.MagniturePlot1[i, j];
                }
            }
            furiebox1.Image = (Image)ImgFFT.Displayimage(P1);
            //   Dehologram.Image = (Image)ImgFFT.Obj;
            // Dehologram.Image = (Image)ImgFFT.Displayimage(OutReal);

            //furiebox1.Image = (Image)ImgFFT.Displayimage(OutImag);



            ImgFFT = new FFT(bmp1);
            ImgFFT.ForwardFFT();// Finding 2D FFT of Image
            ImgFFT.FFTShift();
            for (int i = 0; i < 255; i++)
            {
                for (int j = 0; j < 255; j++)
                {
                    Out2[i, j] = ImgFFT.FFTShifted[i, j];
                }
            }

            ImgFFT.FFTPlot(ImgFFT.FFTShifted);



            for (int i = 0; i < 255; i++)
            {
                for (int j = 0; j < 255; j++)
                {
                    M2[i, j] = ImgFFT.PhasePlot1[i, j];
                    P2[i, j] = ImgFFT.MagniturePlot1[i, j];
                }
            }
            furiebox2.Image = (Image)ImgFFT.Displayimage(P2);



            ImgFFT = new FFT(bmp3);

            ImgFFT.ForwardFFT();// Finding 2D FFT of Image
            ImgFFT.FFTShift();
            for (int i = 0; i < 255; i++)
            {
                for (int j = 0; j < 255; j++)
                {
                    Out3[i, j] = ImgFFT.FFTShifted[i, j];
                }
            }


            ImgFFT.FFTPlot(ImgFFT.FFTShifted);


            for (int i = 0; i < 255; i++)
            {
                for (int j = 0; j < 255; j++)
                {
                    keyP[i, j] = ImgFFT.PhasePlot1[i, j];

                    keyM[i, j] = ImgFFT.MagniturePlot1[i, j];
                }
            }



            kMag.Image = (Image)ImgFFT.Displayimage(keyM);
        }