LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQ Video Lag

Hello,

 

I have a VI that displays a video feed from an IMAQdx grab on the front panel as well as a picture control that has quite a large image. Every time the picture control redraws, once per second, the video being displayed on the front panel lags. The indicated frame rate stays at 30 fps, but what is shown is a frozen frame half of the time. I'm sure this has to do with the picture redraw, but it is barely utilizing the computer resources when this happens. Any tips or ideas?

 

Thanks in advance for the help,

dnorman

0 Kudos
Message 1 of 10
(3,634 Views)

I'm guessing this is from the front panel update. When the front panel has to redraw the large image it can't update the video feed. Is there a way to update in parallel somehow. I've never used sub panels, do they allow for this? Or is my only option to run the two processes in seperate VI's on screen simultaneously?

0 Kudos
Message 2 of 10
(3,625 Views)

Dnorman,

 

How large is the image? The frame rate reported is the frame rate being brought in by the camera, not necessarily the rate at which it is updating on the user interface. If you run these in separate VIs do they run properly? You may also try running both of these in parallel while loops in order to devote each while loop to its own core of the CPU. Are the images or indicators overlayed on your FP? What are your computer specs (RAM, processor, etc.)?

Blake C.
Applications Engineer
National Instruments
www.ni.com/support
0 Kudos
Message 3 of 10
(3,614 Views)

Did you uncheck the picture option "Erase First"?  This should speed up the front panel redraw.

0 Kudos
Message 4 of 10
(3,609 Views)

The image is made up of 9 tiles of about 2600 by 1500 pixels, but the entire image is never shown, only a portion. If they are run seperately there is still a lag when the picture control is redrawn. They are currently in seperate while loops. The picture control image is overlayed by an XY graph. The computer has a i7 that is only working at 10-12% when this is running and no core is over 25% on average. Same with the RAM, the computer has 8GB and is using less than half of that when the VI's are running. I've heard it doesn't matter for this, but the GPU is barely being used either.

0 Kudos
Message 5 of 10
(3,602 Views)

Erase first is unchecked. Found that one out when I first started working on this, but thanks for the heads up.

0 Kudos
Message 6 of 10
(3,599 Views)

9 tiles each sized about 2600 x 1500? Big stuff.  Do you use "Draw Flatten Pixmap" to produce the image?  If yes, how do you do it?  Can you post a screenshot of the BD part that produces the picture from the images?

0 Kudos
Message 7 of 10
(3,590 Views)

I'm not near the computer that this is on right now, but what I have used to get the picture is something along the lines of jpeg to flattened pixmap and then draw flattened pixmap, with the subsequent tiles setup in a cascade with their origin information altered and the previous flattened pixmap used as an input for the next draw flattened pixmap.

0 Kudos
Message 8 of 10
(3,583 Views)

DrawFlattenedPixmap.jpg

This is how I have it setup currently for the 9 tiles.

0 Kudos
Message 9 of 10
(3,557 Views)

As long as you see that your CPU usage is about 12% I assume that all the "Draw Flatten Pixmap" operations run in the UI thread.  You can mitigate the issue by moving that code to a subVI and run that in a different "Preferred Execution System", see the VI Properties.

You might also want to look at the Profiler that will tell you how much time is spent on the VI calls and identify further VIs that should better not run in the UI thread.

0 Kudos
Message 10 of 10
(3,532 Views)