Measurement Fields
Measurement fields have been unified into the Region model (Imager::Regions() and Imager::Alarms()).
- Regions: creating, editing and measuring regions, the coordinate system, sampling apertures, boolean shapes, persistence.
- Alarms: rules, conditions, states, actions and custom attachments.
- Region Examples: complete worked examples.
Migration Summary
| Former MeasurementField API | v12 Region & Alarm API |
|---|---|
MeasurementField |
Region |
MeasurementStats |
RegionStats (mean_c) |
AlarmMode::High / Low / OutsideRange / InsideRange |
Compare::kAbove / kBelow / kOutside / kInside |
hysteresis_c, alarm_delay_frames, latching |
Condition on Rule |
Imager::AddMeasurementField(f) |
Imager::Regions().Add(region) |
Imager::UpdateMeasurementField(id, f) |
Imager::Regions().Edit(id, mutate) |
Imager::GetMeasurementStats(id) |
Imager::Regions().Get(id)->stats |
Imager::SwapMeasurementFieldIndices(a, b) |
no equivalent; regions are addressed by id, not index |
Pixel-space geometry helpers (Point, Rectangle, Circle, Line, Ellipse, Polygon) in optris/sdk/measurement.h convert directly into regions via RegionFromGeometry():
auto region = optris::sdk::RegionFromGeometry( optris::sdk::Rectangle{10, 10, 40, 30}, imager->GetWidth(), imager->GetHeight()); region.name = "Furnace"; const auto id = imager->Regions().Add(std::move(region));
Key notes when migrating, both covered in roi-system:
- Aspect-preserving region coordinates: region coordinates divide both axes by the frame width (
xruns0..1,yruns0..height/width), so circles remain circular in pixel space. - Spot neighborhood apertures: point regions support configurable sampling apertures (
3x3,5x5, circular), clipped to their parent region and to the image bounds. This changes the reported temperature for any point that asks for one.
Legacy v11 applications using IRImager continue to work unchanged via the legacy headers under include/legacy/.