OptrisOptrisDocumentation

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

FrameMetadata

public readonly struct FrameMetadata

What the camera recorded alongside a frame's pixels.

A readonly struct, so reading it costs nothing and it can be held after the frame it came from has been disposed.

The three probe temperatures are in the SDK's temperature unit (Celsius unless Sdk.TemperatureUnit chose Fahrenheit) as it was when this was read from the frame.

FrameMetadata: properties

public DetectorSettling DetectorSettling { get; }

What the SDK concluded about the detector's warm-up for this frame.

FrameMetadata.IsThermalDataReliable is this reduced to a bool together with four unrelated conditions, and the reduction loses the half you need to explain a reading. That flag is false for five different reasons (no dark reference yet, the startup calibration still running, the detector still moving, raw data that is one value across the detector, or the camera's calibration missing), and it is true on a camera whose detector the SDK cannot judge at all. So "this frame is a measurement" and "the SDK checked the detector" are different claims, and this property is the second one.

Read it to disclose, not to gate. Nothing is withheld on DetectorSettling.Unknown, by design: an application that wants to mark such a frame as unproven can do so, and one that does not keeps the behaviour it had.

DetectorSettling.Unknown from a player and from the simulated camera, which run no settling criterion.

public Nullable<float> FlagTemperature { get; }

The internal shutter's temperature in the SDK's temperature unit, or null when this camera reported no shutter reading.

A shutter at 0 C is a cold camera; a camera whose telemetry row never decoded has no probe reading at all, and this property was a Single reporting 0 for both. A readout, a chart, a data log or an alarm therefore showed 0 C for a probe the camera had never reported, with nothing to tell it from a genuine zero. null means the camera reported no reading; it does not mean 0 C.

null for the whole session on a camera whose telemetry row cannot decode -- measured on a PI 160x120 at 100 Hz, the one format Optris ships with too few metadata pixels to carry a telemetry row, which published a shutter of 0 C and a housing of 0 C on every frame of every session while FrameMetadata.IsThermalDataReliable was true. 0 C is inside the band the decoder accepts, so the refusal that protects the other probes never covered a row of zeros.

A reading once a row has decoded, which on every other supported camera happens within the first frames and then stays. A row that fails to decode later does not take it away: the value then holds the last decoded row's reading, which is a frame or so old and is still a measurement.

null says nothing about the rest of the frame. FrameMetadata.HousingTemperature, FrameMetadata.SensorTemperature, FrameMetadata.IsFlagOpen and FrameMetadata.Sequence are all still this frame's: one unreadable probe is a fact about that probe.

Never null from the simulated camera. From a player it is null exactly when the recording carried no shutter reading for that frame, so a replay answers the same question a camera does.

An alarm rule on SignalField.FlagTemperature reads AlarmState.Orphaned on such a frame rather than comparing its limits with a zero.

public Nullable<float> HousingTemperature { get; }

The housing temperature in the SDK's temperature unit, or null when this camera reported no housing reading.

The housing probe's half of FrameMetadata.FlagTemperature, on the same rule, from the same decoder, and with the same meaning when it is null: the camera reported no reading, not 0 C. null for the whole session on a camera whose telemetry row cannot decode, measured on the same PI 160x120 at 100 Hz, and a fact about this probe only -- FrameMetadata.FlagTemperature, FrameMetadata.SensorTemperature, FrameMetadata.IsFlagOpen and FrameMetadata.Sequence are all still this frame's.

Never null from the simulated camera. From a player it is null exactly when the recording carried no housing reading for that frame. An alarm rule on SignalField.BoxTemperature reads AlarmState.Orphaned on such a frame rather than comparing its limits with a zero.

A separate property because it describes a separate probe, and a caller asking about the housing should not have to know which probes share a decoder. Both of today's decoders judge the telemetry row as a unit, so in practice the two agree; the HAL decodes each probe separately and a future decoder may.

public bool IsFlagOpen { get; }

Whether the internal shutter was open when the frame was taken.

When it is closed the sensor is looking at the shutter rather than at the scene, so those pixels are not a measurement of anything in front of the camera.

A shutter cycle is not a gap in the stream. Frames keep arriving while the shutter is in the way: the SDK holds the last frame taken with it open and delivers that, so the stream stays continuous and no frame ever shows you the shutter. Those frames carry FrameMetadata.IsRepeatedFrame, and this flag is false on them and says why they are repeats.

true means Open alone, not merely "not shut", so it is false while the shutter is still travelling as well as while it is closed.

This changed in version 12. This remark used to read "do not track the shutter with this: on a live camera it is true on every frame you will ever receive, because such a frame is not a measurement and is never delivered", and that was true when it was written: a cycle appeared as a gap of roughly one to two seconds in which no frame arrived at all. Version 11 held and delivered those frames, and so does this. So the flag now reads false through a closure on every source: a live camera, playback of a recording that stored them, and the simulated camera, whose shutter is configurable through SimulatedCameraOptions.FlagInterval. Code written against the gap (a watchdog, or anything inferring a cycle from frames stopping) has to read this flag, FrameMetadata.IsRepeatedFrame, or ThermalCamera.OnShutterState(…) instead.

ThermalCamera.OnShutterState(…) remains the way to follow the shutter when you want the transitions themselves with timestamps rather than a per-frame answer, and the only way to tell a shutter on its way from one that has arrived, since a camera reports Closing and Opening and no single bool can carry four values.

public bool IsRepeatedFrame { get; }

Whether this frame repeats the previous one rather than carrying new pixels.

Count this, not callbacks, when you care how often the scene was actually measured. While the shutter flag is in the way of the sensor -- a calibration cycle, or a process interface holding it shut -- the SDK keeps the stream going by delivering the last frame taken with the flag open, again. Those frames are perfectly good measurements of a moment that has passed, and they are not new ones. Also true for a few frames after the flag reopens, which hides a shutter that bounces as it settles.

The metadata beside it is not held. The timestamp, the three probe temperatures and FrameMetadata.IsFlagOpen are all this frame's, so an application following any of them through a cycle still sees them move. Only the pixels, the picture drawn from them, the scene extremes and the region and field statistics are held -- and all of those together, so one delivered frame always describes one captured frame.

Not the same question as FrameMetadata.IsThermalDataReliable. A repeat was converted with a dark reference that exists and has settled, so it is reliable, and it is not new. A first frame is new and is not reliable. Neither implies the other.

Always false from a player and from the simulated camera, which produce every frame afresh. For the rate of frames that are not repeats, read ThermalCamera.MeasuredFrameRate.

public bool IsThermalDataReliable { get; }

Whether this frame is a measurement at all.

Check this before reporting a temperature. It is false until the camera's startup calibration has finished and the detector has stopped warming, and again after an operation-mode switch. Frames keep arriving in that time with FrameMetadata.IsFlagOpen true and the right dimensions.

The first frames have no dark reference and clamp to the top of the camera's range: a flat 125.0 C on a PI 4x0 (serial 16030066) and 66.7 to 125.0 C on an Xi 410 (26074397), in a room at about 25 C. The frames after them can drift by several kelvin at every shutter cycle while the camera warms: on a PI 4x0 (16030066) from cold, with the scene held still, the reported scene mean stepped by -5.9, -7.5, -5.5, -4.2, -3.4 and -2.9 C at successive cycles as its detector climbed from 42 C to 71 C, while an Xi 410 that was already warm held to 0.6 C. No range check stands in for this.

How long it stays false belongs to the camera, not to a clock. A dark reference describes the detector at the temperature it was taken at, so the SDK waits until two successive shutter cycles are taken at the same one. A camera that has been running clears inside the startup calibration -- the Xi 410 above reached its first reliable frame at 17.7 s -- and one switched on cold waits for its own warm-up, about four and a half minutes on the PI 4x0 above. The picture is good throughout; it is the numbers beside it that are not.

Also false when the camera's raw data is not a picture at all: on every frame whose raw detector data is one value across the whole detector, and on every frame converted with a dark reference that is: a detector that has stopped reading out. Measured on an Xi 80 that sent 16383, the 14-bit full scale, for every pixel of every frame with the shutter open and shut; the temperatures computed from it looked like a plausible 26 to 37 C picture. The SDK logs an error once when this starts and once when it clears, and keeps the flag false for a few frames after the data varies again. No real scene can cause it: every working detector pixel has an offset of its own, even looking at the closed shutter.

Also false on every frame while the camera's calibration is missing: CalibrationStatus is Missing then, and CalibrationDiagnosis says why. Without its calibration every pixel reads -100.0 °C. SDK 12.0.22 and earlier marked such frames true once the startup calibration had finished.

From a player it is what the camera said when the frame was recorded, so the startup frames of a recording replay as false too, and a loop that skips frames until this is set can reach the end of a recording that never got as far as a measurement. A recording made by SDK 12.0.8 or earlier does not carry it, and every frame of one is true. Always true from the simulated camera, which has no calibration to wait for, except on the frames that the environment variables OTC_SIM_UNRELIABLE_FRAMES and OTC_SIM_SATURATED_FRAMES ask for.

From a still, opened with ThermalCamera.OpenStill(…) or read with Snapshot.LoadThermal, it is what the file records about the frame it was saved from, so a snapshot of a frame that was not a measurement reads back as false. Every PNG and TIFF snapshot records it from 12.0.17 on; a file that does not (a TIFF, or a PNG saved before the camera had drawn a picture, by 12.0.16 or earlier) reads as true. SDK 12.0.14 and earlier read every still as true, whatever its file said.

Which question this answers, stated because it used to read as the stronger claim. It becomes true once the violent part of the warm-up has stopped, and not once the detector is fully settled; Optris's own figure for that is 60 to 90 minutes, and a flag that stayed false for an hour would withhold publication, the alarm rules and the analog output for that hour. If your application needs the hour, it owns that clock. It is also true on a camera whose detector the SDK cannot judge at all: read FrameMetadata.DetectorSettling for which of the three answers applies.

public Nullable<float> SensorTemperature { get; }

The detector temperature in the SDK's temperature unit, or null when this camera has no detector reading.

A detector at 0 C is a cold camera; a detector that did not decode is no reading at all, and this property was a Single reporting 0 for both. A readout, a chart, a data log or an alarm therefore showed 0 C on a camera that had never measured its own detector, with nothing to tell it from a genuine zero.

The detector is the only probe whose telemetry row does not state a temperature: it arrives as a raw ADC count, converted by a curve shared across the product line and then by the unit's own calibration. Where the finished value lands outside the band a detector can physically be at, there is no reading -- measured on a PI 450 (hardware revision 410) and a PI 640i (602), whose counts run far above the converter's width. The SDK logs that once per connection, naming the unit's factor, offset and finished value.

null says nothing about the rest of the frame. FrameMetadata.FlagTemperature, FrameMetadata.HousingTemperature, FrameMetadata.IsFlagOpen and FrameMetadata.Sequence are all still this frame's.

Never null from the simulated camera. From a player it is null exactly when the recording carried no reading for that frame, so a replay answers the same question a camera does.

An alarm rule on SignalField.ChipTemperature reads AlarmState.Orphaned on such a frame rather than comparing its limits with a zero.

public uint Sequence { get; }

The camera's frame counter, which increases by one per frame.

A gap here means frames were dropped between the camera and this process. Compare against ThermalCamera.DroppedFrameCount.

public TimeSpan Timestamp { get; }

When the frame was captured.

A stopwatch reading, not a date. The clock is monotonic and its epoch is whatever the transport counts from: the host's boot on the Linux transports, whatever the capture stack stamps a sample with on Windows. Subtracting one frame's value from another's gives the time between them; the value on its own means nothing outside that stream, does not compare between runs, and is not a point in time you can print as a date.

Greater than zero on every frame you receive. Where the driver has no clock of its own the SDK substitutes the moment the frame arrived on the host, which narrows what the number describes rather than leaving it empty.