RegionSample
public readonly struct RegionSample
One pixel a region covered, kept so a caller can plot the profile the statistics were reduced from -- the temperature along a line across a weld, a heater track or a seam.
A sample is one pixel, not a resampled point: exactly the pixels RegionStats was computed over, so the profile and the statistics can never be two opinions about the same region. Ask for them with Region.KeepSamples and read them with ThermalCamera.ReadRegionSamples(…).
RegionSample: properties
public int PixelX { get; init; }
The column in the frame this came from.
public int PixelY { get; init; }
The row in the frame this came from.
public float Position { get; init; }
The distance from the line's first endpoint, in region coordinates -- multiply by the frame width for pixels. The samples of a line region are ordered by it.
Single.NaN when the region is not a single line segment. There is no honest distance-along an ellipse, a polygon or a combined shape, and a number invented for one would be plotted as though it meant something. Samples of any other shape arrive in scan order -- top to bottom, left to right -- which RegionSample.PixelX and RegionSample.PixelY state exactly.
public float Value { get; init; }
The temperature at this pixel, in the SDK's temperature unit (Celsius unless Sdk.TemperatureUnit chose Fahrenheit), at the region's own emissivity when it has one.
Single.NaN when the pixel could not be measured -- the border radial distortion correction leaves in Wide mode, or a dropped pixel. The sample is still here, with its position, so a chart draws a break rather than a straight line across the hole. NaN rather than a cold-looking number: every comparison against NaN is false, so it cannot be plotted or averaged by accident. Such pixels are not counted in RegionStats.PixelCount, which is why that can be smaller than the number of samples.