FrameInfo
pub struct FrameInfo
Everything about a frame except its pixels.
An owned copy, so it outlives the frame it was read from.
Its temperatures (*_temp_c, despite the names) are in the SDK's
temperature unit (Celsius unless crate::set_temperature_unit
chose Fahrenheit) as it was when the copy was read; a copy kept
across a unit change keeps the unit it was read in.
FrameInfo — fields
width: u32
Frame width in pixels.
height: u32
Frame height in pixels.
pixel_count: u32
width * height.
timestamp_us: u64
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 (the host's boot on the Linux transports, whatever the capture stack stamps a sample with on Windows). Differences between frames of one stream are meaningful; the absolute value is not, and it does not compare between runs. Non-zero on every delivered frame.
sequence: u32
Monotonic frame counter.
flag_temp_c: Option<f32>
The internal shutter (flag) temperature in the SDK's temperature
unit, or None 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.
In earlier releases this was an f32 reporting 0.0 for both, so a readout, a
chart or an alarm showed 0 °C for a probe the camera had never
reported. None means the camera reported no reading; it does
not mean 0 °C.
None for the whole session on a camera whose telemetry row
cannot decode, measured on a PI 160x120 @ 100 Hz, the one
format Optris ships 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. 0 °C is inside the band the
decoder accepts, so the refusal that protects the other probes
never covered a row of zeros.
Some 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.
None says nothing about the rest of the frame: box_temp_c,
chip_temp_c, flag_open, sequence and timestamp_us are
all still this frame's; one unreadable probe is a fact about
that probe. Never None from the simulated camera;
from a player, None exactly when the recording carries no
shutter reading for that frame.
box_temp_c: Option<f32>
The housing temperature in the SDK's temperature unit, or None
when this camera reported no housing reading.
The housing probe's half of FrameInfo::flag_temp_c, on the
same rule, from the same decoder, and with the same meaning
when it is None: the camera reported no reading, not 0 °C
None for the whole session on a camera whose
telemetry row cannot decode, and a fact about this probe only;
flag_temp_c, chip_temp_c, flag_open and sequence are
all still this frame's. Never None from the simulated camera;
from a player, None exactly when the recording carries no
housing reading for that frame.
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.
chip_temp_c: Option<f32>
The detector temperature in the SDK's temperature unit, or None
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. In earlier releases this was an
f32 reporting 0.0 for both, so a readout, a chart or an alarm
showed 0 °C on a camera that had never measured its own
detector.
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). The SDK logs that once per connection, naming the unit's factor, offset and finished value.
None says nothing about the rest of the frame: flag_temp_c,
box_temp_c, flag_open and sequence are all still this
frame's. Never None from the simulated camera; from a player,
None exactly when the recording carried no reading for that
frame.
min_temp_c: f32
Coolest temperature in the frame, in the SDK's temperature unit.
max_temp_c: f32
Warmest temperature in the frame, in the SDK's temperature unit.
min_index: u32
Linear pixel index of FrameInfo::min_temp_c.
Only a pixel when FrameInfo::extremes_known is true.
Prefer FrameInfo::min_location, which does the row-major
arithmetic and answers None when there is no such pixel.
max_index: u32
Linear pixel index of FrameInfo::max_temp_c. Only a pixel
when FrameInfo::extremes_known is true.
extremes_known: bool
Whether the four fields above describe measured pixels at all.
Read through FrameInfo::extremes_known; the field is public
because every other field on this struct is.
flag_open: bool
Whether the internal shutter was open.
When this is false the sensor was looking at its own shutter,
not at the scene. Those pixels are not a measurement of anything
in front of the camera, see Frame::is_measurement.
thermal_data_reliable: bool
Whether this frame is a measurement at all.
Check this before reporting a temperature. false until the
camera's startup calibration has finished, about 18 s after
starting 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, then
-45.0..7.3 °C eight seconds later, on a PI 4x0 (16040026).
Frame::is_measurement accounts for this.
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 this 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: Camera::calibration_status reports
CalibrationStatus::Missing then, and
Camera::calibration_diagnosis says why. Without its calibration
every pixel reads -100.0 °C. SDK 12.0.22 and earlier returned
true for such frames once the startup calibration had finished.
From a recording it is what the camera said when the frame was
recorded, so the startup frames of a recording replay as false
too; 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.
detector_settling: DetectorSettling
What the SDK concluded about the detector's warm-up for this frame.
thermal_data_reliable above is this reduced to a bool
together with three unrelated conditions, and the reduction
loses the half you need to explain a reading: that flag is
false for four different reasons, and it is true on a camera
whose detector the SDK cannot judge at all. Read this to
disclose, not to gate; nothing is withheld on
DetectorSettling::Unknown.
FrameInfo — methods
pub fn min_location(&self) -> Option<(u32, u32)>
Where the coolest measured pixel is, as (x, y).
None when the frame had nothing measurable in it, which
this binding once could not report: min_index is 0 on
such a frame, and Some((0, 0)) is indistinguishable from a
genuine cold spot in the top-left corner. This crate was the
only binding that implemented the conversion at all and it had
that gap, with its own test asserting the wrong answer.
pub fn max_location(&self) -> Option<(u32, u32)>
Where the warmest measured pixel is, as (x, y).
None on a frame with nothing measurable; see
FrameInfo::min_location.
pub fn extremes_known(&self) -> bool
Whether min_index, max_index, min_temp_c and max_temp_c
describe measured pixels at all.
False when the frame had nothing measurable, and then all four
are 0 -- which is not a coldest pixel of 0.0 °C at the corner.
With the SDK's unit Fahrenheit the two temperatures read NaN
there instead, since a converted 0 would read as a real 32 °F.
The same distinction chip_temp_c's Option draws one field
over, and for the same reason: 0 is a legitimate value, so it
cannot also mean "no value".