AForge.NET

  :: AForge.NET Framework :: Articles :: Forums ::

Why is AForge.net giving a different output in case of FFT A

The forum is to discuss topics related to different areas of image processing and computer vision.

Why is AForge.net giving a different output in case of FFT A

Postby edurazee » Wed Jul 25, 2018 6:41 pm

See this rhttps://stackoverflow.com/q/38709810/159072.

I want to obtain the same outcome using AForge.net framework. The output should match the following:

Image

The output seems to be not coming as expected:

Image

Why is the output different in AForge.net?

.


Source Code

Code: Select all
public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

            Bitmap image = (Bitmap)Bitmap.FromFile(@"StandardImage\\lena.png");
            Bitmap conv = new Bitmap(image.Width, image.Height, image.PixelFormat);

            ComplexImage cImage = ComplexImage.FromBitmap(image);
            cImage.ForwardFourierTransform();

            ComplexImage cKernel = ComplexImage.FromBitmap(image);
            cImage.ForwardFourierTransform();

            ComplexImage convOut = ComplexImage.FromBitmap(conv);
            convOut.ForwardFourierTransform();

            for (int y = 0; y < cImage.Height; y++)
            {
                for (int x = 0; x < cImage.Width; x++)
                {
                    convOut.Data[x, y] = cImage.Data[x, y] * cKernel.Data[x, y];
                }
            }

            convOut.BackwardFourierTransform();

            Bitmap bbbb = convOut.ToBitmap();

            pictureBox1.Image = bbbb;

        }
    }
edurazee
 
Posts: 13
Joined: Sat Dec 03, 2016 10:06 am



Return to Image Processing and Computer Vision