Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

I want to read back an RGB image from a global variable

I fed an imaq snap image into a global variable for use later on in the program. When i try to read the image back from the global it causes an error (invalid image type) but WHY!!!!!!
0 Kudos
Message 1 of 2
(2,880 Views)
You made a copy of the reference to the image, not the image itself. That is the way IMAQ images work. The reference probably got reused for another image, or even deleted, which made the global copy of it invalid.

If you want to copy an image, use IMAQ Copy. You will need to allocate an image reference to store the copy. You could then keep the image reference in a global and use it later, then deallocate it when you are finished with it.

Bruce
Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 2
(2,880 Views)