Frame Processing Settings
In Fahrenheit: with the SDK switched to Fahrenheit (SetTemperatureUnit() and its counterparts, see Temperatures in Fahrenheit), every temperature on this page is read and written in Fahrenheit, and every difference in Fahrenheit degrees; the samples are unchanged.
Overview
The CPU pipeline backend computes thermal frames on the processor. It is always available, requires no GPU and no extra dependencies, and runs on every platform the SDK supports.
It is one of two processing backends. The SDK chooses between it and the GPU pipeline per camera while the camera opens: small frames (below 65 536 pixels by default), sample-point calibrated cameras, simulated cameras, processes with OTC_FORCE_CPU set and machines without a usable GPU all run on the CPU pipeline. A camera whose GPU pipeline fails to initialize (or whose initialization does not return within the time bound) is also moved here. The two backends are held bit-exact on the measurement path, so the choice changes speed and not temperatures, unless a noise filter is selected, which is measured below. imager->Processing().Info() reports which backend a camera is on and why; see How the Pipeline Is Selected. Every public feature works here as on the GPU pipeline: every noise filter, detail enhancement (including in a picture the SDK colours itself with the colour output off), a region's own emissivity in the picture as well as in its numbers, and the emissivity conversion. A camera moved here from a GPU pipeline that failed keeps all of its settings, and Processing().SetPipelineChangeCallback() tells the application.
On ARM platforms (Jetson, Raspberry Pi) the radiometry pass uses NEON.
A simulated camera runs this pipeline. It builds a synthetic calibration at open and drives the CPU backend through the same path a real camera takes, so the noise filters behave on it as they do on hardware.
Detail enhancement works on a simulated camera too. It is display-only: it writes a separate buffer that only the colorizer reads, and never the thermal one, so the temperatures a simulated camera reports are the same with it on as with it off.
Playback has no processing pipeline, and neither does a camera below the pipeline's minimum frame size of 8x8, where the neighbourhood stages have no meaning; for those, neither backend runs and no enhancement reaches a pixel.
What that does to the API is not uniform, and the difference is deliberate. On a replay or a still, the capability questions answer rather than throw: IsDetailEnhancementSupported is false, IsNoiseFilterSupported is false for every mode, and DetailEnhancement reads back (Enabled: false, 0, 0), which is the whole truth because enhancement is display-only and nothing behind a file runs it. The setters still throw FeatureNotSupportedException: a recording's temperatures already carry whichever noise filter was in force when it was written, and no filter can be taken back out of stored numbers. So do NoiseFilter and TemporalSmoothing, and that one is the subtle case: the only value they could report is None, which an application would read as "this recording is unfiltered", and a file records no filter settings at all. A reader answering None over temperatures that went through a 5x5 median would be worse than one that refuses.
Filters
The CPU pipeline implements every filter in NoiseFilter. Ten of them (5x5 Gaussian, 5x5 box, guided, anisotropic diffusion, non-local means, Sobel gradient, morphological erosion and dilation, Kuwahara and Wiener) were a GPU-pipeline feature before release and now work on any camera, on either pipeline.
Processing().IsFilterSupported() is still the right question to ask before offering a filter, and the answer is still per camera. It is true of every value today; nothing guarantees that of a filter added tomorrow.
The two pipelines do not give identical numbers for the same noise filter, and they cannot. (kGradient is the exception, see below.) The GPU filters the energy field, upstream of the energy-to-temperature lookup; the CPU filters the temperature field, downstream of it. The lookup is non-linear, so the mean of a lookup is not the lookup of a mean. Measured on the shipped PI 640i curve, the two orders differ by 0.0004 K on detector noise, 0.014 K across a 50-ADU neighbourhood, and up to 15.7 K across a −20 → 120 °C edge, where neither order is measuring either object. The filters exist for noise, which is the end of that range where the difference is nothing.
A filter's strength means a number of kelvin on the CPU pipeline and a number of detector counts on the GPU one. ProcessingConfig::filter_strength multiplies each pipeline's own nominal, and 1.0 is nominal on both, but the nominals are different numbers because the units are different. There is no fixed conversion: on one camera (serial 18044062) one kelvin is 85.10 counts on its −20..100 °C range, 21.21 on 0..250 and 2.56 on 150..900. The CPU nominals are stated in kelvin (a 2 K bilateral range, a 1 K diffusion conductance, a 1 K guided flat-region threshold, a 0.2 K non-local-means patch scale), and filter_strength is how an application adapts those four to a camera whose noise is larger than that, which on a high temperature range it will be.
kWiener is the one filter filter_strength does not reach, on either pipeline. Its noise variance is a fixed (0.5 K)² on the CPU and a fixed 25 ADU² on the GPU, written into each implementation with no uniform behind it, so raising filter_strength for a noisy camera moves the other four and leaves the Wiener exactly where it was. If kWiener is under- or over-smoothing on your camera, filter_strength is not the knob; choose a different filter.
kGradient is not a noise filter on either pipeline and the enum says so: it replaces the temperature field with its own gradient, so regions, alarms and recordings all measure edges afterwards. On the CPU pipeline the output is the Sobel magnitude in kelvin, carried in the frame's own encoding, so GetTemperature() on a gradient of 3 K reads 3.0 °C. And kGradient is the one filter the two pipelines do agree on exactly: the GPU converts every tap the Sobel reads through the energy-to-temperature lookup before the Sobel rather than after it, so its magnitude is in kelvin too and carried in the same encoding, and the two agree pixel for pixel.
Radiation Parameters
Radiation parameters affect the emissivity/transmissivity stage and the temperature conversion. They are set as one value through Imager::Radiometry():
#include "optris/sdk.h" void ConfigureRadiation(optris::sdk::Imager& imager) { auto radiation = imager.Radiometry().Get(); // Surface emissivity (0.01-1.0). Default 1.0. // Metals: 0.1-0.5, plastics/rubber: 0.9-0.97, human skin: 0.98. radiation.emissivity = 0.95f; // Transmissivity of anything between camera and object (0.0-1.0). // Default 1.0, a clear path. radiation.transmissivity = 1.0f; // Ambient temperature in Celsius. Default 20.0. This one value is also // the reflected temperature; there is no separate reflected setting. radiation.ambient_temp_c = 22.0f; imager.Radiometry().Set(radiation); }
optris_sdk_radiation_config radiation; optris_sdk_radiation_config_init(&radiation, sizeof(radiation)); optris_sdk_imager_get_radiation(imager, &radiation); /* Surface emissivity (0.01-1.0). Default 1.0. * Metals: 0.1-0.5, plastics/rubber: 0.9-0.97, human skin: 0.98. */ radiation.emissivity = 0.95F; /* Transmissivity of anything between camera and object (0.0-1.0). * Default 1.0, a clear path. */ radiation.transmissivity = 1.0F; /* Ambient temperature in Celsius. Default 20.0. This one value is * also the reflected temperature; there is no separate setting. */ radiation.ambient_temperature_c = 22.0F; optris_sdk_imager_set_radiation(imager, &radiation);
// Emissivity 0.01-1.0 (metals 0.1-0.5, plastics 0.9-0.97, skin 0.98); // transmissivity 0.0-1.0, 1.0 is a clear path; the ambient is also // the reflected temperature, there is no separate setting. camera.Radiation = camera.Radiation with { Emissivity = 0.95f, Transmissivity = 1.0f, AmbientTemperature = 22.0f, };
radiation = camera.radiometry.get() # Emissivity 0.01-1.0 (metals 0.1-0.5, plastics 0.9-0.97, skin 0.98). radiation.emissivity = 0.95 # Transmissivity 0.0-1.0; 1.0 is a clear path. radiation.transmissivity = 1.0 # The ambient is also the reflected temperature; there is no # separate setting. radiation.ambient_temperature_c = 22.0 camera.radiometry.set(radiation)
let mut radiation = camera.radiation()?; // Emissivity 0.01-1.0 (metals 0.1-0.5, plastics 0.9-0.97, skin 0.98). radiation.emissivity = 0.95; // Transmissivity 0.0-1.0; 1.0 is a clear path. radiation.transmissivity = 1.0; // The ambient is also the reflected temperature; there is no // separate setting. radiation.ambient_temperature_c = 22.0; camera.set_radiation(radiation)?;
There are no distance or humidity parameters. ambient_temp_c is used while estimate_ambient is false (the default in RadiationConfig); set estimate_ambient = true to let the camera estimate it from its housing probe instead. A value set while estimating is kept and comes into force when estimating is turned off again, and read the value in force with Imager::GetEffectiveAmbientTemperature().
Radiometry().Get() reads the parameters back from the engine, so a value supplied by the process interface is what comes back, not necessarily what was last set. Radiometry().Sources() says which: it reports, per parameter, whether the value in force is driven by software (RadiationParameterSource::kSdk) or by a process-interface analog input (kPif).
A whole scale can also be corrected against a known source: Radiometry().SetReferenceTemperature(reference_c, measured_c) shifts the conversion so the reference reads true. It works where the source has an energy table; ask GetReferenceCorrectionSupport() first.
Distortion and Size-of-Source Correction
Both corrections are part of ProcessingConfig and are on by default:
rdcis anRdcMode:kOff,kNormal(the default, rectilinear) orkWide(the table for wide-angle optics, which keeps the full field of view instead of zooming to fit). A camera whose calibration has no distortion coefficients is unaffected; this is not an error.sos_correctiondefaults totrue, but on its own changes nothing:sos_strengthdefaults to0.0, which is an exact identity. The strength has to be measured for a camera and its optics and set explicitly (0 to 0.95).
Both corrections run on the energy buffer, before the single energy-to-temperature conversion, and size-of-source runs before distortion correction. That is v11's order, and it is what keeps both backends bit-identical to it: energy-to-temperature is a non-linear table lookup, so interpolating temperatures is not the same operation as interpolating energies.
Wide mode marks the pixels it cannot fill. Keeping the full field of view means some output pixels have no source anywhere on the sensor (15.8 % of the field on a G7), and those arrive at your application as optris::sdk::kInvalidPixel (-32768) in the raw ThermalFrame buffer. Everything downstream skips them rather than reading them as a temperature:
ThermalFrame::GetTemperature()returns NaN for such a pixel. Test withstd::isnan(), or read the raw buffer and useoptris::sdk::IsMeasurablePixel()if you need to tell "outside the frame" from "not measured".GetMinTemperature()/GetMaxTemperature(), the cold and hot spots, the auto-scale and the histogram all exclude them. A frame with nothing measurable in it reports 0 for both.- A measuring area overlapping the border reports statistics over the pixels it actually had, and says so in
RegionStats::coverage(below 1.0) and inRegionStats::pixel_count. - Recordings and snapshots carry the mark across and read it back as the same thing, so a replayed Wide-mode frame is coloured on the measured range, not dragged to −3376.8 C by the border.
kNormal produces no such pixels: it replicates the border instead, and every pixel is valid.
Because both corrections depend on calibration data a given camera may not carry, "requested" and "running" can differ. Processing().Correction() reports what each correction is actually doing (RdcStatus, SosStatus), for example RdcStatus::kNoCoefficients, SosStatus::kNoTable or SosStatus::kZeroStrength.
Example
Configure radiation parameters and the corrections, then confirm which backend is running and what the corrections are doing:
#include <chrono> #include <print> #include <thread> #include "optris/sdk.h" int main() { try { auto imager = optris::sdk::Imager::Create(); auto radiation = imager->Radiometry().Get(); radiation.emissivity = 0.95f; radiation.ambient_temp_c = 22.0f; imager->Radiometry().Set(radiation); // Read-modify-write, so nothing else in the configuration changes. auto processing = imager->Processing().Get(); processing.rdc = optris::sdk::RdcMode::kNormal; processing.sos_correction = true; imager->Processing().Set(processing); const auto info = imager->Processing().Info(); if (info.valid) { std::println("Pipeline: {} ({})", optris::sdk::ToString(info.kind), info.explanation); } int frame_count = 0; imager->SetThermalCallback([&](const optris::sdk::ThermalFrame& f) { // Frames from before the startup calibration has finished // arrive too, and are not measurements. if (!f.GetMetadata().thermal_data_reliable) return; if (++frame_count % 30 == 0) { std::println("Frame {}: min={:.1f} max={:.1f}", frame_count, f.GetMinTemperature(), f.GetMaxTemperature()); } }); imager->Start(); std::this_thread::sleep_for(std::chrono::seconds(5)); imager->Stop(); std::println("Frames dropped by the pull queue: {}", imager->GetDroppedFrameCount()); } catch (const optris::sdk::SdkException& e) { std::println(stderr, "Error: {}", e.what()); return 1; } }
optris_sdk_imager *camera = NULL; optris_sdk_radiation_config radiation; optris_sdk_pipeline_info info; optris_sdk_imager_create(&camera); optris_sdk_radiation_config_init(&radiation, sizeof(radiation)); optris_sdk_imager_get_radiation(camera, &radiation); radiation.emissivity = 0.95F; radiation.ambient_temperature_c = 22.0F; optris_sdk_imager_set_radiation(camera, &radiation); /* The corrections are discrete setters across the ABI. */ optris_sdk_imager_set_rdc_mode(camera, OPTRIS_SDK_RDC_NORMAL); optris_sdk_imager_set_sos_correction_enabled(camera, 1); optris_sdk_pipeline_info_init(&info, sizeof(info)); optris_sdk_imager_get_pipeline_info(camera, &info); printf("Pipeline: %s\n", info.reason_text); optris_sdk_imager_set_thermal_callback(camera, OnThermal, NULL); optris_sdk_imager_start(camera); getchar(); optris_sdk_imager_stop(camera); optris_sdk_imager_destroy(camera);
using Optris.Sdk; await using ThermalCamera camera = ThermalCamera.Open(); camera.Radiation = camera.Radiation with { Emissivity = 0.95f, AmbientTemperature = 22.0f, }; // The corrections are discrete setters in this binding. camera.DistortionCorrection = DistortionCorrection.Normal; camera.SizeOfSourceCorrection = true; PipelineInfo info = camera.PipelineInfo; Console.WriteLine($"Pipeline: {info.Pipeline} ({info.ReasonText})"); camera.Start(); for (int i = 0; i < 150; i++) { using ThermalFrame frame = await camera.AcquireFrameAsync(TimeSpan.FromSeconds(2)); // Frames from before the startup calibration has finished arrive // too, and are not measurements. if (frame.Metadata.IsThermalDataReliable && i % 30 == 0) { Console.WriteLine($"Frame {i}: min={frame.MinTemperature:F1} " + $"max={frame.MaxTemperature:F1}"); } } camera.Stop(); Console.WriteLine( $"Frames dropped by the pull queue: {camera.DroppedFrameCount}");
import optris_sdk camera = optris_sdk.Camera.open() radiation = camera.radiometry.get() radiation.emissivity = 0.95 radiation.ambient_temperature_c = 22.0 camera.radiometry.set(radiation) # The corrections are discrete properties in this binding. camera.distortion_correction = optris_sdk.RDC_NORMAL camera.size_of_source_correction = True info = camera.pipeline_info() print(f"Pipeline: {info.reason_text}") camera.start() for i, frame in enumerate(camera.frames(150)): # Frames from before the startup calibration has finished arrive # too, and are not measurements. if frame.thermal_data_reliable and i % 30 == 0: print(f"Frame {i}: min={frame.min_c:.1f} max={frame.max_c:.1f}") camera.stop() print(f"Frames dropped by the pull queue: {camera.dropped_frame_count}") camera.close()
use optris_sdk::{Camera, RdcMode}; fn main() -> optris_sdk::Result<()> { let mut camera = Camera::open()?; let mut radiation = camera.radiation()?; radiation.emissivity = 0.95; radiation.ambient_temperature_c = 22.0; camera.set_radiation(radiation)?; // The corrections are discrete setters in this binding. camera.set_rdc_mode(RdcMode::Normal)?; camera.set_sos_correction_enabled(true)?; let info = camera.pipeline_info()?; println!("Pipeline: {:?} ({})", info.kind, info.reason_text); camera.on_thermal_frame(|frame| { // Frames from before the startup calibration has finished // arrive too, and are not measurements. if let Ok(info) = frame.info() { if info.thermal_data_reliable && info.sequence % 30 == 0 { println!("Frame {}: min={:.1} max={:.1}", info.sequence, info.min_temp_c, info.max_temp_c); } } })?; camera.start()?; std::thread::sleep(std::time::Duration::from_secs(5)); camera.stop()?; println!("Frames dropped by the pull queue: {}", camera.dropped_frame_count()?); Ok(()) }