Archived: How Can I Optimize My LabVIEW or LabWindows/CVI Application to Acquire and Display Images More Quickly?This document has been archived and is no longer updated by National Instruments
Primary Software: Driver Software>>NI-IMAQ
Primary Software Version: 3.0
Primary Software Fixed Version: N/A
Secondary Software: N/A
How can I optimize my LabVIEW or LabWindows/CVI application to acquire and display images more quickly?
LabVIEW - There are two ways to display an image. One way is by plotting directly to an intensity graph on a panel. The other is to use the IMAQ Vision VIs to create a new window which will display the image. This second method will provide the faster performance. With LabVIEW 7.0 you can use an image display and display the image right on the front panel instead of opening a new window to display the image.
LabWindows/CVI - There are also two different ways to display an image. One is to use imgPlot2 to directly plot it to a panel and the other is to use the IMAQ Vision function calls (IPI_WindDraw()) to create a new window. In this case the first option (directly to the panel) is faster.
There is one other trick to maximize performance in LabWindows/CVI, and that is to acquire the image inverted. You can do this by calling imgSetAttribute using the attribute IMG_ATTR_INVERT. PCs and Windows works faster with inverted images. Below is a discussion of some historical explanations of the above statement:
Historically (1970's and before), (before PCs, Apple, or other) it was common to put the origin at the bottom left of the screen. This made the screen look like quadrant 1 of a standard Cartesian surface. This was natural since that's what math and physics majors were used to and they were the primary source of graphics programmers (using FORTRAN of course). At that time bitmaps and memory mapped graphics were virtually non existent.
However when bit maps came along two divergent things happened. Some systems, which include the IBM PC line that ended up as windows, took the view that the origin (bottom left) was naturally the first byte in the buffer (the one with the lowest address) and would naturally be the first one to write out to a file. As evidence of that, the BMP file format starts with the bottom scan line, not the top. This is referred to as a Bottom Up DIB(Device Independent Bitmap) and was the only form of graphic that Win16 supported. In response to this, hardware has been optimized to handle it. With the birth of Win32, a new flavor of DIB - top down DIB - was now supported. However, since hardware had already been optimized to perform better when the image is inverted, we see a difference in performance when comparing the two types of files.
Report Date: 01/06/1998
Last Updated: 11/13/2008
Document ID: 155I2IU9