LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

queueing the IMAQ image data type

Solved!
Go to solution
I'm trying to run multiple queues in the same while loop grabbing IMAQdx images from multiple cameras, then save to AVI. After reading on NI's site a bit, I discovered that the reason I'm only getting the last frame from each grab, repeated over all the frames in the AVI, is that the IMAQ image data type only stores the memory location for an image, not the image data itself. However, I don't see a best solution for queueing the actual image data. What conversion would be the fastest/have the lowest CPU load?
0 Kudos
Message 1 of 14
(5,321 Views)

Prepare multiple IMAQ images and put the data into the image.

you can retrieve the images at the other end without using queues, the IMAQ images is a reference to the image.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 14
(5,313 Views)
I would use an array of images, but the queue format is useful to my scheme (I'm streaming images from multiple cameras and want to keep a buffer of the last 1000 images or so from each camera, dropping out frames as new ones are added). Is there a way to operate directly on the image data in memory, rather than on the reference to the data?
0 Kudos
Message 3 of 14
(5,295 Views)

Nasgul wrote:
Is there a way to operate directly on the image data in memory, rather than on the reference to the data?

You don't want to do that for performance reasons.

 

Why not create 1000 images and use a circular buffer system to store the latest acquired image in the "1000 mod i" th element of the array.

 

This way you don't double up your memory usage.

 

Shane

0 Kudos
Message 4 of 14
(5,293 Views)

Nasgul wrote:
I would use an array of images, but the queue format is useful to my scheme (I'm streaming images from multiple cameras and want to keep a buffer of the last 1000 images or so from each camera, dropping out frames as new ones are added). Is there a way to operate directly on the image data in memory, rather than on the reference to the data?

What resolution do your cameras have??? Let's assume a fairly low end camera of 640 * 480 pixels with only 8 bit gray. Such a pic takes up "only" ~3MB of memory. multiply this by 1000 and the number of your cameras and you end up running into limits very fast even on modern 64 bit machines with 64 bit OS and 64 bit LabVIEW version (which I'm not sure you are using).

Rolf Kalbermatter
Averna BV
0 Kudos
Message 5 of 14
(5,283 Views)

640x480 is approx. 300k per image, not 3MB.

 

1024*768 is approx.  800k.

 

As such the memory requirements rise to 300MB in total (800MB for 1024x768), something which is certainly in the doable range assuming the references are cleanly disposed of once they're no longer needed.

 

Shane.

Message 6 of 14
(5,280 Views)

I missed the "for each camera" part.

 

This WILL be a limitng factor.  For one camera it would work, but so many images for so many cameras is not really going to work.

 

Shane.

 

Ps I think you'll need to save to disk and have a fairly beefy disk subsystem to be able to keep up with this.  You can store the path to the files in an array and delete the elements you replace in your circular buffer.  Depending on the frame rates, this will be a huge bottleneck though.

Message Edited by Intaris on 04-13-2010 09:03 AM
Message 7 of 14
(5,278 Views)
Solution
Accepted by Nasgul

 For each Frame you must initial Image space.

 You could use something like this:

 

Image_queue_processing.png

 

You must add Camera(s) and AVI initialization. You must add multicamera feature. Stop recording is missing.

 

!!! Do not forget Dispose Queues and Images !!!

Message 8 of 14
(5,263 Views)
Dual queues solved the problem, thanks! Now to figure out how to pass the image buffer to a subvi and continue to add to it at the same time...
0 Kudos
Message 9 of 14
(5,209 Views)
One problem with that screenshot is that the queues are being killed and the images disposed of simultaneously while the two while loops are running.
0 Kudos
Message 10 of 14
(5,189 Views)