LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Continous Image processing and display using VISION 8.0, I get know image

I am tyring to continously acquire images, and processing them to find the position of a particle. This information is then used to control a stage. I have converted a Vision script to a subvi, but when i insert this script into my image path, the display goes black (not the processing, ive checked with actuall image) and flickers every now and then (~5sec) with a not fully processed image. Vision told me my refresh time was about 60ms with this script, so i can't figure why its refressing so poorly. Additionally, i have seen that you can not erase the pictrure between refreshes for the picture display, but i find no property node for erase with the  Image display control.
0 Kudos
Message 1 of 2
(2,655 Views)

Russell,

I have a good idea what is going on.  You probably are only using one IMAQ Image during your image processing.  By the time the image gets displayed in your image control on the front panel, your image processing routine has already manipulated the image and produced a binary image, which will show up as a black image in the image control unless you changed the image control to display a binary image.

See...  The IMAQ Image type is a pointer, and therefor, if you manipulate the image after the IMAQ Image control function on your block diagram has been run, the image will still be updated inside of the IMAQ Image control.  This will cause your IMAQ Image control to display the proper image sporadically.

So, how do you fix this issue?  Well, the solution is quite simple, all you need to do is create a 2nd IMAQ Image that will be dedicated to the image you would like to display in the IMAQ Image control.

For example, lets say you have a simple IMAQ program written to grab a bunch of images continuously and you want to find the X/Y coordinates of an object in each image.  Your program would consist of a initialization functions, a while loop, and closing/error handling functions.  Inside the while loop will be a grab followed by the object detection routine.  If I wanted to display the original image on my front panel I would create two IMAQ Images and after my grab function, I would copy the original IMAQ Image to the 2nd IMAQ Image.  I would then process one of the IMAQ Images and use the other to display the image on the front panel.

Attached are two screenshots demonstrating what I am talking about.

In "solution.bmp" I show how you can use "IMAQ Copy.vi" to fix your problem.  In "better solution.bmp" I use the "Image Dst" input to copy the image for me (instead of having to add an extra VI).

I hope this helps,
Lorne Hengst
Application Engineer
National Instruments

0 Kudos
Message 2 of 2
(2,640 Views)