OptrisOptrisDocumentation

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

optris_sdk_frame_info

Everything about a frame except its pixels.

Its temperatures (the three probes and the frame's extremes) are in the SDK's temperature unit (Celsius unless optris_sdk_set_temperature_unit() chose Fahrenheit) in force when the record is read, not when the frame was captured. In Fahrenheit a temperature that is not a reading (its *_known field zero) is NaN instead of the 0.0 it is in Celsius.

Public attributes

struct_size

uint32_t struct_size

Set to sizeof(optris_sdk_frame_info).

width

uint32_t width

Frame width in pixels.

height

uint32_t height

Frame height in pixels.

pixel_count

uint32_t pixel_count

width * height.

timestamp_us

uint64_t timestamp_us

When the frame was captured, in microseconds.

A stopwatch reading, not a date. The clock is monotonic and its epoch is whatever the transport counts from. On the Linux transports it is the host's boot (steady_clock, the same clock the file-name {timestamp_us} uses); on Windows it is whatever the capture stack stamps the sample with, measured as the host's boot on a PI 640 (S/N 14110089) but not promised to be. Differences between frames of one stream are meaningful; the absolute value is not, it does not compare between runs or between processes, and adding it to the Unix epoch gives a date in 1970.

Non-zero on every delivered frame. A transport whose driver offers no stamp of its own substitutes the host's arrival time, which narrows what the number describes without making it unusable. It is written on every transport, not only by the simulated camera and playback, which build their own metadata.

sequence

uint32_t sequence

Monotonic frame counter.

reserved0

uint32_t reserved0

Reserved; always zero.

flag_temp_c

float flag_temp_c

Internal shutter (flag) temperature, in the SDK's temperature unit.

box_temp_c

float box_temp_c

Housing temperature, in the SDK's temperature unit.

chip_temp_c

float chip_temp_c

Sensor chip (detector) temperature, in the SDK's temperature unit.

Only a reading when chip_temp_known is non-zero. Otherwise it is 0.0 (NaN in Fahrenheit), which is not a detector at 0 C -- read that field before showing, charting, logging or comparing this one.

min_temp_c

float min_temp_c

Coolest temperature in the frame, in the SDK's temperature unit.

max_temp_c

float max_temp_c

Warmest temperature in the frame, in the SDK's temperature unit.

min_index

uint32_t min_index

Linear pixel index of min_temp_c.

Only a pixel when extremes_known is non-zero. Otherwise it is 0, which is not the top-left corner.

Row-major from the top-left: x = index % width, y = index / width. Prefer optris_sdk_frame_extreme_location(), which does that and refuses when there is no such pixel -- the hand-written division is how this came to mean four different things in four languages.

max_index

uint32_t max_index

Linear pixel index of max_temp_c. Only a pixel when extremes_known is non-zero; see min_index.

flag_open

uint8_t flag_open

Non-zero when the internal shutter was open. Pixels captured with the shutter closed are looking at the shutter, not at the scene.

thermal_data_reliable

uint8_t thermal_data_reliable

Non-zero when this frame is a measurement.

Check this before reporting a temperature. Zero until the camera's startup calibration has finished -- about 18 s after optris_sdk_imager_start() on every camera measured -- and again for a few seconds after an operation-mode switch. flag_open is true on those frames and their dimensions are right.

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), 66.7..125.0 C on an Xi 410 (26074397), in a room at about 25 C. The frames after them can drift by tens of kelvin with nothing in view changing: 11.6..26.6 C to -45.0..7.3 C in eight seconds on a PI 4x0 (16040026), while an Xi and a PI 640i held steady -- so no range check stands in for this.

How long it stays zero is a property of the camera, not a fixed time. A dark reference describes the detector at the temperature it was taken at, so the SDK compares the detector temperature at each shutter cycle with the one before it and waits until they agree. 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, measured at about four and a half minutes on a PI 4x0 (16030066) whose detector climbed from 42 C to 71 C.

Also zero 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 byte zero 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 zero on every frame while the camera's calibration is missing: optris_sdk_imager_get_calibration_status() reports OPTRIS_SDK_CALIBRATION_MISSING then, and optris_sdk_imager_get_calibration_diagnosis() says why. Without its calibration every pixel reads -100.0 C. SDK 12.0.22 and earlier set this byte once the startup calibration had finished.

Waiting longer for the first frame does not help. Skip frames until this is non-zero. From a player it is what the camera said when the frame was recorded, so the startup frames of a recording replay as zero too; a recording made by SDK 12.0.8 or earlier does not carry it, and every frame of one is non-zero. From a still, opened with optris_sdk_still_open() or read with optris_sdk_snapshot_acquire_frame(), 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 zero. 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 non-zero. SDK 12.0.14 and earlier read every still as non-zero, whatever its file said. Always non-zero 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.

Which question this answers, stated because it used to read as the stronger claim. It becomes non-zero 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. Only the first can be answered per frame: a flag that stayed zero 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. An application that needs the hour owns that clock.

It is also non-zero on a camera whose detector the SDK cannot judge at all. Read detector_settling for which of the three answers applies.

is_repeated_frame

uint8_t is_repeated_frame

Non-zero 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. Also non-zero for a few frames after the flag reopens, which hides a shutter that bounces as it settles.

The rest of this record is not held: the timestamp, the probe temperatures and flag_open are all this frame's. Only the pixels, the picture drawn from them, min_temp_c / max_temp_c and the region and field statistics are held -- all together, so one delivered frame always describes one captured frame.

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.

Always zero from a player and from the simulated camera, which produce every frame afresh.

New in version 12. It takes one of the reserved bytes after thermal_data_reliable, so sizeof(optris_sdk_frame_info) is unchanged and no caller needs recompiling: one that never reads it is unaffected, and one that does gets a byte previously documented as always zero -- the value meaning "a new frame", which is what every frame was before the SDK held any.

chip_temp_known

uint8_t chip_temp_known

Non-zero when 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. Check it before reporting the detector temperature, the same way thermal_data_reliable is checked before reporting a scene temperature.

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. A finished value outside the band a detector can physically be at is not a reading -- 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 with the unit's factor, offset and finished value, because it should be a defect with a cause rather than a routine outcome.

Zero means nothing else in this record is in doubt: the other probe temperatures, flag_open, the sequence and the timestamp are all still this frame's. One unreadable probe is a fact about that probe.

Non-zero on every frame from the simulated camera, and on playback exactly when the recording carries a detector reading for that frame.

The matching behaviour on the alarm bus is that OPTRIS_SDK_FIELD_CHIP_TEMP is published only while this is non-zero, so a rule on the detector reads OPTRIS_SDK_ALARM_ORPHANED on such a frame instead of comparing its limits with a zero.

New in version 15. It takes one of the five reserved bytes after is_repeated_frame, so sizeof(optris_sdk_frame_info) is unchanged and no caller needs recompiling: one that never reads it is unaffected, and one that does gets a byte previously documented as always zero. Zero is also the pre-existing answer for "nobody said", so an older library against this header reads as "no detector reading" rather than as a false one. Same mechanism as is_repeated_frame above and as optris_sdk_frame_rate_info::export_restricted.

detector_settling

uint8_t detector_settling

One of the optris_sdk_detector_settling values, as a byte.

thermal_data_reliable 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 zero 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 non-zero 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 field is the second one.

Read it to disclose, not to gate: nothing is withheld on OPTRIS_SDK_DETECTOR_SETTLING_UNKNOWN, deliberately, so an application that wants to mark such a frame unproven can, and one that does not keeps the behaviour it had.

New in version 16. It takes one of the four bytes still reserved after chip_temp_known, so sizeof(optris_sdk_frame_info) is unchanged and no caller needs recompiling. Zero is also the pre-existing answer for "nobody said", and zero is OPTRIS_SDK_DETECTOR_SETTLING_UNKNOWN -- so an older library behind this header reads as "cannot tell" rather than as a verdict it never reached.

extremes_known

uint8_t extremes_known

Non-zero when min_index, max_index, min_temp_c and max_temp_c describe pixels that were actually measured.

Zero means the frame had nothing measurable in it, and then all four of those fields are 0 (the two temperatures NaN in Fahrenheit) -- which is not a coldest pixel of 0.0 C at the top-left corner. Read this before showing, charting, logging or comparing any of them, exactly as chip_temp_known governs chip_temp_c.

It is not a rare case. Radial distortion correction in Wide mode leaves about a sixth of every frame unmeasurable by design, and a frame can be entirely unmeasurable -- before the startup calibration finishes, or on a decode that produced nothing. The producers have always known: client_bridge.h counts the measurable pixels and zeroes the two temperatures when the count is nought, and the recording metadata has carried the indices as std::optional since it was written. What was missing was any way to say so on this surface, so a consumer could not tell an unmeasurable frame from a real reading at index 0 -- the same shape as the detector temperature's own known flag.

New in version 24. It takes one of the three bytes still reserved after detector_settling, so the struct's size is unchanged and no caller's struct_size arithmetic moves. A zeroed struct reads as "nobody said", which is the safe direction.

flag_temp_known

uint8_t flag_temp_known

Non-zero when flag_temp_c is a reading at all.

A shutter at 0 C is a cold camera; a camera whose telemetry row never decoded has no probe reading at all, and until this field existed the two were the same number. Check it before showing, charting, logging or comparing flag_temp_c, the same way chip_temp_known is checked before reporting the detector.

Zero for the whole session on a camera whose telemetry row cannot decode -- measured on a PI 160x120 @ 100 Hz, the one format of seventy in Formats.def with too few metadata pixels to carry a row, which published a shutter of 0 C and a housing of 0 C on every frame of every session while thermal_data_reliable read non-zero. 0 C is inside the band the decoder accepts, so the refusal that protects the other probes never covered a row of zeros.

Non-zero 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 two temperatures then hold the last decoded row's readings, which are a frame or so old and are still measurements.

Zero means nothing else in this record is in doubt. One unreadable probe is a fact about that probe.

Non-zero on every frame from the simulated camera, and on playback exactly when the recording carries that reading for that frame.

The matching behaviour on the alarm bus is that OPTRIS_SDK_FIELD_FLAG_TEMP is published only while this is non-zero, so a rule on the shutter reads OPTRIS_SDK_ALARM_ORPHANED on such a frame instead of comparing its limits with a zero.

New in version 26. It takes the last two of the three bytes reserved after detector_settling -- version 24 spent the first on extremes_known, and version 25 spent none here -- so sizeof(optris_sdk_frame_info) is unchanged at 72 and no caller needs recompiling: one that never reads it is unaffected, and one that does gets a byte previously documented as always zero.

That reserved block is now exhausted. reserved1 below is re-declared over this struct's existing tail padding, which the 8-byte alignment of timestamp_us has always left unused, so a later field still has somewhere to go at the same sizeof -- but it must come out of the re-declared reserved1, because there is nothing left in the three bytes after detector_settling.

Same mechanism as chip_temp_known above -- but note that zero is NOT the pre-existing answer here, because the pre-existing behaviour was to present these two as readings always. An older library behind this header therefore reads as "no reading" for probes it was in fact reporting; read optris_sdk_c_abi_version() if you must tell the two apart.

box_temp_known

uint8_t box_temp_known

Non-zero when box_temp_c is a reading at all. The housing probe's half of flag_temp_known, on the same rule, from the same decoder, and with the same meaning when zero.

A separate field 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.

reserved1

uint8_t reserved1[4]

Reserved; always zero.

Four bytes, re-declared over the tail padding this struct has always carried: the three bytes reserved after detector_settling are spent (extremes_known in version 24, flag_temp_known and box_temp_known in 25). sizeof is 72 either way, so naming the padding costs nothing and leaves the next field somewhere to go without growing the struct.