OptrisOptrisDocumentation

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

optris::sdk::RegionSample

One pixel a region covered, kept so the caller can plot the profile the statistics were reduced from.

What a sample is: What a sample is A sample is one pixel, not a resampled point. It is exactly the pixels the statistics were computed over -- every pixel whose centre passes the same Contains() test at the same LineTolerance() the measuring pass used -- so the profile and RegionStats can never be two opinions about the same region. Nothing is interpolated: resampling a line to a fixed number of points would invent values between pixel centres and hide how many pixels a short line actually had.

A sample can say "not measurable": A sample can say "not measurable" value_c is quiet NaN for a pixel the SDK could not measure -- the border radial distortion correction leaves in Wide mode, or a dropped pixel. Such a pixel is still present in the profile, with its position and its coordinates, because a gap the caller cannot see is worse than one it can: the chart draws a break rather than a straight line between the two sides of a hole. It is left out of RegionStats, which is why pixel_count can be smaller than the number of samples, and why their ratio is the measurable half of RegionStats::coverage.

NaN rather than a sentinel temperature, for a settled reason: every comparison against NaN is false, so an unmeasurable sample cannot be plotted, averaged or compared against a limit by accident.

Public attributes

value_c

float value_c = 0.0F

Temperature at this pixel, in the SDK's temperature unit (Celsius unless SetTemperatureUnit() chose Fahrenheit), at the region's emissivity when it has one. Quiet NaN when the pixel was not measurable.

position

float position = 0.0F

Distance along a one-dimensional region, in region coordinates -- so position * frame_width is the distance in pixels, and the samples are ordered by it.

Filled for the two shapes that have an honest one: a single line segment, where it is the distance from the first endpoint, and a single open spline, where it is arc length from the first control point. Those are the two a profile plot can be drawn of, and HasPositionAlong() is how to ask before offering one.

Quiet NaN for anything else -- an ellipse, a polygon, a closed spline, a boolean tree. There is no honest distance-along any of them, and a number invented for one would be plotted as though it meant something. A closed spline is in that list on purpose: its outline has an arc length, but its samples are the pixels it encloses, and an interior pixel has no position on the boundary. Samples of any other shape arrive in scan order -- top to bottom, left to right -- which pixel_x and pixel_y state exactly.

pixel_x

uint32_t pixel_x = 0

column in the frame this came from

pixel_y

uint32_t pixel_y = 0

row in the frame this came from