![]() |
Thermal Camera SDK 11.3.0
SDK for Optris Thermal Cameras
|
Creates false color images from thermal frames. More...
#include <ImageBuilder.h>

Public Types | |
| using | LookupTable = std::array<unsigned int, 65536> |
| Type for look up tables. | |
Public Member Functions | |
| OTC_SDK_API | ImageBuilder (ColorFormat colorFormat, WidthAlignment widthAlignment) |
| Constructor. | |
| OTC_SDK_API void | setThermalFrame (const ThermalFrame &thermalFrame) |
| Sets a new thermal frame. | |
| const ThermalFrame & | getThermalFrame () const noexcept |
| Grants read access to the stored thermal frame. | |
| int | getWidth () const noexcept |
| Returns the width in pixels of the thermal frame. | |
| int | getHeight () const noexcept |
| Returns the height in pixels of thermal frame. | |
| OTC_SDK_API float | getTemperature (int index) const |
| Returns the temperature the from last acquired image at specified pixel index. | |
| OTC_SDK_API float | getTemperature (int x, int y) const |
| Returns the temperature from last acquired image at specified pixel coordinates. | |
| OTC_SDK_API bool | getMeanTemperatureInRegion (TemperatureRegion &meanRegion) |
| Returns the mean temperature in °C of a rectangular region. | |
| OTC_SDK_API bool | getMinMaxRegions (int radius, TemperatureRegion &minRegion, TemperatureRegion &maxRegion) |
| Returns the region of minimum/maximum temperature in °C with the given radius. | |
| OTC_SDK_API void | setTemperatureScaling (float min, float max) |
| Sets the temperature range for the manual scaling mode. | |
| OTC_SDK_API float | getTemperatureScalingMin () const noexcept |
| Returns the minimum temperature used to scale the image. | |
| OTC_SDK_API float | getTemperatureScalingMax () const noexcept |
| Returns the maximum temperature used to scale the image. | |
| OTC_SDK_API float | getTemperatureScalingMinFiltered () const noexcept |
| Returns the filtered minimum temperature actually used by the most recent frame's palette rendering. | |
| OTC_SDK_API float | getTemperatureScalingMaxFiltered () const noexcept |
| Returns the filtered maximum temperature actually used by the most recent frame's palette rendering. See getTemperatureScalingMinFiltered(). | |
| OTC_SDK_API void | setTemperatureScalingFilterFactor (float filterFactor) |
| Sets the low pass filter factor for the temperature scaling for smooth transitions. | |
| OTC_SDK_API float | getTemperatureScalingFilterFactor () const noexcept |
| Returns the low pass filter factor for the temperature scaling method. | |
| void | setTemperatureScalingMode (TemperatureScalingMode mode) noexcept |
| Sets the temperature scaling mode for the false color conversion. | |
| TemperatureScalingMode | getTemperatureScalingMode () const noexcept |
| Returns the current temperate scaling mode for the false color conversion. | |
| OTC_SDK_API void | setPalette (const std::string &name) |
| Sets the palette for the false color conversion by name. | |
| OTC_SDK_API std::string | getPaletteName () const noexcept |
| Returns the name of the currently active palette. | |
| const Image & | getImage () noexcept |
| Grants read access to the generated false color image. | |
| int | getImageSizeInBytes () const noexcept |
| Returns the image size in bytes including potential width padding. | |
| int | getImageStride () const noexcept |
| Returns the image stride in bytes. | |
| OTC_SDK_API void | copyImageDataTo (unsigned char *destination, int size) const noexcept |
| Copies the false color image data to the given destination array. | |
| OTC_SDK_API LookupTable | createLookupTable () |
| Creates a lookup table for the false color conversion. | |
| OTC_SDK_API void | convertTemperatureToPaletteImage () |
| Triggers the image conversion. | |
| 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). | |
| OTC_SDK_API void | convertTemperatureToPaletteImage (void *destination, int size) |
| Converts thermal data to a false color image, writing output to an external buffer. | |
Creates false color images from thermal frames.
| OTC_SDK_API optris::ImageBuilder::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.
| [in] | colorFormat | for the generated false color image. |
| [in] | widthAlignment | for the generated false color image. |
| OTC_SDK_API void optris::ImageBuilder::convertTemperatureToPaletteImage | ( | const LookupTable & | lut | ) |
Image conversion to RBG with lookup table. This method is efficient, but works only with fixed temperature ranges (manual mode).
| [in] | lut | lookup table. |
| OTC_SDK_API void optris::ImageBuilder::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.
| [out] | destination | pointer to the output buffer. |
| [in] | size | buffer size in bytes (must be >= getImageSizeInBytes()). |
|
noexcept |
Copies the false color image data to the given destination array.
| [out] | destination | array to copy the false color image data to. |
| [in] | size | in bytes. The specified size is limited to [0, image size in bytes]. |
| OTC_SDK_API LookupTable optris::ImageBuilder::createLookupTable | ( | ) |
Creates a lookup table for the false color conversion.
|
inlinenoexcept |
Returns the height in pixels of thermal frame.
|
inlinenoexcept |
Grants read access to the generated false color image.
|
inlinenoexcept |
Returns the image size in bytes including potential width padding.
|
inlinenoexcept |
Returns the image stride in bytes.
The stride is the image width in bytes including potential padding.
| OTC_SDK_API bool optris::ImageBuilder::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.
| [out] | meanRegion | in which to calculate the mean temperature. |
| OTC_SDK_API bool optris::ImageBuilder::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.
| [in] | radius | radius of the region. |
| [out] | minRegion | region of minimum mean temperature. |
| [out] | maxRegion | region of maximum mean temperature. |
|
inlinenoexcept |
Returns the name of the currently active palette.
| OTC_SDK_API float optris::ImageBuilder::getTemperature | ( | int | index | ) | const |
Returns the temperature the from last acquired image at specified pixel index.
| [in] | index | pixel index. |
| SDKException | if index is out of range. |
| OTC_SDK_API float optris::ImageBuilder::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.
| [in] | x | coordinates. |
| [in] | y | coordinates. |
| SDKException | if coordinates are out of range. |
|
noexcept |
Returns the low pass filter factor for the temperature scaling method.
|
noexcept |
Returns the maximum temperature used to scale the image.
|
noexcept |
Returns the filtered maximum temperature actually used by the most recent frame's palette rendering. See getTemperatureScalingMinFiltered().
|
noexcept |
Returns the minimum temperature used to scale the image.
|
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.
|
inlinenoexcept |
Returns the current temperate scaling mode for the false color conversion.
|
inlinenoexcept |
Grants read access to the stored thermal frame.
|
inlinenoexcept |
Returns the width in pixels of the thermal frame.
| OTC_SDK_API void optris::ImageBuilder::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.
| [in] | name | palette name (case-sensitive, e.g. "Iron"). |
| SDKException | if the named palette cannot be found even after auto-loading. |
| OTC_SDK_API void optris::ImageBuilder::setTemperatureScaling | ( | float | min, |
| float | max ) |
Sets the temperature range for the manual scaling mode.
| [in] | min | lower limit in °C. |
| [in] | max | upper limit in °C. |
| SDKException | if the provided temperatures are invalid or if max is not at least 1°C higher than min. |
| OTC_SDK_API void optris::ImageBuilder::setTemperatureScalingFilterFactor | ( | float | filterFactor | ) |
Sets the low pass filter factor for the temperature scaling for smooth transitions.
| [in] | 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. |
| SDKException | if the provided filter factor is out of bounds. |
|
inlinenoexcept |
Sets the temperature scaling mode for the false color conversion.
| [in] | mode | temperature scaling mode. |
| OTC_SDK_API void optris::ImageBuilder::setThermalFrame | ( | const ThermalFrame & | thermalFrame | ) |
Sets a new thermal frame.
The provide frame will be copied to an internal buffer.
| [in] | thermalFrame | data. |