RegionStats
pub struct RegionStats
One region's measurement for one frame.
Check RegionStats::valid before trusting any of the numbers. A
region that has not been measured yet (because streaming has not
started, or because it is disabled) reports invalid rather than
zero temperatures that look real.
The temperatures are in the SDK's temperature unit (Celsius unless
crate::set_temperature_unit chose Fahrenheit), the names
notwithstanding; the standard deviation is a difference in degrees
of it. With the SDK's unit Fahrenheit, a value that is only a
placeholder (every temperature while valid is false, the median
when it was not computed) reads NaN rather than a converted zero,
which would read as a real 32 °F.
RegionStats — fields
min_c: f32
Coolest temperature in the region, in the SDK's temperature unit.
max_c: f32
Warmest temperature in the region, in the SDK's temperature unit.
mean_c: f32
Mean temperature over the region, in the SDK's temperature unit.
std_dev_c: f32
Standard deviation of the region's temperatures: a difference in degrees of the SDK's temperature unit (kelvin-sized in Celsius, Fahrenheit-sized in Fahrenheit).
median_c: f32
Median temperature, in the SDK's temperature unit.
Zero (NaN in Fahrenheit) unless the region was asked for
percentiles with Region::want_percentiles, because computing
it costs extra work on every frame.
min_loc: Vec2
Where the coolest pixel is, in region coordinates.
max_loc: Vec2
Where the warmest pixel is, in region coordinates.
centre_loc: Vec2
The region's centre, in region coordinates.
pixel_count: u32
How many pixels were sampled.
coverage: f32
Pixels sampled over pixels the region nominally covers.
1.0 in the ordinary case. Below 1.0 when part of the region had no sensor behind it: an aperture clipped by the image edge, or an area region hanging off the frame. This is what separates "20 degrees across this region" from "20 degrees across the 30 per cent of it that had data".
valid: bool
Whether the statistics above mean anything.