Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Camera control program-- controlling frame rate

Hi all,

 

I created this LV program to control two cameras at a time. The loop has been setup so that images can be acquired at a specific rate (frames per second control). I am using a normal while loop and I am timing it using the Wait VI. But the program doesn't work in the sense that when I set the frames per second to be 1, it takes roughly 1700ms to get a picture and when I set the fps to 2, it roughly takes 1100 ms to get a picture. What do you think the problem might be? I am attaching the picture of the code and the actual VI.

 

 

Download All
0 Kudos
Message 1 of 5
(3,689 Views)

Have you tried specifying the wait interval for the while loop inside the Start Video Capture loop?  Just have the loop cycle once every second for images acquired at one second intervals.  Just a thought.

0 Kudos
Message 2 of 5
(3,674 Views)

I can't do it. Because I also need to have a control that could grab a picture at any time. So if I just specified the wait interval I won't be able to do so.

0 Kudos
Message 3 of 5
(3,673 Views)

Perhaps record the time at which you acquire each image, and compare the elapsed time to the desired interval.  Assuming your loop will take exactly 100 msec every time is not correct.  It will take a minimum of 100 msec, but there is no upper limit.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 4 of 5
(3,669 Views)

Hi SalehRyerson,

In the VI, you are acquiring at approximately 10 frame per second (based on the 100ms Wait VI delay for the while loop) and you display some of the pictures acquired in Grab Image 2 and Grab Image 5 based on the frame rate and you get the capture time based on the time where Capture Time 2 and 3 are updated (Which I am not quite sure where it is being updated. Am I correct?

 

From the VI, how do you determine that it takes 1700ms or 1100ms to get a picture?

 

Understanding what you want to achieve in your application, it may be best to actually have the timing properties comes from the camera timing embedded in the image (It is properties that you need to enable) and then check the image time difference to ensure that your loop control executes within a time or in the frame rate that you defined. In addition, instead of using Wait VI, it would be better to use Wait for Multiple Ms VI for software controlled acquisition.

 

BTW, what cameras and interface that you are using?

 

I hope these input helps.

- Meadow -
LabVIEW 7.0 - 2011, Vision, RT, FPGA
TestStand 3.0 - 4.5
0 Kudos
Message 5 of 5
(3,660 Views)