optris::sdk::FrameMetadata
Metadata accompanying each captured frame.
Its temperatures are always Celsius, as the camera reported them: flag_temp_c, box_temp_c, chip_temp_c and ambient_temp_c do not follow SetTemperatureUnit(). This is the record a frame shares, by reference, with every consumer inside the SDK. For the same readings in the SDK's temperature unit, use ThermalFrame::GetFlagTemperature(), GetBoxTemperature(), GetChipTemperature() and GetAmbientTemperature().
Public attributes
timestamp_us
uint64_t timestamp_us = 0
When the frame was captured, in microseconds.
A stopwatch reading, not a date. Monotonic, on whatever epoch the transport counts from -- the host's boot on the Linux transports, and whatever the capture stack stamps a sample with on Windows. b.timestamp_us - a.timestamp_us is how long passed between two frames of one stream; the absolute value means nothing outside that stream and nothing at all as a date.
Non-zero on every delivered frame. Where a driver offers no stamp of its own -- the Ethernet and libusb transports -- the host's arrival time stands in for it. In an earlier release this was 0 on every frame of every real camera, on every transport, while the simulated camera and playback reported it correctly.
sequence
uint32_t sequence = 0
Monotonic frame sequence number.
flag_temp_c
float flag_temp_c = 0.0f
Internal flag (shutter) temperature.
Only a reading when flag_temp_known is true. Otherwise it is 0.0f, which is not a shutter at 0 C; see that field.
box_temp_c
float box_temp_c = 0.0f
Housing temperature.
Only a reading when box_temp_known is true. Otherwise it is 0.0f, which is not a housing at 0 C; see that field.
flag_temp_known
bool flag_temp_known = false
Whether flag_temp_c and box_temp_c are readings at all.
A housing at 0 C is a camera in a freezer; a camera whose telemetry never decoded has no probe reading at all, and until these fields existed the two were the same number. Read them before showing, charting, logging or comparing the two temperatures above -- the same rule chip_temp_known states for the detector and ambient_temp_valid states for the ambient.
False means the camera's telemetry row has never decoded on this connection. Measured on a PI 160x120 @ 100 Hz -- the one format of seventy in packaging/Formats.def with too few metadata pixels to carry a row at all -- which published a flag of 0 C and a housing of 0 C on every frame of every session while reporting thermal_data_reliable true.
True once a row has decoded, which on every other supported camera is within the first frames and stays true. A row that fails to decode later does not take it away: the two values then hold the last decoded row's readings, which are a frame or so old and are still measurements -- the same hold is_repeated_frame describes for the pixels.
The two flags are separate fields because they describe two probes, 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.
On the alarm bus the matching behaviour is that optris::sdk::SignalField::kFlagTemp and optris::sdk::SignalField::kBoxTemp are published only while these are true, so a rule on either reads AlarmState::kOrphaned on such a camera rather than comparing its limits against a zero.
box_temp_known
bool box_temp_known = false
See flag_temp_known.
chip_temp_c
float chip_temp_c = 0.0f
Sensor chip (detector) temperature.
Only a reading when chip_temp_known is true. Otherwise it is 0.0f, which is not a detector at 0 C; see that field.
chip_temp_known
bool chip_temp_known = false
Whether chip_temp_c is a reading at all.
A chip at 0 C is a cold camera; a chip that did not decode is no camera reading at all, and until this field existed the two were the same number. Read this before showing, charting, logging or comparing chip_temp_c -- the same rule ambient_temp_valid states below for the ambient, and the same reason RawFrame::HasMetadata() exists.
The detector is the only probe whose telemetry row does not state a temperature: it is a raw ADC count, converted by a curve shared across the product line and then by this unit's own TempChipFactor and TempChipOffset. When the finished value lands outside the band a detector can physically be at, no reading has been produced -- measured on a PI 450 hw 410 and a PI 640i hw 602, whose counts run far above the converter's width. The SDK logs that case once per connection at error level, naming the unit's factor, offset and finished value, because it should be a defect with a cause rather than a routine outcome.
False means nothing else in the frame is in doubt. The flag, housing and optics readings, the shutter state, the device frame counter and the PIF inputs are all still this frame's: one unreadable probe is a fact about that probe and about nothing else.
True on every frame from the simulated camera, whose detector is drawn inside the physical band. On playback it is true exactly when the recording carries a detector reading for that frame, so a replay answers the same question a live camera does.
On the alarm bus the matching behaviour is that optris::sdk::SignalField::kChipTemp is published only while this is true, so a rule on the detector temperature reads AlarmState::kOrphaned on such a frame rather than comparing its limits against a zero.
flag_open
bool flag_open = true
True when the internal shutter was open for this frame.
False through a shutter cycle, on every source -- including while the shutter is still travelling, because this field is true for Open alone and not merely for "not shut". 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 is_repeated_frame, and this flag says why they are repeats.
This changed in version 12. It used to be true on every frame of a live camera, because the closed window was withheld instead of held: a shutter cycle appeared as a gap of roughly one to two seconds in which no frame arrived at all. Version 11 held and delivered them, and so does this. Code written against the gap -- a watchdog, or anything inferring a cycle from frames stopping -- should read this flag, is_repeated_frame, or Imager::SetShutterCallback() instead.
Imager::SetShutterCallback() 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.
is_repeated_frame
bool is_repeated_frame = false
True when 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 this is not held. The timestamp, the probe temperatures, the PIF inputs and flag_open 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 are held together, so one delivered frame always describes one captured frame.
This is version 11's isSameFrame. Version 12 declared the field internally and never wrote it, so an application received held temperatures marked as live measurements. One measurement found a region reading 99.3 / 101.9 / 92.7 C, frozen at the last open frame, across a 9.5 s closure the SDK never reported.
Not the same question as thermal_data_reliable. 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, which is why they are two fields.
False on every frame from the simulated camera and from playback, which produce every frame afresh.
For the rate of frames that are not repeats, read Processing::RealFrameRate().
thermal_data_reliable
bool thermal_data_reliable = true
Whether this frame is a measurement at all.
Check this before reporting a temperature. 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 the shutter reported open and the right dimensions, and they are wrong in two different ways:
- The first frame or two are converted before the first non-uniformity correction has produced a dark reference, so the energies run off the end of the camera's calibration curve and clamp to its top. Measured: a PI 4x0 (serial 16030066) read a flat 125.0 C, a PI 640i (22042036) 104.3..125.0 C, an Xi 400 (21074191) 96.9..125.0 C and an Xi 410 (26074397, over Ethernet) 66.7..125.0 C, all in a room at about 25 C.
- After that the frames look plausible and may not be. A camera that has just been switched on is still warming, and a dark reference describes the detector at the temperature it was taken at. 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 K at successive shutter cycles while the detector chip climbed from 42 C to 71 C -- each step being how wrong the frames just before it had been. An Xi 410 (26074397) that was already warm held its mean to 0.6 K over the same kind of run, which is why no range check or comparison between frames can stand in for this flag.
So how long is it false for? As long as that camera needs, and not a fixed time. The SDK compares the detector temperature at each shutter cycle with the one before it; two cycles at the same temperature mean the reference is describing a detector that has stopped moving. A camera that has been running holds still from the start and clears inside the startup calibration, about 18 s -- the Xi 410 above reached its first reliable frame at 17.7 s. A camera switched on cold waits for its own warm-up: the PI 4x0 above took about four and a half minutes.
A caller that cannot wait that long can still show the picture -- it is a perfectly good picture -- and should simply not put a number next to it. Nothing else is suppressed: frames, statistics and regions all keep arriving.
Waiting longer for the first frame does not help: that is how long a frame takes to arrive, not whether it is right. Skip frames until this is true:
while (!frame.GetMetadata().thermal_data_reliable) {
frame = camera.GetFrame();
}
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. 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 and were not a measurement of anything. 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, so a uniform scene is never marked.
Also false on every frame while the camera's calibration is missing: Imager::GetCalibrationStatus() reports CalibrationStatus::kMissing then, and GetCalibrationDiagnosis() says which files and why. Without its calibration every pixel of a camera reads -100.0 C, which is not a measurement of anything. The flag stops being held false once a calibration is loaded; for files copied in afterwards that is the next open. SDK 12.0.22 and earlier marked such frames true once the startup calibration had finished.
A frame played back from a recording says what the camera said when it was recorded, so a recording made during the startup calibration replays those frames as false too, and that loop 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 the flag, and every frame of one replays as true. A still (StillSource, rec::Snapshot::LoadThermal()) says what its 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 a picture was drawn, by 12.0.16 or earlier) reads as true. SDK 12.0.14 and earlier read every still as true, whatever its file said. The simulated camera has no calibration to wait for and is true throughout, except on the frames that the environment variables OTC_SIM_UNRELIABLE_FRAMES (a startup calibration) and OTC_SIM_SATURATED_FRAMES (a detector stuck at full scale) ask for, which exist so an application can see its own handling of both without a camera.
Which question this answers, stated because it used to read as the stronger claim. It is true once the violent part of the warm-up has stopped -- the kelvins-per-minute a camera shows in its first minutes -- and not once the detector is fully settled, which Optris's own figure puts at 60 to 90 minutes. Those are different questions and only the first one can be answered per frame: a flag that stayed false for an hour would withhold publication, the alarm rules and the analog output for that hour, which is worse than the inaccuracy it would be guarding against. If your application needs the hour, it owns that clock.
It is also true on a camera whose detector the SDK cannot judge, which is the second thing it cannot tell you. Read detector_settling for which of the three answers applies.
detector_settling
DetectorSettlingState detector_settling = DetectorSettlingState::kUnknown
What the SDK concluded about the detector's warm-up for this frame.
thermal_data_reliable above is this reduced to a bool, and the reduction loses the half you need to explain a reading. That flag is false for five unrelated 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 "the frame is a
measurement" and "the SDK checked the detector" are different claims, and this field is the second one.
Read it to disclose rather than to gate. The SDK does not withhold anything on DetectorSettlingState::kUnknown, by design: an application that wants to mark such a frame as unproven can do so, and one that does not keeps exactly the behaviour it had.
DetectorSettlingState::kUnknown from a player and from the simulated camera, which run no settling criterion.
ambient_temp_c
float ambient_temp_c = 0.0f
The ambient temperature this frame was measured with, in C.
Not the configured value: while ambient estimation is on this is the estimate the pipeline actually built its energy table from, and while it is off it is the configured value. Reading it is the only way to know what the measurement is based on, since RadiationConfig::ambient_temp_c reports what was asked for in either mode.
Only meaningful when ambient_temp_valid is set.
ambient_temp_valid
bool ambient_temp_valid = false
False when no ambient is in force yet -- estimation is on and no box probe reading has arrived, or estimation is off and no ambient was ever configured. Prefer leaving a display blank over showing a default that no measurement used.