01-11-2018 04:52 PM
I'm acquiring 8bit 800x600px images at 250fps continuously using the Imaq Image Acquisition Express VI. The VI is called in a loop and configured to read only the most recent frame in the buffer. I'm monitoring the loop execution time and I get at least 250 loop iterations per second. So far so good.
When configuring the image acquisition VI to log images to disk there's a warning about it affecting the maximum frame rate and sure enough when I enable logging I drop down to 50 loop iterations per second. So I was wondering what I can do to keep my 250fps. Data is being written to a modern SSD on 6Gbps SATA so I don't think I have a hardware bottleneck. Is there an image file format that will be faster to encode? Should I write AVIs instead of pngs? Should I manually create an image logging thread that buffers to disk (seems like a losing game if it really can only write at 1/5th the acquisition rate). Any other tricks I haven't thought of?
01-22-2018 03:39 PM
I know this was passed a couple of weeks ago, but in case you are still having trouble with this:
Any time you are logging inside of your acquisition loop, you have the potential to run into frame rate issues. Every time your loop iterates, you take a frame out of input buffer and read it into LabVIEW memory, then you write that image to disk, all of which takes time. Using the Vision Acquisition express VI, there isn't really any way to avoid it, although you might have slightly better performance depending on the file type.
I would suggest that rather than using the express VI for your acquisition, take a look at the lower-level example VIs (Example Finder>>Hardware Input and Output>>Vision Acquisition>>NI-IMAQdx>>Low-Level). You could either do your image logging after acquiring all of your frames (may run into memory problems) or you could perform the logging in parallel to your acquisition in a separate loop. Be aware that if you do the second option, the IMAQ Image data type is a reference to a buffer where your image data is stored rather than the data itself. As such, it cannot be passed in a queue the way other LabVIEW data types can be. Check out:
http://digital.ni.com/public.nsf/allkb/314F58D7A93D8F8A86256CD200810EDF
-Jordan