06-09-2016 06:21 PM
Hi
Not sure it is the right place for my question, but I try...
I want to use FFT2D function to analyze a picture, and I wonder how to enter bitmap data (luminance of each pixel for instance, adding R,G,B values) in the 1D array of double.
I tried to enter values from left to right for each row, that gives some results, but difficult to validate.
My project is to analyze sharpness of a picture to help focusing of a telescope.
An other question : how to perform a 2D windowing on the data ? Is it necessary in my case ? I do not find any window function for 2D arrays
Thanks in advance
Jean-Pierre
06-10-2016 03:30 PM
Hi jpscholet
Is your question how to enter bitmap data? If that is the case, the help documentation on the FFT2D function goes over what inputs the function accepts.
As for your second question, I'm not sure that LabWindows™/CVI™ has this functionality, but you can see a comprehensive list of every function in the Advanced Analysis Library here.
06-10-2016 05:29 PM
Hi Andy
Thanks for youy reply.
Yes I want to know how to enter bitmap data.
The FFT2D documentation is not so clear for me, first because the input data is specified as a "time-domain signal", and a bitmap is rather a space domain signal (I must confess that I do not undestand what could be a 2D time dependant signal, have you an example?)..
The luminance of each pixel of a bitmap can be defined as a 2D function L(x,y), a real value.
The data input required by FFT2D is defined like this :
timeDomainSignal | void * | The real time-domain signal. |
No further explanation. No sample application. How to enter my L(x,y) values ?
I tried to create a 1D array of double, by scanning successively each row of the bitmap.
The result is not completely stupid, but is this random trial the good way ?
About 2D window : I cannot find any CVI function for that, but it is not difficult to create one with the 1D windows functions.
Thanks for your help
Jean-PIerre
06-13-2016 05:30 PM
Hi Jean-Pierre
There are multiple functions included with the vision development model that would allow you to do what you are trying to do. There is a Image FFT function that runs a FFT on an image you give it.
If you want to continue using the 2dfft function that you are currently using, you will have to figure out how to get your image to a 2D array of doubles. I'm not sure if the way you are doing it is correct. You could always try comparing your results to another service that runs the fft on an image online. This is just an example.
There is also an example that goes through using the 2dfft function in the CVI example finder that you could take a look at.