Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

I want to display live video in LV, with the option to click on "delay" button, to view what happened N s. ago (i.e., a variable video delay)?

Hi. I have a standard video camera + PCI 1408. I can nicely show the current image, using LL Ring examples. I want a boolean switch so I can switch from watching the live video to the video recorded N seconds ago. My initial hope was to use LL Ring, with
lots of buffers, and copy/extract either latest buffers or a buffer several acquisitions ago. However, this seems to add no delay at all. Suggestions please? Thanks Patrick
0 Kudos
Message 1 of 5
(3,414 Views)
Patrick,

It sounds like you are on the right track. You need to set up a large buffer. Multiply the number of seconds you want by the frame rate of your camera. Add a second or so extra to the buffer so you have plenty of time to display the image before it gets overwritten.

For a live image, use "IMAQ Status" to get the Last Valid Buffer. Use this value to index your image array to select the image to display. For the delayed image, subtract the number of images for the delay from the Last Valid Buffer. If less than zero, add the number of frames in the buffer. This value will index your image for your delayed display.

Bruce
Bruce Ammons
Ammons Engineering
Message 2 of 5
(3,414 Views)
Thanks Bruce. This sounded like it made sense but...
- the examples, such as LL ring deliver only one buffer at a time inside a whileloop, rather than a whole array of buffers. Changing the number of the buffer copied/extracted seemed utterly unable to produce any delays (at least for a delay of up to 50 buffers, which is the max NI-IMAQ lets me have. This should produce an easily detectable 2s or so delay but doesn't).

I think the bit I don't get is about how ALL the buffers are available in an image array. I cumulate an array of the last N images within the while loop, but that isn't really using the multiple IMAQ buffers?

More insights gratefully received!
Patrick
-
0 Kudos
Message 3 of 5
(3,414 Views)
Patrick,

What I start with is the sequence acquisition. I change it from one time to continuous, and simplify it a little bit.

I have included an example that shows how to set up a buffer and display delayed video.

One thing you have to do is open MAX and change the maximum number of buffers for IMAQ to something larger than 50. I usually select around 2000 buffers so that I never run out.

Bruce
Bruce Ammons
Ammons Engineering
0 Kudos
Message 4 of 5
(3,414 Views)
Thanks Bruce this was most helpful. The key thing I got from your code was the trick of passing the array of all the buffers into the while loop.
Much appreciated.
Patrick
0 Kudos
Message 5 of 5
(3,414 Views)