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::ImageBuilder

Creates false color images from thermal frames.

Public types

LookupTable

std::array< unsigned int, 65536 > LookupTable

Type for look up tables.

Public functions

ImageBuilder

OTC_SDK_API ImageBuilder(ColorFormat colorFormat, WidthAlignment widthAlignment)

Constructor.

Be mindful of which color format and width alignment you choose. Please refer to the documentation of the enums for more details.

Parameters

Name Description
colorFormat for the generated false color image.
widthAlignment for the generated false color image.

setThermalFrame

OTC_SDK_API void setThermalFrame(const ThermalFrame &thermalFrame)

Sets a new thermal frame.

The provide frame will be copied to an internal buffer.

Parameters

Name Description
thermalFrame data.

getThermalFrame

const ThermalFrame & getThermalFrame() const noexcept

Grants read access to the stored thermal frame.

Returns: const reference to the stored thermal frame.

getWidth

int getWidth() const noexcept

Returns the width in pixels of the thermal frame.

Returns: width in pixels of the thermal frame.

getHeight

int getHeight() const noexcept

Returns the height in pixels of thermal frame.

Returns: height in pixels of thermal frame.

getTemperature

OTC_SDK_API float getTemperature(int index) const

Returns the temperature the from last acquired image at specified pixel index.

Parameters

Name Description
index pixel index.

Returns: temperature in °C.

Exceptions

Name Description
SDKException if index is out of range.

getTemperature

OTC_SDK_API float getTemperature(int x, int y) const

Returns the temperature from last acquired image at specified pixel coordinates.

The origin of coordinates is located in the upper left corner with the x-axis pointing right and the y-axis pointing downwards.

Parameters

Name Description
x coordinates.
y coordinates.

Returns: temperature in °C.

Exceptions

Name Description
SDKException if coordinates are out of range.

getMeanTemperatureInRegion

OTC_SDK_API bool getMeanTemperatureInRegion(TemperatureRegion &meanRegion)

Returns the mean temperature in °C of a rectangular region.

Before providing the region to this method you have to define the rectangular area it covers by specifying its upper left and lower right corners.

Parameters

Name Description
meanRegion in which to calculate the mean temperature.

Returns: true if a mean temperature could be calculated. False if no thermal data is available or if the region coordinates are inconstent or if the region is too large for the frame.

getMinMaxRegions

OTC_SDK_API bool getMinMaxRegions(int radius, TemperatureRegion &minRegion, TemperatureRegion &maxRegion)

Returns the region of minimum/maximum temperature in °C with the given radius.

The method will fill in all the data for the min and max temperature region.

Parameters

Name Description
radius radius of the region.
minRegion region of minimum mean temperature.
maxRegion region of maximum mean temperature.

Returns: true if minimum/maximum temperature could be calculated. False if no thermal data is available or if the radius is to large for the frame.

setTemperatureScaling

OTC_SDK_API void setTemperatureScaling(float min, float max)

Sets the temperature range for the manual scaling mode.

Attention: If the scaling mode is not set to manual the set values will be overriden once the next image conversion is triggered.

Parameters

Name Description
min lower limit in °C.
max upper limit in °C.

Exceptions

Name Description
SDKException if the provided temperatures are invalid or if max is not at least 1°C higher than min.

getTemperatureScalingMin

OTC_SDK_API float getTemperatureScalingMin() const noexcept

Returns the minimum temperature used to scale the image.

Returns: temperature in °C.

getTemperatureScalingMax

OTC_SDK_API float getTemperatureScalingMax() const noexcept

Returns the maximum temperature used to scale the image.

Returns: temperature in °C.

getTemperatureScalingMinFiltered

OTC_SDK_API float getTemperatureScalingMinFiltered() const noexcept

Returns the filtered minimum temperature actually used by the most recent frame's palette rendering.

For the auto-scaling modes this lags getTemperatureScalingMin() by the hysteresis filter (see setTemperatureScalingFilterFactor); in Manual mode both return the same value because setTemperatureScaling resets the filter.

Returns: temperature in °C.

getTemperatureScalingMaxFiltered

OTC_SDK_API float getTemperatureScalingMaxFiltered() const noexcept

Returns the filtered maximum temperature actually used by the most recent frame's palette rendering. See getTemperatureScalingMinFiltered().

Returns: temperature in °C.

setTemperatureScalingFilterFactor

OTC_SDK_API void setTemperatureScalingFilterFactor(float filterFactor)

Sets the low pass filter factor for the temperature scaling for smooth transitions.

Attention: The filtering only affects decreasing maximum values and increasing minimum values. Increasing maximum values and decreasing minimum values are instantly updated to prevent saturation.

Parameters

Name Description
filterFactor low pass filter factor in the interval [0.0, 1.0]. The default value is 0.96 and the value 0.0 disables the filter.

Exceptions

Name Description
SDKException if the provided filter factor is out of bounds.

getTemperatureScalingFilterFactor

OTC_SDK_API float getTemperatureScalingFilterFactor() const noexcept

Returns the low pass filter factor for the temperature scaling method.

Returns: low pass filter factor.

setTemperatureScalingMode

void setTemperatureScalingMode(TemperatureScalingMode mode) noexcept

Sets the temperature scaling mode for the false color conversion.

Parameters

Name Description
mode temperature scaling mode.

getTemperatureScalingMode

TemperatureScalingMode getTemperatureScalingMode() const noexcept

Returns the current temperate scaling mode for the false color conversion.

Returns: temperature scaling mode.

setPalette

OTC_SDK_API void setPalette(const std::string &name)

Sets the palette for the false color conversion by name.

If palettes have not been loaded yet, this triggers Sdk::loadPalettes() automatically. The palette data is copied into the ImageBuilder; subsequent registry changes do not affect an already constructed ImageBuilder.

Parameters

Name Description
name palette name (case-sensitive, e.g. "Iron").

Exceptions

Name Description
SDKException if the named palette cannot be found even after auto-loading.

getPaletteName

OTC_SDK_API std::string getPaletteName() const noexcept

Returns the name of the currently active palette.

Returns: palette name string.

getImage

const Image & getImage() noexcept

Grants read access to the generated false color image.

Returns: const reference to the generated false color image.

getImageSizeInBytes

int getImageSizeInBytes() const noexcept

Returns the image size in bytes including potential width padding.

Returns: image size in bytes including potential width padding.

getImageStride

int getImageStride() const noexcept

Returns the image stride in bytes.

The stride is the image width in bytes including potential padding.

Returns: image stride in bytes.

copyImageDataTo

OTC_SDK_API void copyImageDataTo(unsigned char *destination, int size) const noexcept

Copies the false color image data to the given destination array.

Parameters

Name Description
destination array to copy the false color image data to.
size in bytes. The specified size is limited to [0, image size in bytes].

createLookupTable

OTC_SDK_API LookupTable createLookupTable()

Creates a lookup table for the false color conversion.

Returns: lookup table.

convertTemperatureToPaletteImage

OTC_SDK_API void convertTemperatureToPaletteImage()

Triggers the image conversion.

convertTemperatureToPaletteImage

OTC_SDK_API void convertTemperatureToPaletteImage(const LookupTable &lut)

Image conversion to RBG with lookup table. This method is efficient, but works only with fixed temperature ranges (manual mode).

Parameters

Name Description
lut lookup table.

convertTemperatureToPaletteImage

OTC_SDK_API void convertTemperatureToPaletteImage(void *destination, int size)

Converts thermal data to a false color image, writing output to an external buffer.

The external buffer must be at least getImageSizeInBytes() bytes and have the same stride as getImageStride(). The internal Image member is NOT updated or allocated.

Parameters

Name Description
destination pointer to the output buffer.
size buffer size in bytes (must be >= getImageSizeInBytes()).