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
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
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
Last edited by java_novice; February 9th, 2012 at 01:39 PM.
Almost certainly, yes, as the code isn't particularly involved.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
Last edited by java_novice; February 9th, 2012 at 01:40 PM.
Does that compile?
You are accessing Sin and Cos as double arrays.