BlobDetection
public readonly record struct BlobDetection : IEquatable<BlobDetection>
Blob detection settings for a RegionKind.BlobGroup region.
Every property here is honoured by the measuring pass. On any other region kind the whole set is stored, saved and ignored.
Detection is confined to the region: only pixels the region contains can join a blob, so a hot area straddling the boundary is clipped to the region rather than accepted or rejected whole. Set it with Region.BlobDetection and read the results with ThermalCamera.ReadRegionBlobs(…).
Example
using var group = Region.Rect(new Vector2(0.5f, 0.375f), new Vector2(0.4f, 0.4f)); group.Kind = RegionKind.BlobGroup; group.BlobDetection = BlobDetection.Default with { Threshold = 45.0f, MinSizePixels = 20, }; ulong id = camera.AddRegion(group);
BlobDetection: properties
public int ContourMaxPoints { get; init; }
The cap on the number of points in an outline, applied after BlobDetection.Smoothing by subsampling at a regular stride.
Zero means the default 200 rather than "no points". Ignored unless BlobDetection.RenderMode is BlobRenderMode.Contour.
public static BlobDetection Default { get; }
The SDK's defaults: a 30 C floor, no ceiling, a ten-pixel minimum, no count or size limit, 0.005 smoothing, 200 contour points, and a bounding box.
Read from the library rather than restated here, so the two cannot drift. Read in the SDK's temperature unit at the moment of reading, so in Fahrenheit the floor is 86 F.
public float MaxBlobSize { get; init; }
The largest blob to report, as a fraction of the region; zero means no limit. Useful when a warm background would otherwise be one blob.
The fraction is of the pixels the region actually measured -- RegionStats.PixelCount -- compared against RegionBlob.PixelCount. Applied before BlobDetection.MaxCount, so a blob rejected for being too large does not use up a slot.
public int MaxCount { get; init; }
The most blobs to report; zero means unlimited.
Applied last, after BlobDetection.MaxBlobSize, by ranking on bounding-box area and truncating -- so what survives is the blobs with the largest boxes, which for a sparse L-shape is not the blob with the most hot pixels.
public int MinSizePixels { get; init; }
The smallest blob to report, in member pixels, inclusive.
Counted in pixels that joined the blob, not bounding-box area, so a thin diagonal streak is judged on its own length.
public BlobRenderMode RenderMode { get; init; }
Box or outline.
BlobRenderMode.Contour is what makes RegionBlob.ContourPointCount non-zero.
public float Smoothing { get; init; }
The outline simplification tolerance, in region coordinates -- multiply by the frame width for pixels.
Ignored unless BlobDetection.RenderMode is BlobRenderMode.Contour.
public float Threshold { get; init; }
The lower edge of the band, in the SDK's temperature unit (Celsius unless Sdk.TemperatureUnit chose Fahrenheit), inclusive: a pixel is a member when Threshold <= value <= ThresholdMax.
public float ThresholdMax { get; init; }
The upper edge of the band, in the SDK's temperature unit, inclusive.
Zero -- and anything below it -- means no upper bound, which is the default and also the trap, because 0 C is a ceiling a caller may genuinely want. Zero means no upper bound in either unit. The SDK compares in Celsius, so in Fahrenheit any ceiling at or below 32 F means no upper bound as well.