Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Magnitude extraction of a complex image type (FFT result)

Solved!
Go to solution

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 ?

 

Cordialement,

Lilian SABATTE

 

0 Kudos
Message 1 of 2
(1,630 Views)
Solution
Accepted by topic author Lilian-SABATTE

I wrote the calculation of Fourier magnitude pixel per pixel last friday, everything is OK now. I couldn't find the mistake in the use of imaqExtractComplexPlane from Ni Vision library.

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