![]() |
Thermal Camera SDK 10.0.1
SDK for Optris Thermal Cameras
|
The best way to get started with the SDK is to try out the precompiled Simple View example. Attach your camera via USB to your computer and navigate to the start/desktop menu entry of the Simple View application. Make sure you have internet access because the SDK may download calibration files from Optris servers.
Once you click on it, two windows will open.
The first window displays a live stream of false color images generated from the thermal data received from the camera.
The red cross-hair denotes the spot with the hottest and the blue one the spot with the coldest temperature within the frame. The corresponding temperatures in degree Celsius are shown right next to the cross-hairs. The white cross-hair is fixed in the center of the frame and its value represents the mean temperature in a small area around the spot it is pointing to.
The legend in the upper right corner features two FPS values. The one for Display
refers to frame rate with which the content of the window is rendered. The FPS for Src
relates to the frequency with which data frames are received from the camera.
The second window is a terminal displaying the logging output of the SDK.
The logging output of the SDK is quite extensive in this case because it was the first time that the camera PI 640
with the serial number 18052027
was used. Let us break the logs down to get a first glimpse at how the SDK operates.
Since it was not specified to which camera the SDK should connect to it queried the EnumerationManager
for a suitable device attached to the computer. It chose the one with the smallest serial number, in this case 18052027
, and started the connection process.
EnumerationManager
can currently only detect devices attached to the USB port.This step can be skipped by providing the SDK with the serial number of the camera you want to connect to.
As the next step, the SDK tries to locate a configuration file specifying how to operate the camera. It contains settings detailing, amongst other things,
Because the SDK was unable to find an appropriate configuration file it scheduled the creation of a new one. This does not happen right away since the SDK first gathers more information about the camera, like its device type and its supported video formats. Once completed it saves the new configuration file named <Serial Number>.xml
to
<User AppData>\Roaming\Imager\Configs
on Windows or to~/.config/optris/Configs
on Linux.This step can be skipped by providing the SDK with an IRImagerConfig
instance.
At this point the SDK establishes two communication channels with the camera. One is used to send control commands to the device and the other is utilized for streaming the thermal data from the camera to the SDK.
For more details refer to the Device Communication chapter.
In order to provide precise temperature measurements the SDK has to locate and load the files containing the camera calibration. The calibration can consist out of up to three different file types:
Cali-<Serial Number>.xml
detailing for which optics, temperature ranges and video formats calibrations are available.Cali-<Serial Number>-<...>.dat
containing the calibration.Kennlinie-<Serial Number>-<...>.prn
containing additional characteristic curves.Because a new camera was used the required calibration files were not present on the system. The SDK determined the missing files and tried copy them from another location on the filesystem. Since the required source directory was not specified the attempt failed and the SDK moved on to download the files from Optris servers.
Sdk
class. There you can prioritize the different possible sources or even deactivate the automated acquisition all together.Once it is clear which calibrations are available for the camera the SDK deduces the possible operation modes. An operation mode is defined by a valid combination of the following configuration options:
The values in the configuration file are matched against the resulting modes to ensure that the desired settings are correct.
With the newly connected camera the SDK automatically chooses the first available optics, the first available temperature range and the first available video format respectively.
Now everything is set and the connection is established. The SDK receives thermal data from the device and begins the startup calibration. During this process the SDK clients already receive thermal frames but the contained temperature measurements are unreliable. Therefore, clients should wait until this calibration is finished before further processing the data.
Initializing
. You can get the flag state for each thermal through the corresponding FrameMetadata
instance. Test, if it is not equal to Initializing
to ensure the thermal data is valid.The device settings that the SDK should use are defined in a XML based configuration file. Some these settings can also be changed at runtime. Please refer to the API documentation of the IRImager
interface for more details.
The following two sections describe the two most important configuration options. For more information about all the other available settings please refer to the documentation of the configuration file.
The SDK supports both USB and Ethernet connections. The relevant settings can be found in the configuration file between the <connection>
tags:
First you have to define which connection interface to use: USB or Ethernet. Write your choice between the <interface>
tags. The SDK ignores the case of the provided string. If you chose USB, you do not need to give any more details. In the case of Ethernet you have to specify at least the following additional settings:
<ip_address>
tags.<port>
tags.Furthermore, you can instruct the SDK to check whether the sender IP address of received data packages equals the one set in the <ip_address>
tags. If the IP addresses do not match, the data package will be discarded. Set <check_ip>
to true
to active this check or to false
to deactivate it.
Finally, you can specify a connection timeout in seconds in the <timeout>
tags. If the SDK does not receive data packages for more than the set amount of time, it will trigger the onConnectionTimeout()
callback of the IRImagerClient
class.
onConnectionLoss()
is only available for USB connections.For more insights into the communication of the SDK with the device please refer to the chapter Device Communication.
The configuration settings for optics, temperature ranges and video formats are dependent on each other. There is only a limited number of valid combinations that are defined by
Consult the Support Cameras section in the Features chapter to get a list of the available video formats and temperature ranges for each supported device type.
The currently used camera optics are specified by two data points: The <field_of_view>
of the optics in degree and an optional <text>
further defining the optics.
If you set <field_of_view>
to 0
and leave the <text>
blank, the SDK will automatically choose the first optics specified in the calibration configuration.
The temperature range is defined by its non-extended <min>
and <max>
temperatures in degree Celsius.
If <min>
and <max>
are set to 0
, the SDK will automatically select the first available temperature range of the optics defined in the calibration configuration.
For some devices the temperature range can be extended by setting the option <extended>
to true
. This can be helpful to align the field of view of the camera when using temperature ranges with high lower limits.
Some devices can make temperature measurements with a higher precision for selected temperature ranges. If you set <enable_high_precision>
to true
, this higher precision will be automatically used if it is available. Set it to false
, if you just want to use the standard precision throughout.
The video format is specified by the frame dimensions <width>
and <height>
in pixels and by its <framerate>
in Hz. Consult the Supported Cameras section in the Features chapter for exhaustive lists detailing what formats are available for each device type.
If <width>
, <height>
and <framerate>
are all set to 0
, the SDK will choose the first available video format.
You can instruct the SDK to reduce the framerate by setting a <subsample_framerate>
that is equal or less than the device <framerate>
. This setting adjusts the rate with which IRImagerClients
receive thermal frame callbacks but does not alter the framerate of the device itself.
<subsampled_framerate>
setting does not affect the rate with which the device publishes frames as specified by <framerate>
. In fact the SDK has no way to manipulate the device framerate besides choosing a different video format.The SDK comes with a set of command line tools that allow you to configure the on-device Ethernet settings, find devices on the USB port and print SDK version and build information.
This tool allows you to configure the on-device Ethernet settings of cameras that offer Ethernet connectivity. Attach your camera via USB to your computer and run the following command in the terminal (Linux) or in the PowerShell (Windows):
Windows
Linux
You will be prompted for the serial number of the device whose Ethernet settings you want to change. After you hit Enter
the tool connects to the camera and displays the current configuration.
If successful, you can now enter the new device IP address, the IP address and port to which the device should send its data (destination) to and the subnet mask of the network. Provide the IP addresses and the subnet mask in dot notation.
You can leave the tool at any time with the help of Ctrl + C
.
Once you entered all the required information the tool applies the settings to the device. Then it fetches the settings again and displays them so that you can verify that everything was configured correctly.
This tool displays all devices that are currently connected to the computer via USB and allows you to monitor connection events.
Windows
Linux
First all currently connected devices are displayed. Then you will be asked whether you want to monitor device connection events. Type y
to do so or n
to quit.
You can leave the tool at any time with Ctrl + C
.
This tool just displays basic version and build information about the SDK.
Windows
Linux