OptrisOptrisDocumentation

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

optris::sdk::Radiometry

How radiation is turned into a temperature: the emissivity of what you are looking at, what the air between does to it, and where those values are coming from.

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

Public functions

Radiometry

Radiometry(ClientBridge *bridge)

Wraps the imager's shared state. Constructed by the SDK; get one from Imager::Radiometry() rather than building it yourself.

Set

void Set(const RadiationConfig &radiation)

The radiation parameters, as one value.

One property of the engine is worth knowing and is not hidden by this shape: there is a single air/reflected temperature, spelled ambient_temp_c. A separate reflected reference cannot be set, so none is offered -- see RadiationConfig::ambient_temp_c.

Get

auto Get() const -> RadiationConfig

The parameters in force, read back from the engine rather than echoed from the last Set().

So a value the process interface supplied comes back here, and the number returned is not necessarily the number that was set. Sources() says which of the two happened.

Following from the note on Set(): there is one air/reflected temperature and it is reported as ambient_temp_c. Nothing else carries a reflected reference, so nothing can disagree with it.

Two fields are not the engine's: emissivity_affects_image and emissivity_own_scale are pipeline settings held on the SDK side, so they read back as set and the process interface cannot change them.

emissivity_affects_image reading back as set is not a claim that the picture was corrected, and this is the one place the two could be confused. Whether a region's own emissivity reached the pixels depends on the pipeline behind the source as well as on the setting, and the setting cannot say so without lying to a caller round-tripping a configuration. RegionEmissivityInFrames() is the query that answers the picture question.

Sources

auto Sources() const -> RadiationSources

Where each parameter is currently coming from -- set through the SDK, or supplied over the process interface.

TemperatureAtEmissivity

auto TemperatureAtEmissivity(float measured_c, float target_emissivity) const -> std::optional< float >

Convert a temperature measured at the current global emissivity into what it would read at a different one, using the same correction the pipeline uses.

measured_c and the answer are in the SDK's temperature unit (Celsius unless SetTemperatureUnit() chose Fahrenheit).

This is the tool for a pixel you sampled yourself while RadiationConfig::emissivity_affects_image is false: in that mode the image stays on the global emissivity. Region statistics do not need it, because the SDK reports them at each region's own emissivity in either mode (RegionEmissivityState::kReadingOnly says so), and RegionEmissivityInFrames() says whether a pixel in the delivered frame already carries it. Apply it to the readings you display, on the thread that displays them.

std::nullopt means this source cannot convert, not that the conversion made no difference. It is returned when there is no usable characteristic curve behind the source: a sample-point camera, a camera whose calibration has not loaded, a recording written before files carried their camera's table, or a table that is not invertible. Ask GetEmissivityConversionSupport() which, and ask it before offering the control rather than discovering the refusal here.

It never hands measured_c back unchanged in place of an answer: a reading handed back is indistinguishable from a target emissivity that happened to make no difference, which would leave a caller with nothing to test. The pipeline has nothing to do with it -- a camera converts the same way on either backend, and a Player or a StillSource answers from the curve its file carried.

target_emissivity below 0.01 is refused the same way: dividing by it is the conversion, and there is no answer at zero.

GetEmissivityConversionSupport

auto GetEmissivityConversionSupport() const -> EmissivityConversionSupport

Whether TemperatureAtEmissivity() can answer on this source, and why not when it cannot.

Ask this to decide whether to offer the control at all. It is the same shape, for the same reason, as GetReferenceCorrectionSupport(): a consumer that hard-codes its own belief about which sources can convert carries a constant that goes stale, and this one used to depend on whether the camera had landed on the GPU pipeline -- something no application can predict and the SDK can change mid-session.

Returns EmissivityConversionSupport::kUnknown for an imager that is not open.

RegionEmissivityInFrames

auto RegionEmissivityInFrames() const -> bool

True when the temperatures the SDK hands out ALREADY carry each region's own emissivity.

The answer depends on three things that an application cannot see between them: whether emissivity_affects_image is set, whether any region actually carries an emissivity of its own, and whether the source has an image-side path at all. Both pipelines have one, so on a camera or a simulated camera this is true whenever the setting is on and a region carries its own value; playback, a still and a radiometric simulated camera (SimulatedConfig::raw_detector) have none and answer false. So without this an application reading a pixel inside a region had no way to tell whether the number in its hand was corrected or not -- and both mistakes are silent: correcting again moves a temperature that was already right, and not correcting reports the scene's number where the region reports its own, in the same picture.

Use it to decide whether to call TemperatureAtEmissivity() on a value you sampled yourself. Region statistics never need it: those are corrected by the SDK either way.

SetReferenceTemperature

void SetReferenceTemperature(float reference_c, float measured_c, float ambient_c=-100.0f)

Correct the whole image against a known reference: tell the SDK what a spot really is and what it currently reads.

The correction is folded into the camera's energy-to-temperature table, which is where v11 applied it and the only place it can be applied consistently -- every temperature the pipeline reports comes out of that table, so a region, a spot, a pixel and the recorded stream are all corrected by the same act.

Ask GetReferenceCorrectionSupport() first. Not every source can be corrected: a simulated camera and a recording have no detector curve to correct, and this throws rather than pretending for them. That query exists so an application can hide the control rather than discover the refusal by making the call.

Read it back with GetReferenceTemperature(). That there is something to read back is the point: through v12.0 this call ended in an empty ProcessingAdapter::setReferenceTemperature, returned success, and had no getter anywhere that could contradict it, so an operator pointed a camera at a reference body, applied the correction, and measured uncorrected temperatures while the SDK agreed it had been corrected.

Which fit you get

v11 chooses between an offset fit and a gain fit from how far the reference is from the shutter temperature, and it chooses when the table is next rebuilt -- after this call has returned. So this call cannot tell you which you are getting; GetReferenceCorrection::gain_fit tells you which you got. Within 50 K of the shutter temperature it is an offset fit, which shifts the whole scale by reference_c - measured_c; further away it is a gain fit, which re-solves the total emissivity instead.

What this does not do

It does not verify itself. A one-point correction is only as good as the reference body and the spot you read it at, and nothing here can check either. It is applied exactly as asked.

The three temperatures are in the SDK's temperature unit (Celsius unless SetTemperatureUnit() chose Fahrenheit). -100 is the no-temperature marker in either unit and is not converted, so in Fahrenheit too a value of -100 or below means "none".

Parameters

Name Description
reference_c What the reference body really is. Must be above -100.
measured_c What the camera reads there now. Must be above -100.
ambient_c The air temperature at the reference, or -100 to leave the camera to estimate it.

This parameter is not inert, and the default is not neutral. A value above -100 pins the ambient temperature exactly as Set() would; -100 switches ambient estimation back on. v11 did the same (EnergyTableParamsMap::setStdReferencing), and it is kept for that reason, but it surprises: on a camera whose ambient has been pinned, taking the default moves every reported temperature by itself, on top of the correction. Measured on a PI 4x0 whose stored config pins the ambient at 0 C. Pass the ambient you are already using if you mean to change only the correction.

Exceptions

Name Description
FeatureNotSupportedException when this source cannot be corrected; the message is GetReferenceCorrectionDiagnosis().
std::invalid_argument when either temperature is the -100 no-temperature sentinel or below it. Note the type: this one is a standard-library exception and does not derive from SdkException, so a caller catching only the SDK hierarchy lets it through. It is not InvalidArgumentException, which does exist in this SDK and is what the recording surface throws for the same kind of refusal: this call is the older of the two and the choice has not been revisited. Over the C ABI they are indistinguishable -- both arrive as OPTRIS_SDK_ERROR_INVALID_ARGUMENT -- so only a C++ caller can tell them apart, and only by which catch clause it writes. An earlier version of this line said there was no such type at all, which was false.

ResetReferenceTemperature

void ResetReferenceTemperature()

Discard the reference correction and go back to the camera's own scale.

Rebuilds the table without the correction rather than merely forgetting it, so reported temperatures move back on the next frame rather than at the next shutter cycle.

Exceptions

Name Description
FeatureNotSupportedException when this source cannot be corrected at all -- the same refusal as the setter, for the same reason. Clearing a correction on a source that could never have had one is not success.

GetReferenceTemperature

auto GetReferenceTemperature() const -> ReferenceCorrection

The reference correction in force, if any.

Reports active == false for a source that cannot be corrected as well as for one that simply has no correction set. Those are different situations and this does not distinguish them on purpose -- GetReferenceCorrectionSupport() is the query that does.

GetReferenceCorrectionSupport

auto GetReferenceCorrectionSupport() const -> ReferenceCorrectionSupport

Whether this source can be corrected against a reference body.

Readable so that an application's capability flag can read the SDK rather than carry a belief that goes stale the moment the SDK implements or withdraws something.

Returns ReferenceCorrectionSupport::kUnknown for an imager that has not been opened. Use CanApplyReferenceCorrection() rather than comparing, so that an unopened camera cannot answer "yes" by default.

GetReferenceCorrectionDiagnosis

auto GetReferenceCorrectionDiagnosis() const -> std::string

Why this source cannot be corrected, in words, when it cannot.

Names which of the reasons applies -- no detector curve at all, or a running camera with no energy table -- because those are different problems for whoever has to act on them. Empty when GetReferenceCorrectionSupport() reports kSupported. This is also the message the setters throw.