OptrisOptrisDocumentation

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

optris::sdk::RoiStats

Computed statistics for an ROI.

The subset of RegionStats that this type can hold. There is no field here for RegionStats' std_dev_c, median_c, pixel_count, coverage or valid, so ToRoi() drops all five. coverage is the one that matters: without it, a mean over the 30 per cent of a region that had sensor behind it looks exactly like a mean over all of it.

Public attributes

min_temp

float min_temp = 0.0f

Coldest sampled pixel, in degrees Celsius. Becomes RegionStats::min_c.

When the ROI covered no pixel at all, ComputeStats() leaves all three temperatures as they were, so a value here can be a reading from an earlier frame rather than from this one. Nothing distinguishes the two cases; RegionStats::valid is what replaces that, and ToRoi() has nowhere to put it.

max_temp

float max_temp = 0.0f

Hottest sampled pixel, in degrees Celsius. Becomes RegionStats::max_c. See min_temp about stale values.

avg_temp

float avg_temp = 0.0f

Arithmetic mean over the sampled pixels, in degrees Celsius. Becomes RegionStats::mean_c. See min_temp about stale values.

min_loc

std::array< float, 2 > min_loc = {0.0f, 0.0f}

Where min_temp was found, as {x, y} normalized to [0, 1] on both axes. Becomes RegionStats::min_loc, with y multiplied by height/width.

max_loc

std::array< float, 2 > max_loc = {0.0f, 0.0f}

Where max_temp was found, in the same units as min_loc. Becomes RegionStats::max_loc, with the same y scaling.

center_loc

std::array< float, 2 > center_loc = {0.0f, 0.0f}

A point to hang a label or marker on, in the same units as min_loc. Becomes RegionStats::centre_loc, with the same y scaling.

Derived from rect alone -- the centre of the bounding rect -- so it is the shape's centre only for Rectangle and Oval. For Circle, whose rect is {cx, cy, diameter, 0}, it lands half a diameter to the right of the true centre; for Line and the point types it is not a centre either. Region::Centre() is exact for every shape, which is the reason to convert rather than to keep reading this.