LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW and Vision (8.2) 2D FFT - Some differences noted

Hello:

I am attaching a small llb showing the 2d FFT results obtained using both the LabVIEW and Vision (8.2) functions.  Some differences in results are seen.  The Vision results seem to have more components (move the scroll bars to get to approximate vision container center) while the LabVIEW results show only one pixel at near the center that is not zero. I wanted to know if someone can explain the differences seen. 

Given that I might trust the Vision results more, I need to display them either in a vision container of the size shown that autoscales X and Y and does not show scrollbars (i.e. behavior like intensity graph), or I need to be able to convert the vision container results so as to be able to display in intensity graph.  I don't know how to get the vision container to do the fomer and since the results for the vision container are in complex format, it is not clear to me how to do the latter conversion. 

Any thoughts are appreciated.

Sincerely,

Don
0 Kudos
Message 1 of 11
(4,557 Views)

Hi Don,

We have two documents that describe in detail how each of the FFT functions work.  The Vision Concept Manual (Start>>Programs>>National Instruments>>Vision>>Documentation>>NI Vision>>Concepts_Manual.pdf) describes the IMAQ FFT on pages 117-129.  The LabVIEW FFT functions are described here in pages 78-117. These documents explain which functions each of these VI’s use and how the FFT is calculated.

There currently isn’t a way to have an IMAQ display that doesn’t allows you to readjust the window without using a scroll bar.  But one thing you could do is change your image back to an array and then you can view it as a intensity graph. 

I hope this helps.  Let me know if you have any other questions.

Have a great day,

GG

 
0 Kudos
Message 2 of 11
(4,534 Views)
Hi Gavin:

The end of my post above proposes to do exactly what you state: converting vision container to array using IMAQ image to array.  But how do you do it?  Remember, the vision container is of type complex - you do not have the option to specifiy complex when using that function. Run the attached and see the error one gets.

It is not clear to me from the references you site why we should get different answers between the two functions.  Does this mean when I go to another function library such as from visual basic or c++ I would get 2 more different answers?  There is some subtle difference between the functions that only the R&D dept. can probably tell us.  On something gross like the 2d fft example (C:\Program Files\National Instruments\LabVIEW 8.2\examples\analysis\dspxmpl.llb\2D FFT of a Pulse.vi) included with LabVIEW, the results are substantially the same.

Sincerely,

Don
0 Kudos
Message 3 of 11
(4,511 Views)

Hi Don,

The way to convert the image is to use IMAQ ComplexImageToArray.  That will remove the error, but that might not give you the results that you are looking for.  I am going to look at this in more depth to find out what the underlying differences between the two functions are.   As soon as I have more information I will post it.

Regards,
GG
0 Kudos
Message 4 of 11
(4,497 Views)
Thanks for the tip regarding the correct conversion function to use.  But you are right - we still don't get the right answer. Coming out of the IMAQ ComplexImageToArray fx, I extracted the magnitude portion using Complex To Polar fx, and then fed the 'r' output to an intensity graph.  The only thing that happens is a white pixel at about (x=5,y=520) - so it does not match up with the Vision Image.
 
Will wait to hear back from you....Don 
0 Kudos
Message 5 of 11
(4,489 Views)

Hi Don,

The IMAQ FFT does more than just perform the FFT, when the image is displayed it shows the magnitude of the FFT.  It is also displaying the optical representation where when the FFT.vi from the signal processing palette is displayed using the IMAQ image display it is shown in the normal representation.  The difference between these two displays is explained on pages 119-121 of the Vision Concept manual.  This is why the IMAQ FFT is white in the center, and the signal processing FFT has white pixels in all of the corners.  IMAQ uses the different format so that it can match the standard form for Machine Vision.  Let me know if this helps.

GG
0 Kudos
Message 6 of 11
(4,476 Views)
Hi Gavin:

Well you are correct that a quadrant shift needs to be done to change from computational to optical representation of FFT.  So I have done this here (see attached) but of course it still does not give us the vision 2d fft representationi (since the pixel of high intensity is just shifted and now agrees with the shifted straight labview 2d fft implementation).

So we are still unresolved here....

Sincerely,

Don
Download All
0 Kudos
Message 7 of 11
(4,460 Views)

Hi Don,

If I understand your question you are wondering why the intensity is different between the two image displays. The reason the intensity is different is because the IMAQ FFT graph is showing the magnitude of the complex array while the LabVIEW FFT graph is only showing the real values.   If I am misinterpreting your question let me know.

GG

0 Kudos
Message 8 of 11
(4,437 Views)

Hi Gavin:

Can you please give me your phone# so I can call you?

Thanks,

Don

0 Kudos
Message 9 of 11
(4,425 Views)

ps. the 'r' that is coming from the 'Complex to polar' fx is the magnitude.  The magnitude is a REAL number. The magnitude is what I expect is shown in both the vision and intensity graph containers, even though the vision container is in complex space and the intensity graph container is in the real space.  Bottom line is both are magnitude and should be the same. They are being shown differently for some reason.  The magnitude shown in the vision container I believe to be correct.  How can I get the magnitude from the image container to show the same way in an intensity graph? This is the question.

Again, you need to take this problem to LabVIEW R&D, or help me find the right contact in that department to call on this issue.

Sincerely,

Don

0 Kudos
Message 10 of 11
(4,422 Views)