optris::sdk::MotionZone
Detects motion within a temperature range via frame differencing.
temp_min_c and temp_max_c are in the SDK's temperature unit (Celsius unless SetTemperatureUnit() chose Fahrenheit), and sensitivity is a difference in degrees of that unit. The default sensitivity of 0.5 is a compile-time Celsius number, so in Fahrenheit a default-constructed zone asks for 0.5 F; set it yourself (0.9 F is the same 0.5 K).
Public attributes
temp_min_c
float temp_min_c = 0.0f
Low end of the temperature band the zone watches, in the SDK's temperature unit, inclusive. Only pixels inside the band on the current frame take part; the previous frame's value is differenced but not range-tested.
The band is the zone's only selectivity -- there is no spatial extent here, and detection runs over the whole frame.
temp_max_c
float temp_max_c = 0.0f
High end of that band, in the SDK's temperature unit, inclusive.
Zero at both ends -- the default -- is an inert zone, not an open one: it can only ever see pixels at exactly 0. A default-constructed MotionZone therefore detects nothing while still publishing zero-valued motion signals on every frame, and still starving any ColorWindow::motion_only window. Set the band to the temperatures you actually care about.
sensitivity
float sensitivity = 0.5f
How much a pixel must change between consecutive frames to count as moving: an absolute difference in degrees of the SDK's temperature unit, not a normalized 0..1 knob, and higher means less sensitive.
The test is abs(T_now - T_prev) > sensitivity. The 0.5 default (0.5 K, in Celsius) sits above sensor noise and below a real scene change: around 0.05 K the zone trips on noise, and nothing in a still room moves by 1.5 K. Not clamped -- a negative value marks every in-band pixel as moving, on every frame, forever.
min_area
uint32_t min_area = 10
Smallest blob that counts, as a pixel count.
Moved pixels are grouped by a 4-connected flood fill and a group is reported only if it holds at least this many pixels, so this is filled area, not a bounding box -- the same distinction that makes it incomparable with MotionEvent::total_area. 0 or 1 admits single-pixel blobs, which is how sensor noise becomes a detection. Nothing caps how many blobs a zone may report.
visualize
bool visualize = false
Paint the moved pixels into the RGBA image.
Display only: detection, the MotionEvent callback and the alarm signals all happen whether or not this is set. The overlay is drawn on the CPU over whichever picture arrived, so unlike ColorWindow it works on a real camera and on both pipelines.
Two quirks once there is more than one zone. The paint is driven from the union mask, so a single visualized zone also shows the other zones' motion; and each visualized zone blends over the last, so with several the colours compound.
overlay_color
std::array< float, 4 > overlay_color = {1.0f, 0.0f, 0.0f, 0.8f}
Overlay colour as {r, g, b, a}, floats in 0..1. Alpha is a real blend against the picture underneath, not a cut-out mask, and the default is red at 80%.
Nothing clamps these. Values outside 0..1 are converted to bytes unchecked, so keep them in range.