OptrisOptrisDocumentation

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

optris::sdk::view::VisualizationPreset

Named snapshot of all view settings (palette, ROIs, blob, tracking).

A preset is data, not a live view. Selecting one changes nothing on its own: you load a ViewConfig, take GetActivePreset(), and apply the parts you want to FrameProcessor, BlobDetector and BlobTracker yourself. That indirection is the point -- a preset can name settings for subsystems the process has not created yet.

Public attributes

name

std::string name = "default"

Human-readable label for a preset picker.

Not an identity. Presets are selected by ViewConfig::active_preset_index; nothing looks one up by name, and duplicate names are neither rejected nor merged. ViewConfig::CreateDefault() ships "basic", "blob_tracking" and "roi_analysis".

description

std::string description

Free-text note on what the preset is for.

Stored and round-tripped, never parsed or matched against.

measuring_fields

std::vector< Roi > measuring_fields

The measuring areas this preset defines, in Roi form.

Coordinates are normalized [0,1] on each axis independently -- x by frame width, y by frame height -- origin top-left. Region normalizes both axes by the frame width, so ToRegion()/ToRoi() change the numbers. Never copy a coordinate between the two by hand.

Roi is deprecated and no longer reachable from Imager in v12, but a stored preset is exactly the case its converters were kept for: the file holds flat ROI shapes and you convert at the boundary rather than rewriting the file format.

On load both the measuring_fields array and a legacy rois array are read and concatenated into this one vector, in that order. Saving writes only measuring_fields, so a file that used both keys comes back merged under a single one.

blob_detection_enabled

bool blob_detection_enabled = false

Whether the caller should run BlobDetector on each frame.

Off by default -- detection is a full-frame scan. Only your own frame loop consults this.

blob_config

BlobConfig blob_config

Detector tuning to use when blob_detection_enabled is set.

Only four of BlobConfig's six fields survive a save/load round trip: threshold, min_size_pixels, extract_contour and contour_simplify. threshold_max and max_count are neither written nor read here, so an upper temperature bound or a blob cap set in memory is back at its default -- 0, meaning unbounded -- after the config is saved and reloaded. Set those two per ROI through Roi::blob_threshold_max and Roi::blob_max_count, which do serialize.

tracking_enabled

bool tracking_enabled = false

Whether the caller should feed detections to a BlobTracker.

Meaningless without blob_detection_enabled: the tracker's input is the detector's output. Nothing here enforces that pairing.

tracker_config

TrackerConfig tracker_config

Association and lifecycle tuning for that BlobTracker.

All six TrackerConfig fields round-trip. The two counting ones, max_age and min_hits, count Update() calls rather than seconds, so a preset tuned against a 27 Hz camera promotes and drops tracks sooner in wall-clock terms on a 32 Hz one.

track_viz_config

TrackVisualizationConfig track_viz_config

How the caller should draw those tracks.

Stored under the JSON key track_visualization, which does not match this field's name. See TrackVisualizationConfig.

palette

Palette palette = Palette::Iron

False-colour table for the thermal image.

Persisted by name through PaletteToString(). An unrecognized name loads as Palette::Iron without complaint, so a misspelling in a hand-edited file reads as "the palette setting is ignored".

scaling_mode

ScalingMode scaling_mode = ScalingMode::Auto

How the colour range is chosen each frame.

Only ScalingMode::Manual uses temp_min/temp_max; under the other three the range would come from the frame.

Persisted but not applied. This field round-trips through a saved layout and nothing in the SDK then acts on it. Setting it changes a file and not a picture.

The live control is optris::sdk::AutoScaleMode, through SetAutoScaleMode() on the handle, with the damping in ColorScaleDynamics. A layout that means to pin a range should set one explicitly rather than rely on this.

An unrecognized name loads as ScalingMode::Auto, not Manual, so a typo here silently discards the fixed range below it -- or would, if either were read.

temp_min

float temp_min = 20.0F

Degrees Celsius mapped to the coldest palette entry, used only when scaling_mode is ScalingMode::Manual.

Colder pixels clamp to it rather than being dropped. Celsius throughout -- never the internal int16 form, so no (celsius * 10) + 1000 conversion belongs anywhere near it.

temp_max

float temp_max = 40.0F

Degrees Celsius mapped to the hottest palette entry, used only when scaling_mode is ScalingMode::Manual.

Should exceed temp_min. Nothing validates that on load, and the 0.1 degree floor this used to credit to AutoScaler went with it: what remains is Colorize(), which floors its divisor at 0.01 degrees, so an inverted or empty range gives a flat image rather than a division by zero. ResolveAutoScaleRange() applies the same guard on the shipping path, where it keeps every auto range at least one degree wide.

isotherm

IsothermConfig isotherm

Optional solid-colour highlight for a temperature band.

Disabled by default. Its band -- IsothermConfig::min_temp and max_temp, both Celsius -- is independent of temp_min/temp_max, so an isotherm may sit outside the colour range, where it marks pixels that are already clamped to an end of the palette. All four sub-fields round-trip.

labels

LabelConfig labels

What text to show for each measuring field, and how.

LabelConfig::show_labels gates the rest; the per-value flags then choose which of max/min/average is printed. font_size is in pixels of the output image, so a preset authored against a 640x480 frame gives small text on an upscaled one, and it is unrelated to the per-ROI Roi::font_size that feeds a Region's style. All eight sub-fields round-trip.

No code in the SDK draws labels. FrameProcessor paints nothing at all -- outlines included; the overlay pass is BuildOverlayPrimitives() plus view::RasterizeOverlays(), and it draws shapes, not text. This is a description of what you should render.

Public static functions

FromJson

static VisualizationPreset FromJson(const std::string &json)

Build a preset from one entry of a config's presets array.

Every key is optional, so {} yields a fully defaulted preset. Sub-objects are parsed inline here rather than by the types that own them, which is why blob_config loses two fields (above). A malformed colour is skipped silently, but a scalar of the wrong JSON type, or text that is not JSON at all, throws SdkException.

Text rather than a JSON library's own type; see TrackVisualizationConfig::FromJson above.

Public functions

ToJson

std::string ToJson() const

Serialize the preset, writing every field including defaults.

Not the exact inverse of FromJson: ROIs go out under measuring_fields only, and BlobConfig::threshold_max and BlobConfig::max_count are dropped. Everything else round-trips.