OptrisOptrisDocumentation

Documentation/OTC SDK/Optris.Sdk — C# API referencev12.0

MeasuredFrameRate

public sealed class MeasuredFrameRate

How many real frames arrived, over how long.

FrameRateInfo answers what the SDK intends to deliver, and every figure in it is read back from configuration. It cannot know about a shutter cycle, a frame held because the flag was in the way, a frame dropped under load, or a camera that is not keeping up. This is the counted answer.

What counts as a frame. One the SDK delivered and that carried new pixels. A frame with FrameMetadata.IsRepeatedFrame set does not count. That is the point: an application counting callbacks gets the callback rate, which does not fall during a shutter cycle because the stream stays continuous.

The algorithm. MeasuredHz = RealFrames / (WindowMs / 1000) -- a count over a sliding window ending now, half-open at the old end so a periodic source is not overcounted by one. Both numbers on the right are reported, so the rate can be re-derived and its resolution worked out: the count quantises the answer to one frame per window, which is 1000 / WindowMs Hz.

The window is long enough to hold at least eight frames at the rate the source is configured for, bounded to between 1 and 4 seconds. A 32 Hz camera is measured over 1 s, a 125 Hz camera over 1 s (0.8 % resolution) and a 4 Hz camera over 2 s rather than over a second that holds four of its frames.

What it does on the cases that matter. A shutter cycle makes the rate dip towards zero for the length of the closure and recover; that is deliberately not smoothed away, because a number that hid the closure would be the configured number wearing a different hat, and MeasuredFrameRate.DeliveredHz and MeasuredFrameRate.RepeatedFrames are what tell a healthy camera mid-cycle from one that has stopped. A dropped frame is never observed, so never counted, and the rate falls. Subsampling is reported as what arrives. A stalled camera reads 0 Hz with MeasuredFrameRate.IsValid set, which is a measurement -- not the same as nothing having been measured yet.

Which number to use. MeasuredFrameRate.MeasuredHz for how often the scene was actually measured over the last window, closures included. MeasuredFrameRate.DeliveredHz for deciding whether the camera is still there. They are equal whenever nothing is being held, which is most of the time. For a figure shown to a user beside a picture, LiveFrameRate: the same count with the shutter closures and a replay's pauses left out, so it does not read 0 through either.

MeasuredFrameRate: properties

public float DeliveredHz { get; }

All frames per second over the same window, repeats included.

The rate to decide whether the camera is alive. A camera mid-closure has MeasuredFrameRate.MeasuredHz near zero and this at its nominal rate; a camera that has actually stopped has both at zero. Treating a low MeasuredFrameRate.MeasuredHz as a lost camera would report every healthy shutter cycle as a fault.

Exactly (RealFrames + RepeatedFrames) / (Window in seconds), so it adds no fact that is not already here -- named rather than left for a caller to derive, because the derivation is the part that gets got wrong.

public bool IsValid { get; }

Whether there is something to report.

false when fewer than two frames have been delivered, or the first arrived too recently to divide by; every other property is then at its default and means nothing. Not the same as a measured zero -- a stalled camera reports true with MeasuredFrameRate.MeasuredHz 0.

public float MeasuredHz { get; }

Real frames per second over MeasuredFrameRate.Window, in Hz.

How often the scene was measured over the last window of wall time. It falls during a shutter closure, because during one the scene is not being measured, and falls to zero across a paused replay. LiveFrameRate.Hz is the same count with those intervals left out, and the figure to show a user.

public uint RealFrames { get; }

Real frames counted in the window -- the numerator of MeasuredFrameRate.MeasuredHz.

public uint RepeatedFrames { get; }

Repeated frames delivered in the same window.

Why MeasuredFrameRate.MeasuredHz is below FrameRateInfo.Effective, when it is. A shutter cycle shows up here; frames lost under load do not, because a frame that was never delivered was never counted either way.

public ulong TotalRealFrames { get; }

Every real frame delivered since the stream started.

public ulong TotalRepeatedFrames { get; }

Every repeated frame delivered since the stream started.

public TimeSpan Window { get; }

The window MeasuredFrameRate.MeasuredHz was counted over.

Shorter than the full window while the stream is younger than it, so a usable figure is available early rather than after four seconds of nothing.