LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Camera save dropped frames

Solved!
Go to solution

When the program is debugging the USB camera, the saved image drops frames. What is the reason? Looking forward to your answer, thank you!The attachment is the program.

0 Kudos
Message 1 of 8
(1,778 Views)
Solution
Accepted by topic author luopeng2019

I'm not sure what you mean by "... the program debugging the USB camera ...".  Is there a condition where frames are not dropped?  What "debugging" do you do that causes the dropped frames?  Do you mean "Highlight Execution"?

 

I notice that your images are quite large.  Are they color?  I also notice that there is an AVI Write function in the acquisition loop, making the loop run at the slower of the processes "Grab" and AVI Write.  What if you don't write the AVI?  If that seems to be OK, try using a Producer/Consumer design, where you have one loop with Grab, another loop with AVI Write, connected by a Stream Channel Wire or a Queue.

 

Bob Schor

0 Kudos
Message 2 of 8
(1,734 Views)

My camera is a grayscale camera. When I tested, the FrameCount of the camera was the number of pictures in the camera buffer area obtained in real time. The FrameCount count value was not equal to the number of pictures written by the AVIwrite function writing method. May I ask what is the reason? Thanks for answering.

0 Kudos
Message 3 of 8
(1,704 Views)

My camera is a grayscale camera. When I tested, the FrameCount of the camera was the number of pictures in the camera buffer area obtained in real time. The FrameCount count value was not equal to the number of pictures written by the AVIwrite function writing method. May I ask what is the reason? Thanks for answering.

0 Kudos
Message 4 of 8
(1,703 Views)

I modified the program to this way and there are still more than 20 frames lost. What is the reason? There will be pictures 2 to 3 seconds after the external trigger of the camera. Program in the annex.

0 Kudos
Message 5 of 8
(1,669 Views)

You are taking frames of size 2560 x 2048 at a frame rate of 60 FPS.  When you configured Grab, you didn't specify a Buffer size, so the Driver will allocate only 5 buffers.  This means that you have to move 25 M Bytes in less than 0.1 sec and keep the throughput up as you open and get the AVI engine started.

 

I'm not sure if this would help, but I suggest you try allocating 30-60 buffers.  If 30 works, try cutting it down (halve it each time) and find what works.  If you still are having a problem, you might consider simply hooking the camera up to your PC, opening it in MAX, and see what "actual frame rates" it can process.

 

I just noticed you compute the camera's Frame Rate -- what does it show?

 

Bob Schor

0 Kudos
Message 6 of 8
(1,655 Views)

How to allocate the buffer area for the camera?

0 Kudos
Message 7 of 8
(1,647 Views)

Open LabVIEW.  Open your VI.  Type ^H (which turns on LabVIEW's Context Help).  Find the IMAQdx Configure Grab function and hover your mouse over it.  Read the Detailed Help.  Answer your own question.

 

When working with some of the more advanced and esoteric functions in LabVIEW (such as LabVIEW Vision), spending a little more time with the Help function can teach you a lot!  Sometimes (but not always!) the Examples are also useful.

 

Bob Schor

0 Kudos
Message 8 of 8
(1,638 Views)