OptrisOptrisDocumentation

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

optris::sdk::Processing

What happens to a frame between the sensor and you, and a way to look inside it while it does.

A handle, not an owner. Reached through Imager::Processing().

Public functions

Processing

Processing(ClientBridge *bridge)

Set

void Set(const ProcessingConfig &config)

How frames are processed, as one value: which frame types the pipeline produces, the result pool size, distortion and size-of-source correction, the detail-enhancement gains, the noise filter and its strength, temporal smoothing, and the diagnostic overlay.

Exceptions

Name Description
std::invalid_argument if filter_mode is not a NoiseFilter, or filter_strength is outside (0, 100].
FeatureNotSupportedException if filter_mode names a filter the running pipeline does not implement, or if dde_enabled is set on a source with no pipeline backend at all. Nothing is applied and nothing is stored when it throws, so Get() keeps reporting the configuration that is actually in force.

Get

auto Get() const -> ProcessingConfig

IsFilterSupported

auto IsFilterSupported(NoiseFilter mode) const -> bool

Whether this camera's pipeline implements mode.

Both pipelines implement every NoiseFilter, so on a camera this answers true for every value; it is still the question to ask before offering a filter, because which pipeline runs depends on the camera rather than on anything the application chose, and a future filter may arrive on one pipeline first. Set() refuses an unsupported filter rather than substituting another, so this is how to avoid the refusal instead of handling it.

Before a camera is attached there is no pipeline to ask, and the answer is the conservative one: true only for the filters every backend implements.

IsDetailEnhancementSupported

auto IsDetailEnhancementSupported() const -> bool

Whether this source can run detail enhancement at all.

True whenever a pipeline backend is running, which is where both implementations of it live -- a live camera on either backend, and a simulated camera, which runs the real CPU pipeline. False for playback, and for any other source with no backend, where Set() refuses dde_enabled rather than storing a setting that would never reach a pixel.

True where the enhancement changes the picture, including on a simulated camera. That took two corrections to arrive at. It answered false for a simulated camera, which became wrong when one started running the real pipeline; it then answered true where the enhancement still reached no pixel, because enhancement is display-only and a simulated camera's picture is colorized outside the pipeline, downstream of the display buffer the enhancement writes. That display buffer now reaches the colorizer, so the answer and the behaviour agree: a simulated camera is a fair place to check that enhancement works.

Correction

auto Correction() const -> PictureCorrection

What the two optical corrections are actually doing, as opposed to what Get() says was asked for.

Both default to on and both depend on calibration data a given camera and optics may not carry, so "asked for" and "happening" genuinely differ on ordinary hardware. Set() does not refuse a correction the camera cannot do -- that would make every such camera fail on the default configuration -- so this is where the refusal goes instead: a named reason per correction rather than a silent no-op or a generic I/O error.

Worth reading once after the camera opens, and again after any operation-mode change: a mode change rebuilds the pipeline and both tables with it.

Returns an invalid record -- valid == false, both statuses kUnknown -- when this source has no processing adapter to ask, which is the case for a simulated camera and for playback. Note that a simulated camera does run a pipeline backend; it is the adapter this reads through that it does not have, so unlike Info() this one did not change when the simulated source was wired to the real pipeline.

Diagnostics

auto Diagnostics() const -> PipelineDiagnostics

A read-only look at the pipeline's internal buffers -- raw ADU, energy, calibrated thermal, filtered, and the colorized output -- plus the memory they occupy.

Returns an invalid record when there is no pipeline backend. The spans are valid until the next frame is processed.

Info

auto Info() const -> PipelineInfo

What the SDK chose for this camera, and why: the processing pipeline and the rule that picked it, the GPU adapter it computes on, and the streaming backend carrying its frames.

The answer to the support question "what is running where?" -- which until now was answerable only by reading log lines that carry no serial number, so a two-camera host produced two identical lines and no way to tell which belonged to which.

Not fixed for as long as the camera is open: a GPU pipeline that fails or times out moves the camera to the CPU pipeline at an operation-mode switch, a frame-format change or a reconnect. PipelineInfo lists the rules; SetPipelineChangeCallback() is told of a change.

Read it after the open returns. During the open the choice is made twice: once on frame size, before the calibration has been read, and again if that calibration turns out to need the CPU pipeline.

A simulated camera answers here too, and reports the CPU pipeline it really runs -- valid == true, kind == kCpu. It is not a source with no pipeline: it runs the real one.

Returns an invalid record -- valid == false -- only when there is no camera attached. A source that runs no backend at all answers valid == true with kind == kNone.

SetPipelineChangeCallback

void SetPipelineChangeCallback(PipelineChangeCallback callback)

Be told when this camera's pipeline changes while it is open.

The pipeline Info() reports is not fixed for the life of the camera: a GPU pipeline that fails to initialize, or does not return within the time bound, moves the camera to the CPU pipeline at an operation-mode switch, a frame-format change or a reconnect. The camera keeps streaming and keeps its settings; this says that it happened, from which pipeline to which, and why.

imager->Processing().SetPipelineChangeCallback(
    [](const optris::sdk::PipelineChange &change) {
      std::printf("now on %s: %s\n", ToString(change.current),
                  change.explanation.c_str());
    });

Called on the frame thread, once per change, before the first frame the new pipeline computed: the same thread and the same rules as the frame callbacks, so it may call back into the camera. The choice made while the camera opens is not a change and is not reported; read Info() after the open for that. A change with no frame after it (the camera stopped at that moment) is reported with the next frame.

Pass an empty function to stop. Replaces any previous handler.

FrameRate

auto FrameRate() const -> FrameRateInfo

The rate frames actually arrive at, what was asked for, and why they differ.

ProcessingConfig::subsampled_framerate is a request. It is clamped to the sensor's own rate, and an export-restricted camera never delivers above 9 Hz whatever is asked, on any pipeline. Reading the request back therefore answers a different question from "how many frames per second am I going to get?".

Both are reported here, side by side, with the difference explained -- the same shape as Info(): a closed enum to branch on and a sentence naming the rates for a support report.

Returns an invalid record -- valid == false -- when there is no camera behind this source. Returns an invalid record -- valid == false -- when there is no camera behind this source.

Every figure in it comes from configuration. It is what the SDK intends to deliver, which is a real and useful answer and is not a measurement: it cannot know about a shutter cycle, a frame held because the flag was in the way, a frame dropped under load, or a camera that is not keeping up. For the counted rate, read RealFrameRate().

RealFrameRate

auto RealFrameRate() const -> MeasuredFrameRate

The rate of frames that are actually new, measured by counting them.

FrameRate() answers what the SDK intends. This answers what happened: how many frames carrying new pixels were delivered over a recent window, how long that window was, and how many of the frames in it were repeats. A repeated frame -- one the SDK held and delivered again because the shutter was in the way, which FrameMetadata::is_repeated_frame marks -- is not counted.

Use it where FrameRateInfo::effective_hz documents itself as "the number to divide by when budgeting work per frame". That is exactly the use a configured number is wrong for.

Answers for a live camera and the simulated camera, counted in the one place every delivered frame passes through. A recording is a Player, not an Imager, and Player::RealFrameRate() is the same measurement for it. See MeasuredFrameRate for the algorithm, the window, and what each case reports -- including that a stalled camera reads 0 Hz as a measurement, which is not the same as nothing having been measured yet. GetLiveFrameRate() is the figure to show a user.

GetLiveFrameRate

auto GetLiveFrameRate() const -> LiveFrameRate

Real frames per second over the time the scene was being measured: the frame rate to show a user.

The count RealFrameRate() makes, over the same window, on a clock that leaves out the time the shutter flag was in the way, so a shutter cycle does not read as 0 fps. A camera that stops delivering still reads 0. See LiveFrameRate for what each case reports. A recording answers through Player::GetLiveFrameRate(), which also leaves out the time it was paused.