OptrisOptrisDocumentation

Documentation/OTC SDK/OTC SDK — C++ API referencev12.0

optris::sdk::LiveFrameRate

Real frames per second over the time the scene was being measured.

The frame rate to show a user. MeasuredFrameRate::measured_hz counts real frames over wall time, so it dips towards zero through every shutter cycle and falls to zero while a replay is paused: true of the scene, and useless on a camera tile, which then reads 0 fps for a healthy camera. This is the same count over live time, a clock with two kinds of interval cut out of it, numerator and divisor alike:

  • The interval that ends in a repeated frame: the shutter flag closed, in motion, or settling for the few frames after it reopens, which are exactly the frames marked FrameMetadata::is_repeated_frame. That covers an SDK calibration cycle and a flag held closed by a process interface alike.
  • The time a replay is paused.
hz = real_frames / (window_ms / 1000)

What it does on the cases that matter:

  • A shutter cycle reads the camera's rate throughout, however long the flag is held.
  • A paused replay keeps the rate it had, and reads the file's rate again straight after it resumes rather than a window later.
  • A camera that stops delivering still reads 0, in the middle of a closure too: the time since the newest frame always counts, so a stall is never excused as a closure.
  • A dropped frame lowers it. Subsampling and the export cap read as what arrives.
  • Nothing held or paused within the last window: exactly MeasuredFrameRate::measured_hz over the same window.

The window is the one MeasuredFrameRate uses, measured in live time. A separate struct, rather than fields on MeasuredFrameRate, so that struct keeps the layout every 12.0 program was built against.

Public attributes

valid

bool valid = false

False until there is live time to divide by: two frames delivered and at least a quarter of a second of live time since the first. The other fields are then zero.

Can be false while MeasuredFrameRate::valid is true, for a stream that has never had live time: one that started with the flag closed, or a replay paused straight after it started. Once true it stays true through any closure or pause, however long, because the clock it divides by stops for them.

hz

float hz = 0.0F

Real frames per second over window_ms of live time, in Hz. Exactly real_frames / (window_ms / 1000).

window_ms

float window_ms = 0.0F

The live time hz was counted over, in milliseconds. The same length as MeasuredFrameRate::window_ms once the stream has been live that long; shorter before then.

real_frames

std::uint32_t real_frames = 0

Real frames counted in the live window. The numerator of hz.