Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Imaq 1408, I'm trying to do circular buffering of a video signal that i'm capture and then storing into a jpg file.

Using Imaq 1408, I'm trying to grab EVERY frame of a video (30 f/s) and store the frames. Run time can be up to 30 sec. However, what is happening is that when I open the stored images, old data appears in newer frames. In other words, image240.jpg should contain frame 240. But instead image99.jpg and image240.jpg contain the same data and it repeats old data after image240.jpg.
I think its something that i'm doing wrong with the Extract vi. I have something similar to the LL OCCURENCE RING, except without the Occurence VI.
0 Kudos
Message 1 of 3
(3,145 Views)
It's difficult to say exactly what is happening without seeing the code. I put together a small example (based on the LL Ring shipping example) that acquires continuously and writes the images to disk.

I have run this example for 1000's of frames, with various buffer sizes (5-250) and have not seen any corrupt data or duplicate frames. I am currently using a color camera, and at 640x480 I can get 20 fps writing to BMP and around 6 fps to JPEG, with the former being a HDD limitation and the later being a processor limit. At 400x400 and 250x250, I can acquire the full 30 fps to BMP and JPEG respectively.

Regards,

Brent R.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(3,145 Views)
I believe Brent has sent a good example, but I have also seen this in the past and there is one more thing you can try in your existing code that should help. The Ring typically uses an extract which actually protects the buffer while it is in use, and it is possible that with multiple operations the buffer is not being replaced in time, or being "unextracted" for future use. I suggest after acquiring the image, immediately use the "Vision" IMAQ Copy (the white one, not the grey IMAQ one) to copy the image into a new buffer location and then use an IMAQ Extract on the original image with a -1 input for the buffer number so it releases it back into the buffer list. Then use the copied image buffer to do any further processing or saving. This way you are not doing direct pr
ocessing on buffers in the ring.

Best Regards,
Chris D
0 Kudos
Message 3 of 3
(3,145 Views)