From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Magnitude extraction of a complex image type (FFT result)

Hello,

 

I am in charge of the development with Labwindows CVI in C code. The additional module NI Vision development is installed on my computer.

 

My goal is to compute the magnitude of my complex Fourier image, then process an algorithm on the result. The issue is only with the calculation of the magnitude with Ni Vision.

 

From a black and white picture, with a rectangular size, I succeed to obtain the FFT picture. As destination from imaqFFT, I have a rectalgular FFT picture, in type IMAQ_IMAGE_COMPLEX. This picture is in the same format than the source image input. Labwindows CVI support told me it is impossible to have a destination picture in a different format than the source.

 

In order to work with a square format, I resized my black and white source picture in a square format, by deleting 2 bands on the sides.

 

The result of the FFT image (square format) is correct. This picture is displaying in a single canvas with imagImageDisplay, so I supposed that I am already seeing the magnitude of the Fourier picture. Indeed, the value of the screen pixel is displayed with a single intensity (only one canvas), while the pixel values are couples of values with real part and imaginary part.

 

In order to obtain the magnitude of the FFT picture, I use imaqExtractComplexPlane  function, with the selection of IMAQ_MAGNITUDE in parameters.

The function does not return any errors. Called with a destination image type I16, I have negative values. In U16, some of the pixels seems to be above the maximum range of U16. Called in IMAQ_IMAGE_SGL  in order to have a 32 bits results, values are not normal, even negative, which is impossible for a magnitude result.

 

Do you have ideas of what leads I can follow ? What type of error is possible in order to use this imaqExtractComplexPlane  function badly ?

Can I have the result by a different way ? Should I compute it myself ?

Thank you for your help !

 

Best regards,

Lilian SABATTE

0 Kudos
Message 1 of 2
(1,887 Views)

Hello,

you are probably better off asking in a Vision or image processing forum: https://forums.ni.com/t5/Machine-Vision/bd-p/200

0 Kudos
Message 2 of 2
(1,753 Views)