private void btFFTNormal_Click(object sender, EventArgs v) { Bitmap image = new Bitmap(pbSource.Image); var bmp8bpp = Grayscale.CommonAlgorithms.BT709.Apply(image); AForge.Imaging.ComplexImage cimage = AForge.Imaging.ComplexImage.FromBitmap(bmp8bpp); cimage.ForwardFourierTransform(); System.Drawing.Bitmap img = cimage.ToBitmap(); pbFourierMag.SizeMode = PictureBoxSizeMode.StretchImage; pbFourierMag.Image = img; }
private void btFFTDeconv_Click(object sender, EventArgs e) { Bitmap image = new Bitmap(pbResult.Image); var bmp8bpp = Grayscale.CommonAlgorithms.BT709.Apply(image); AForge.Imaging.ComplexImage cimage = AForge.Imaging.ComplexImage.FromBitmap(bmp8bpp); // int height = cimage.Data.GetLength(0); // int width = cimage.Data.GetLength(1); cimage.ForwardFourierTransform(); /* for (int y = 0; y < height; y++) * { * for (int x = 0; x < width; x++) * { * cimage.Data[y, x].Re = cimage.Data[y, x].Phase; * } * } */ Bitmap fourierImage = cimage.ToBitmap(); pbFourierPhase.SizeMode = PictureBoxSizeMode.StretchImage; pbFourierPhase.Image = fourierImage; }