04-28-2011 07:55 AM
So I finally got my Basler firewire camera (IEE1394b) to grab frames at its max frame rate (120 fps).
But to do so, I need to use "Format 7" .. .which is kind of confusing to me. When I use "Format 7", I can not specify the frame rate (frames per second). Apparently, you only specify image parameters (length, width, color/mono) and the packet size and a few other things.
So how do I calculate the frame rate? I need to know exactly how much time elapses between each frame. And it needs to be constant. I can't have a varying frame rate.
NI told me I can calculate the frame rate using this equation:
Which comes from this KB article.
But I am skeptical because that article also says:
Please note that the time to transfer a frame is slightly faster than the time it takes to acquire a frame.
Can people out there clarify this for me? Is the frame rate constant? And can I actually calculate it when using Format 7?
Solved! Go to Solution.
05-04-2011 12:46 PM
Hey John,
I believe Justin has already answer this question:
"Format 7 is designed as a "free run" mode that allows the user to change many of the settings that the other formats do not support. Some cameras require format 7 to obtain the fastest frame rate.
With format 7, the framerate is not set. Instead, the image size and transfer rate is set as indicated by the equation you presented. This should be a pretty accurate calculation of the frame rate and should not fluctuate if you know the exact image size and bit depth.
If you need absolute control of the frame rate, you could use an external tirgger. "
Regards,
A. Zaatari
05-04-2011 01:02 PM
OK. But the formula he is referring to is for calculating the transferred frame rate. Not the acquired acquired frame rate. Which is apparently slower:
Please note that the time to transfer a frame is slightly faster than the time it takes to acquire a frame.
But I guess that will have to do.
05-04-2011 01:05 PM
The frame rate will be constant. It will not change from frame to frame. The tough part is figuring out what it is.
The Basler camera manual will tell you how to calculate the frame rate. There are three different calculations, and whichever gives you the slowest frame rate is the one you use. These calculations are pretty accurate, I think.
Another possibility is to measure the frame rate, but that requires several seconds (or minutes) for an accurate measurement. The simplest method is to start a continuous acquisition and record the time of an early frame, wait several seconds (or minutes) and record the time of another frame. Subtract the frame numbers, subtract the times, and divide them to get the frame rate. With a several minute wait this is extremely accurate. To get the acquisition time, read a frame with "Next Frame" set, then record the frame number and read the msec timer immediately following the read. Using a flat sequence structure is probably best to make sure everything happens in the order you want. If you do the reads in a loop, you will see the frame rate slowly converge to the actual frame rate. Stop it when it is accurate enough.
In one program I wrote, I controlled the frame rate by setting the shutter exposure time. I used the formula from the Basler manual for frame rate and inverted it to calculate the shutter speed. This only works if you have another way of adjusting the light levels (aperture, light source, etc.).
Bruce
05-04-2011 04:25 PM
I was feeling nice, so I wrote a quick program for measuring the frame rate. It will gradually converge to a very accurate value, although it can take minutes to get several decimal places of accuracy. It all depends how much resolution you need.
Just select your camera on the block diagram and run it.
Bruce
05-05-2011 07:15 AM
This is great! Thank you, Bruce!
I think I will use this code to very the equations in the Basler manual.
I'll try and post my results here.
05-31-2011 06:55 AM
Hi Bruce... I see from the Discussion Boards that you are very good at IMAQ and Vision. I am stuck on this issue:
http://forums.ni.com/t5/LabVIEW/Stream-2-x-120-fps-cameras-to-disk-HDD-can-t-keep-up/m-p/1580050
An tips would be highly appreciated (and kudoed!)!