The returned value is based on the difference of camera timestamps between two successful grab() calls.
Does this mean that if I call grab() ten times, then call get_current_fps(), the value returned will only be based on the time between frames 9 and 10, and contain no information about frames 1 - 8?
I’m trying to track the performance of my camera system at regular intervals - say, every 10 seconds - and I’d like to measure the average framerate across each interval. If my understanding is correct, it sounds like get_current_fps() will only give me the “instantaneous” framerate, not the average framerate.
In this case, you should calculate an average of the values returned by get_current_fps in the interval.
To clarify, given that get_current_fps() averages over the last 10 values, would that mean I only need to call get_current_fps() every 10th grab during the interval?
The ZED SDK calculates the average using a “moving window” method. This means that the latest 10 values are used in a circular queue. As each new frame comes in, the oldest value is removed from the array, and the newest one is added. Then, the average is updated based on these values.
You should determine how to calculate your statistical average based on this information.