I have array of grayscale for example [0.0, 0.0, 0.0, 255.0, 255.0, 255.0, 130.0, 130.0, 130.0]
3x3 dimension, I need create array of complex numbers for fft function. How I should convert this array?
Im using swift 4 and it is for iOS, but I think its no matter. And also using Accelerate framework from Apple
so have 3 questions
Fill real part of complex array with you data, and imaginary part - with zero (picture is pure real data).
After FFT you'll have complex array (symmetrical because of pure real source). Both real and im. parts of result are important. For example, you can use both parts to calculate magnitude of spectrum, or to perform some treatment in frequency domain and make inverse FFT to get treated picture.
What to do with RGB - depends on your needs. Sometimes one needs to perform FFT on every channel separately. Sometimes one needs to work with brightness - in this case channels are joined using some law.