How many frames are you acquiring. I'm guessing you have 640*480@8 bpp@200Hz so ~60 megs per second. A typical LabVIEW setup can only allocated about 1.5 gigs of memory, so you can't record more than about 24 seconds of video before you run out of memory. You can potentially get 3GB of memory (4 on vista64), with some tweaking of the system, but that would only get you another ~24 seconds.
You can use "find examples" under help to get an idea on how arrays work, or better yet read the "LV_Fundamentals.pdf" in the LabVIEW manuals directory. One important thing to keep in mind is that unlike most LabVIEW data the IMAQ images are reference based instead of value based. I think the fundamentals pdf explains the difference.
Warning: I've only used the IMAQdx commands, so my interpretation of the IMAQ setup may be a bit off.
If you only need a few seconds of video.
The simplest method would be to grab a sequence instead of continuously. Basically just pass an array of IMAQ images in (make sure each has a unique name), then take the array of images out and process over that. I'm unsure whether it's possible to see what the camera sees while doing a sequence grab though (grab acquire or copy buffer in a seperate loop may work for that).
If you only need a few seconds of video and want to see what the camera sees.
You could do what you originally said. You'll need to make a new image for each frame, you can set the output of the while loop to index mode to get an array.
If you want to capture a stream of any length (drive space permitting).
This is a bit more complicated but can probably be done (it depends on the speed of you computer and hard drive, relative to the amount of data your capturing). I doubt you can save pngs faster than you can capture frames so those are out. I use avi files with the huffyuv codec in ffdshow-tryouts (a very fast loss less codec), but getting that to work with the IMAQ avi functions is tricky. I could try to explain if you want to go this route, but be aware if others need to read the files, then they'll need compatible codecs (ffdshow on windows, perian on mac) or player (vlc on almost anything). You'll also need to record data in a separate loop from the one acquiring frames (since saving the first few frames can go too slow) so you would probably use a queue for that. Hard drive speed could be an issue, I get ~15 mb/s for 1024*768@30Hz with huffyuv, assuming a direct scaling yours should be ~40 mb/s which should be doable on a decent modern hard drive that's dedicated to the task. Without compression your video in color is about 180 mb/s, which would require a raid array to stream data fast enough. I usually recompress my videos in XviD when I'm done since I don't need them to be loss less, it shinks the file size to less than a tenth, and is far more common a codec for other people to have.
I modified your code to capture with a sequence and an array. But since I only have a IMAQdx setup and can't test them so there's a very good chance I messed something up. If you try to capture too much video, you'll run out of memory.
Message Edited by Matt W on
06-24-2008 07:02 PMMessage Edited by Matt W on
06-24-2008 07:04 PM