OptrisOptrisDocumentation

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

These are the pre-v12 classes, kept so existing code keeps building. New code should use the modern API — see Migration Guide: v11 to v12.

optris::IRImagerConfig

Holds the SDK settings found in the configuration file.

Public static attributes

CURRENT_VERSION

static constexpr int CURRENT_VERSION = 3

Current version of the configuration file.

Public attributes

version

int version = CURRENT_VERSION

Version of the configuration file.

serialNumber

unsigned long serialNumber = 0

Serial number of the device.

connectionInterface

std::string connectionInterface = "usb"

Interface used to connect to the device (USB, Ethernet). Case insensitive.

pinConnectionInterface

bool pinConnectionInterface = false

Flag indicating that connectionInterface was chosen deliberately and must not be replaced by whatever a device detection happens to report. Detection normally wins, because it is the more reliable answer for a device whose configuration was written some time ago. But a caller that asked for Ethernet on a camera that is also plugged into USB then gets USB without being told, which is not a fallback -- it is a different camera connection with different behaviour, and the caller had already said which one it wanted.

ipAddress

IpAddress ipAddress = IpAddress{192, 168, 0, 101}

IP address of the device.

port

unsigned short port = 50101

Local UDP port to which the device sends data to.

checkIp

bool checkIp = true

Flag indicating whether to only process UDP packages from the IP address specified by the ipAddress member variable. Set to true to activate this check or set to false to deactivate it.

connectionTimeout

int connectionTimeout = 10

Specifies the time in seconds that has to elapse without no new frame received until an connection timeout occurs. If connection timeout is detected the IRImager instance will call the IRImagerClient::onConnectionTimeout() callback.

controlConnectTimeoutMs

int controlConnectTimeoutMs = 5000

Specifies the time in milliseconds to wait for an Ethernet device to accept a control connection before giving up. This bounds the TCP connect only. Without it the operating system decides how long to keep retrying the handshake -- on Linux a little over two minutes -- so a mistyped address blocked for minutes rather than failing promptly. Ignored for USB devices.

controlResponseTimeoutMs

int controlResponseTimeoutMs = 0

Specifies how long, in milliseconds, one USB control command waits for the camera's answer before the SDK treats it as unanswered. Zero -- the default -- means the SDK's own value, which is 1000 ms and has been for as long as the number has had a ticket against it. Setting this changes nothing unless you set it. Ignored for Ethernet devices, whose receive bound belongs to the TCP channel.

Which connect paths honour this, because it is narrower than it looks and the same as its sibling controlConnectTimeoutMs: only IRImager::connect(IRImagerConfig) reads it, since that is the only overload a caller hands a configuration to. connect(serialNumber) and connect(DeviceInfo) build their configuration internally from the per-camera archive, and that file format does not carry any of the three timeout fields -- so those paths always get the default. The v12 Imager API reaches USB through connect(serialNumber), so this setting is not reachable from it either; giving it a home there means a USB section on ImagerConfig and an addition to the C ABI, which is a deliberate decision rather than an oversight.

Two things to know before lowering it, both measured:

A command that goes unanswered costs twice this, because the SDK sends it again when an answer was expected and none arrived. That is why a camera that does not implement a command was measured at 2.011 s against a 1000 ms timeout, and why halving this does not halve what an unanswered command costs.

The SDK cannot tell "this firmware does not implement the command" from "the answer has not arrived yet". Both look like a timeout. A camera that is plugged in but not yet ready is a real USB condition -- it is the reason the connect path retries at all -- so a value short enough to stop waiting on a command that will never be answered is also short enough to give up on one that was about to be. Lower it only if you know your bus: a camera on a direct root port, on an idle machine, answers far faster than one behind a hub on a loaded controller.

addressProbeTimeoutMs

int addressProbeTimeoutMs = -1

Says that ipAddress is current, and how long the connect may spend asking that one address who is there, in milliseconds. Negative, the default, means the address is not known to be current and the device has to be looked up in the enumeration detections instead -- the behaviour every caller had before this existed, and still the right one for a configuration loaded from disk whose camera may have been given a different address since. Zero or more means the caller already knows where the camera is, so the connect asks that address directly rather than waiting for a discovery sweep. Zero asks nothing at all and goes straight to the control connection. This is the whole of it: a host with five IPv4 adapters spent 79 s sweeping every one of them -- sequentially, each with its own receive timeout -- to rediscover a camera whose address the caller had already passed in. The one round trip this bounds replaces that sweep. The round trip is not ceremony: the camera's reply is where the SDK learns which local interface it is reachable on, and that is what lets prepareConnection() redirect the camera's UDP stream to this host. With zero the redirect cannot happen, so a camera currently streaming somewhere else connects and then delivers nothing. Ignored for USB devices.

bufferQueueSize

unsigned short bufferQueueSize = 5

Specifies the number of buffers that the subsystems receiving the raw frame data should use (DirectShow, V4L2, etc.). This setting has no influence on the size of the buffers. Their size is determined by the used video format.

streamingBackend

std::string streamingBackend

Selects the frame-acquisition backend. Case insensitive. Empty (the default) means the platform's default backend: Media Foundation on Windows, the legacy V4L2/USB path on Linux. Recognised names are:

  • "legacy" - the original StreamingDevice implementations: DirectShow on Windows, V4L2/USB on Linux.
  • "directshow", "ds" - Windows only, the same DirectShow path under the name it is usually asked for by.
  • "hal-mf", "mf" - Windows only, the hardware layer over Media Foundation. This is the Windows default.
  • "hal-v4l2" - Linux only, the hardware layer over V4L2.
  • "hal-libusb" - Linux only, the hardware layer driving UVC directly over libusb. Detaches the kernel video driver, so /dev/videoN disappears while connected. A name that is not recognised is reported in the log and the default is used. The chosen backend is always logged, with where the choice came from. Overridden for a whole process by the OTC_STREAMING_BACKEND environment variable, which takes the same names.

processingOutputs

ProcessingOutputConfig processingOutputs

Specifies which outputs should be computed and provided by the SDK.

processingMaxResultPoolSize

unsigned int processingMaxResultPoolSize = 10

Sets the maximum number of processing results that are pooled for reuse to avoid unnecessary allocations. The processing pipeline reuses the same objects to store its results. This setting specifies the maximum number of these objects that are can exist at the same time. If the client callbacks handling the processing results are too slow, the SDK will start to override already existing results. This effectively results in frame drops. Buffers are only added as needed. If set to 0, the maximum pool size will be set to 1.

width

int width = 0

Width in pixels of the output frame. If width, height and framerate are all set to 0 the SDK will use the first available video format.

height

int height = 0

Height in pixels of the output frame. If width, height and framerate are all set to 0 the SDK will use the first available video format.

framerate

int framerate = 0

Output framerate in Hz. If width, height and framerate are all set to 0 the SDK will use the first available video format.

subsampledFramerate

float subsampledFramerate = -1.F

Subsampled output framerate. The SDK internally reduces the output framerate to this value. This setting has no effect on the device itself, meaning the device will always send frames at the rate specified by the framerate member variable. Set to a value in [0, framerate] to achieve subsampling or set to a value to less than 0 to deactivate this feature.

fieldOfView

int fieldOfView = 0

Field of view of the optics in degree. If the field of view is set to 0 and the opticsText is empty the SDK will use the first available optics.

opticsText

std::string opticsText

Optional text further specifying the used optics. If the field of view is set to 0 and the opticsText is empty the SDK will use the first available optics.

operationModeNamed

bool operationModeNamed = false

The caller named the operation mode; the fields above are a request, not a restored preference.

False -- the default, and what loading a saved configuration leaves -- means the optics, temperature range, geometry and rate above may have come from the per-serial file the SDK writes on first open. An unhonourable rate there is then substituted rather than refused, because one stored preference cannot be right for a camera with two cables declaring two rates.

True means they came from ImagerConfig::operation_mode and must be honoured exactly or refused. Nothing is substituted and the lookup throws, which is the refusal that was asked for: silently opening in a neighbouring mode is what a caller naming a mode is trying to prevent.

enableSoSCorrection

bool enableSoSCorrection = true

Use Size of Source Correction if available in calibration data. If true, Size of Source Correction will automatically be used if available in calibration data.

rdcMode

RdcMode rdcMode = RdcMode::Normal

Mode of radial distortion correction (RDC). The following modes are available:

  • Off : Radial distortion correction will be deactivated.
  • Normal: Radial distortion correction will be done in normal mode.
  • Wide : Radial distortion correction will be done in wide mode. This has only an impact if the required parameters are provided by the calibration.

minTemperature

int minTemperature = 0

Lower limit of the desired temperature range in °C. Always use the temperatures for the not extended range. If the minimum and maximum temperature are set to 0 the SDK will use the first available temperature range.

maxTemperature

int maxTemperature = 0

Upper limit of the desired temperature range in °C. Always use the temperatures for the not extended range. If the minimum and maximum temperature are set to 0 the SDK will use the first available temperature range.

enableExtendedTemperatureRange

bool enableExtendedTemperatureRange = false

Extends the chosen temperature range if possible. When extending the temperature range you do not need to change the values for minTemperature and maxTemperature. The range is always specified by the non extended temperatures.

Warning: Extended temperature ranges are intended to help you align the field of view of your camera. The precision of the temperature measurements in this mode may not be within the specification.

enableHighPrecisionTemperature

bool enableHighPrecisionTemperature = true

Use high precision temperatures if available. If true, high precision temperatures will automatically be used if the device and the chosen temperature range supports them.

autoFlag

bool autoFlag = true

Enable the automatic triggering of flag cycles. Optris thermal cameras feature an internal shutter flag. It need to be closed periodically for the SDK to compensate for drifting temperature measurements. If set to true, flag cycles will be automatically triggered when one of the temperatures measured by internal probes changes by more than flagDriftThreshold.

minInterval

float minInterval = 12.F

Minimum time in seconds that has to pass before a new flag cycle can be triggered.

maxInterval

float maxInterval = 0.F

Maximum time in seconds that can pass before a new flag cycle is forced.

flagDriftThreshold

float flagDriftThreshold = 0.1F

How far an internal temperature probe may drift, in °C, before a flag cycle is due. Checked once minInterval has elapsed, against the box, chip and flag probes, using whichever has moved furthest since the last cycle. A larger value means fewer interruptions and more drift between corrections; a smaller one the reverse. maxInterval forces a cycle regardless. The default is the value the SDK used to hard-code.

flagDriftProbes

int flagDriftProbes = 0

Which internal probes the drift arm may consult. 0 box, chip and flag -- v11's behaviour and the default; 1 box and chip only, excluding the shutter-blade probe that the correction cycle itself disturbs. An int here for the same reason flagWhileRecording is one: this header cannot see either enum that names it. A value the engine does not recognise is treated as 0, so an unknown selection never silences a probe. See optris::sdk::DriftProbes -- correcting this is a deliberate divergence from v11 and the default does not move on its own. Superseded by measurement: the box probe is the main trigger, which is the condition under which that enum's own documentation says it is the wrong fix.

flagDriftFilter

float flagDriftFilter = 0.F

Time constant, in seconds, for filtering the probes before the drift arm compares them. 0 compares one frame's raw reading, which is v11 and the default. A single-pole filter, stepped by elapsed time. Measurement showed what the raw reading produces: a correction every 12 to 16 s for hours on cameras whose detector never moved, because a 0.1 C threshold cannot tell a probe's own readout from drift in one frame. 120 is the value that branch recommends -- long enough to out-wait the 5-to-40-second dwell of a regulated chip's two-level reading. The cost is delay: genuine drift at the threshold rate is caught about one time constant later than it would be.

flagDriftBandSteps

int flagDriftBandSteps = 0

Deadband floor, in multiples of each probe's own smallest observed change. 0 uses flagDriftThreshold alone, which is v11 and the default. The threshold is one number for three probes whose granularity differs by a factor of twenty, so 0.1 C was found landing between 1.60 and 30.30 counts depending on the probe. 2 is the value that branch recommends: it says out loud that a 0.0625 C probe cannot report less than 0.125 C of change, and on every other probe measured two counts is already under 0.1 C, so it costs nothing. Never widens the band past four times flagDriftThreshold.

flagWhileRecording

int flagWhileRecording = 0

What a running recording does to the flag schedule above. 0 use the flag normally (the default, and what every camera has always done), 1 hold every scheduled cycle while a recording runs, 2 hold them unless drift exceeds flagRecordingOverrideDrift. The numbering is optris::sdk::FlagWhileRecording's and optris::FlagWhileRecordingPolicy's; an int here because this header cannot see either, the same reason autoFlag is a plain bool. A value the engine does not recognise is treated as 0, so an unknown policy never suppresses a correction.

flagRecordingOverrideDrift

float flagRecordingOverrideDrift = 0.F

Drift in °C that overrides flagWhileRecording == 2. Zero means the override fires on any drift at all, which makes policy 2 behave as policy 0; the public setter refuses that pair rather than accepting it. Not validated here.

chipHeatingMode

ChipHeatingMode chipHeatingMode = ChipHeatingMode::Floating

Specified how and if the sensor chip is beeing heated.

chipHeatingTemperature

float chipHeatingTemperature = 40.F

Temperature in °C for the fixed chipHeatingMode. The provided value is clamped to [20, 55] °C.

focusMotorPosition

float focusMotorPosition = -1.F

Position of the focus motor in % ([0, 100]). Should be in [0., 100.]. Set to a value less than 0 for the SDK to ignore this setting.

radiation

RadiationParameters radiation

Radiation parameters for the overall thermal frame. For the radiation parameters of measurement fields see the MeasurementFieldConfig class.

enableMultiThreading

bool enableMultiThreading = false

Activate multithreading for postprocessing.

Warning: Experimental setting.

failSafeFlagTimeouts

bool failSafeFlagTimeouts = true

Indicates whether a flag timeout that caused the failure of a flag cycle should trigger the fail safe. A flag timeout occurs when the shutter flag does not reach its expected state within a given time frame. If this happens, the current flag cycle will be considered to have failed.

failSafeFlagTimeoutsMaxCycleFailures

int failSafeFlagTimeoutsMaxCycleFailures = 0

Specifies the number of failed flag cycles to be tolerated before fail safe is triggered due to flag timeouts.

See also: IRImagerConfig::failSafeTriggerOnFlagTimeout

failSafeProcessingChainTimeouts

bool failSafeProcessingChainTimeouts = true

Indicates whether a failure of the processing chain to reach all of its endpoints (thermal frame and measurement fields) within a given time frame should trigger the fail safe. If set to false, the fail safe will still be triggered when the processing chain itself crashes or gets stuck.

alarms

AlarmsConfig alarms

Alarms configuration.

measurementFields

std::vector< MeasurementFieldConfig > measurementFields

Measurement field configuration.

processInterface

PifConfig processInterface

Processing interface configuration.

Public static functions

validate

static OTC_SDK_API void validate(IRImagerConfig &config)

Validates the configuration settings. If a faulty setting can be replaced by a valid default this method will do so automatically and print a log warning message. If no valid default is available a SDKException is throws instead.

Parameters

Name Description
config to validate.

Exceptions

Name Description
SDKException if configuration contains uncorrectable invalid settings.