LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't display image from IMAQ on front panel

Hi again,

I am having trouble displaying an image from my camera on the front panel. This is the advice I've recieved thusfar:

"Unlike most datatypes in LabVIEW (numerics, booleans, etc.), the image
datatype is not actual data. Instead, the image datatype just points to
the location of the image data in memory. This means that if the data in
memory changes, everything pointing to that data changes.

In the case of your VI, the particle analysis functions change the data in
memory, so when the front panel updates, the image changes. This doesn't
happen to the probe, because the probe only updates when dataflows past the
probe. To see this more easily, try running the VI with highlight
execution turned o
n. You should initially see the image that you expect on
the front panel, but after a few seconds the image will go black, because
the code is turning it into a binary image and doing particle analysis on
this binary image.

To avoid this problem, you will need to use the IMAQ Copy function and copy
the image into a new buffer. If you then display the copied image, instead
of the manipulated image, you will avoid this problem."


I tried using IMAQ Copy to copy the image to a temporary file but the image still comes out black. This has been plaguing me for about 2 days now. I have included a copy of my VI (this version gets an image from a file instead of the camera for testing purposes)... any ideas? Thanks a million.

Regards,

Adam Stagnaro
Abaxis Inc
0 Kudos
Message 1 of 6
(3,857 Views)
Adam-

You have your block diagram password protected, so I cannot look at it. You don't need to copy the image to a file, but you do need to make sure that the copy happens before the image gets manipulated. Please remove the password protection, and post again.
0 Kudos
Message 2 of 6
(3,857 Views)
Also, I don't have the VI's "Particle Analysis" and "Particle Filter 2". Either they are ones that you created, or they are not included with my version of Vision. Either way, could you include those also?

Thanks,

Brian
0 Kudos
Message 3 of 6
(3,857 Views)
Hi Brian,

Thanks for helping me out... sorry about that password; slipped my mind. I've removed it (it's "dispenser" just in case) and reposted the file. I really appreciate your help, thanks again.

Regards,

Adam Stagnaro
0 Kudos
Message 4 of 6
(3,857 Views)
Adam,

Just one note on how to avoid having your image replaced by a modified or changed version. In the Vision VIs that you are using in your code, if you want to preserve your original image, then you will need to call IMAQ Create again in order to setup up a new buffer. You can then wire the image from this VI to the "Image Dst" inputs of the Vision functions.

Also, if you have questions on basic vision functions or applications, then take advantage of all of the shipping examples that are included with LabVIEW and the NI-IMAQ for 1394 driver. These specific 1394 examples can be found on your computer at C:\Program Files\National Instruments\LabVIEW 7.x\examples\IMAQ.

Regards,
Michael
Applications Engineer
National Instru
ments
0 Kudos
Message 5 of 6
(3,857 Views)
I believe I added what was needed to correct your display problem.
0 Kudos
Message 6 of 6
(3,857 Views)