I have the following code which can be used on a 2d array of pixel values to do the fft and get the magnitude of the image. I wonder can anyone translate this code to its Java equivalent:
Thanks in advance for any help you can offer
Printable View
I have the following code which can be used on a 2d array of pixel values to do the fft and get the magnitude of the image. I wonder can anyone translate this code to its Java equivalent:
Thanks in advance for any help you can offer
Almost certainly, yes, as the code isn't particularly involved.Quote:
I wonder can anyone translate this code to its Java equivalent
The pointer arguments are most simply expressed in Java as (possibly double) arrays.
But before you start to translate it, first get a clear and precise idea of what each of the methods *does*. That is, don't get too hung up on the Java code you write until you have a clear idea of what that code should be doing. Also where the C++ code makes reference to other quantities (like the limit nFFT2 or the Sin and Cos arrays) find out what those quantities are supposed to represent.
If you find the C++ code mysterious, then my advice would be to forget it and write your own implementation in Java.
Problem solved, thanks
Does that compile?
You are accessing Sin and Cos as double arrays.