Pregunta

I am having trouble figuring out extracting the real and imaginary parts from AForgenet FFT. I have the following

ComplexImage cImage = ComplexImage.FromBitmap(inputImage);
cImage.ForwardFourierTransform();
Complex[,] realImaginaryData = cImage.Data;

Does this mean I have manually extract real and imaginary parts from the complex structure?

Thanks. Any snippet would be great help!

¿Fue útil?

Solución

I'm not that familiar with C#, but it seems as if cImage.Data returns a 2D array of Complex objects.

These objects each have public fields (see http://www.aforgenet.com/framework/docs/html/09bb06de-f1c8-fc26-3472-78a64c4f4ac6.htm) containing the real (Re field) and imaginary (Im field) parts.

So, I'd imagine:

double realPart = realImaginaryData[0,0].Re;
double imagPart = realImaginaryData[0,0].Im;
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top