### Copy Example Applications (Linux) Source: https://optris.github.io/otcsdk_downloads/example-applications.html Command to copy example applications from the installation directory to the user's home folder on Linux. ```bash cp -r /usr/share/doc/otcsdk/examples ~ ``` -------------------------------- ### Visual Studio Project Setup (Static Linking) Source: https://optris.github.io/otcsdk_downloads/start-developing.html Configuration steps for a Visual Studio C++ project to link statically against the Optris SDK. ```plaintext Input page of the `Linker` category * Add to the `Additional Dependency`: * Release builds: * `otcsdk_static.lib` * `ds_stream_base.lib` * `SoSCorrectionLib.lib` * `Urlmon.lib` * `Setupapi.lib` * `winmm.lib` * `legacy_stdio_definitions.lib` * Debug builds: * `otcsdk_staticd.lib` * `ds_stream_based.lib` * `SoSCorrectionLibd.lib` * `Urlmon.lib` * `Setupapi.lib` * `winmm.lib` * `legacy_stdio_definitions.lib` Preprocessor` page of the `C/C++` category * Add `OTC_SDK_STATIC` to the `Preprocessor Definitions`. ``` -------------------------------- ### Install Python 3 and NumPy on Linux Source: https://optris.github.io/otcsdk_downloads/start-developing.html Command to install Python 3 and NumPy on Linux using apt. ```bash sudo apt install python3 python3-numpy ``` -------------------------------- ### Install OpenCV on Windows Source: https://optris.github.io/otcsdk_downloads/start-developing.html Command to install opencv-python on Windows using pip. ```bash pip.exe install opencv-python ``` -------------------------------- ### Visual Studio Project Setup (Dynamic Linking) Source: https://optris.github.io/otcsdk_downloads/start-developing.html Configuration steps for a Visual Studio C++ project to link dynamically against the Optris SDK. ```plaintext General page * Set the `C++ Language Standard` to `ISO C++17 Standard (/std:c++17)`. VC++ Directories page * Add the path `$(OTC_SDK_DIR)\include` to the `Include Directories`. * Add the path `$(OTC_SDK_DIR)\lib` to the `Library Directories`. Input page of the `Linker` category * Add to the `Additional Dependencies`: * `otcsdk.lib` for release builds. * `otcsdkd.lib` for debug builds. ``` -------------------------------- ### Install OpenCV on Linux Source: https://optris.github.io/otcsdk_downloads/start-developing.html Command to install the python3-opencv package on Linux using apt. ```bash sudo apt install python3-opencv ``` -------------------------------- ### Install .NET SDK 8.0 on Linux Source: https://optris.github.io/otcsdk_downloads/start-developing.html Command to install the .NET SDK LTS version 8.0 and its runtime on Linux using apt. ```bash sudo apt install dotnet-sdk-8.0 dotnet8 ``` -------------------------------- ### Install NumPy on Windows Source: https://optris.github.io/otcsdk_downloads/start-developing.html Command to install NumPy on Windows using pip. ```bash pip.exe install numpy ``` -------------------------------- ### Install SDK package on Ubuntu Source: https://optris.github.io/otcsdk_downloads/installation.html Command to install the Optris SDK Debian package and its dependencies using apt. ```bash sudo apt install ./otcsdk--ubuntu--.deb ``` -------------------------------- ### Install SDK package using dpkg (without dependency installation) Source: https://optris.github.io/otcsdk_downloads/installation.html Alternative command to install the Debian package using dpkg, noting that it does not install dependencies. ```bash dpkg -i ``` -------------------------------- ### XML Configuration Example Source: https://optris.github.io/otcsdk_downloads/important-files.html This is an example of the basic structure of an XML configuration file, showing where configuration sections should be inserted. ```xml ``` -------------------------------- ### Analog Output Configuration Example Source: https://optris.github.io/otcsdk_downloads/pif.html Example of creating and applying an analog output configuration for frame synchronization. ```C++ auto aoConfig = PifAoConfig::createFrameSync(0, 1, PifAoOutputMode::_0_10V, 7.5); ``` ```C++ PifConfig pifConfig; ... pifConfig.analogOutputs.push_back(aoConfig); ``` -------------------------------- ### Process Interface (PIF) Configuration Example Source: https://optris.github.io/otcsdk_downloads/important-files.html An XML example demonstrating the configuration of a stackable Process Interface (PIF) with various input and output channels, including a fail-safe option. ```xml stackable 3 0 0 ... ... 0 0 ... ... 0 0 ... ... 0 0 ... ... off ``` -------------------------------- ### C++ Example Source: https://optris.github.io/otcsdk_downloads/important-files.html Example demonstrating how to set a custom log callback in C++ to receive and process SDK log messages, with options for exclusive output. ```cpp #include "otcsdk/Sdk.h" #include void myLogHandler(int verbosityLevel, const char* message) { const char* labels[] = {"ERROR", "WARN", "INFO", "DEBUG", "TRACE"}; std::cout << "[SDK " << labels[verbosityLevel] << "] " << message << std::endl; } int main() { using namespace optris; Sdk::init(Verbosity::Debug, Verbosity::Off); // Route all SDK log messages through myLogHandler; suppress file and screen output. Sdk::setLogCallback(myLogHandler, true); // ... use the SDK ... // Remove the callback before shutdown. Sdk::setLogCallback(nullptr); return 0; } ``` -------------------------------- ### C# Example Source: https://optris.github.io/otcsdk_downloads/important-files.html Example showing how to set a custom log callback in C# for handling SDK log messages, with exclusive output enabled. ```csharp using Optris.OtcSDK; Sdk.init(Verbosity.Debug, Verbosity.Debug, "MyApp"); Sdk.setLogCallback((level, message) => { Console.WriteLine($"[SDK] {message}"); }, exclusive: true); ``` -------------------------------- ### Channel Configuration Example Source: https://optris.github.io/otcsdk_downloads/important-files.html An example of how to configure a channel with various settings including mode, slope, trigger, and uncommitted value. ```xml 0 0 off 1. 0. 5. true Temperature Celsius ``` -------------------------------- ### Python Example Source: https://optris.github.io/otcsdk_downloads/important-files.html Example illustrating how to set a custom log callback in Python to receive and manage SDK log messages, with exclusive output. ```python from optris import Sdk, Verbosity Sdk.init(Verbosity.Debug, Verbosity.Off) def on_log(level, message): labels = {0: "ERROR", 1: "WARN", 2: "INFO", 3: "DEBUG", 4: "TRACE"} print(f"[SDK {labels.get(level, '?')}] {message}") Sdk.setLogCallback(on_log, exclusive=True) To remove the callback, call `Sdk::setLogCallback(nullptr)` (C++), `Sdk.setLogCallback(null)` (C#), or `Sdk.setLogCallback(None)` (Python). ``` -------------------------------- ### C# Example Source: https://optris.github.io/otcsdk_downloads/public-api.html Example of copying image data to a byte array in C# using ImageBuilder shortcut methods. ```csharp byte[] image = new byte[imageBuilder.getImageSizeInBytes()]; imageBuilder.copyImageDataTo(image, image.Length); ``` -------------------------------- ### Add Ethernet Detector (C++) Source: https://optris.github.io/otcsdk_downloads/example-applications.html Example of how to add an Ethernet detector to the EnumerationManager in C++ to search for devices on a specific network. ```cpp EnumerationManager::getInstance().addEthernetDetector("192.168.0.0/24"); ``` -------------------------------- ### Add Ethernet Detector with Numeric IP (C++) Source: https://optris.github.io/otcsdk_downloads/example-applications.html Example of how to add an Ethernet detector using numeric IP address and subnet mask in C++. ```cpp EnumerationManager::getInstance().addEthernetDetector(IpAddress(192, 168, 0, 0), 24); ``` -------------------------------- ### Connection Configuration Source: https://optris.github.io/otcsdk_downloads/basic-usage.html Example of connection settings in the configuration file. ```xml usb 192.168.0.101 50101 true 10 ``` -------------------------------- ### C++ Example Source: https://optris.github.io/otcsdk_downloads/public-api.html Example of copying image data to a std::vector in C++ using ImageBuilder shortcut methods. ```cpp std::vector image(imageBuilder.getImageSizeInBytes()); imageBuilder.copyImageDataTo(image.data(), image.size()); ``` -------------------------------- ### Python 3 Example Source: https://optris.github.io/otcsdk_downloads/public-api.html Example of copying image data to a NumPy array in Python 3 using ImageBuilder shortcut methods. ```python image = np.empty((image_builder.getHeight(), image_builder.getWidth(), 3), dtype=np.uint8) image_builder.copyImageDataTo(image) ``` -------------------------------- ### Optics Configuration Source: https://optris.github.io/otcsdk_downloads/basic-usage.html Example of optics configuration settings. ```xml 30 ``` -------------------------------- ### Digital Inputs Example Source: https://optris.github.io/otcsdk_downloads/important-files.html An example configuration for digital inputs on PIF devices, showing how to set a channel to 'off' mode with a low active trigger. ```xml 0 0 off true ``` -------------------------------- ### Temperature Range Configuration Source: https://optris.github.io/otcsdk_downloads/basic-usage.html Example of temperature range configuration settings. ```xml -20 100 false true ``` -------------------------------- ### Initial Palettes Loading Source: https://optris.github.io/otcsdk_downloads/color-palettes.html Palettes are loaded automatically when Sdk::init() is called. No additional setup is required. ```C++ optris::Sdk::init(optris::Verbosity::Info, optris::Verbosity::Off); // Palettes are now available ``` ```C# Sdk.init(Verbosity.Info, Verbosity.Off); // Palettes are now available. ``` ```Python Sdk.init(otc.Verbosity_Error, otc.Verbosity_Off) # Palettes are now available ``` -------------------------------- ### Python 3 Import Source: https://optris.github.io/otcsdk_downloads/start-developing.html How to import the Optris SDK module in a Python 3 project. ```python import optris.otcsdk as otc ``` -------------------------------- ### Fail Safe Configuration Example Source: https://optris.github.io/otcsdk_downloads/important-files.html An XML configuration snippet demonstrating how to enable the fail-safe mechanism and configure flag timeouts. ```xml true 0 true ``` -------------------------------- ### Video Format Configuration Source: https://optris.github.io/otcsdk_downloads/basic-usage.html Example of how to specify video format parameters like width, height, and framerate. ```xml 382 288 27 ``` -------------------------------- ### Uninstall the SDK Source: https://optris.github.io/otcsdk_downloads/installation.html Command to remove the Optris SDK from the Ubuntu system. ```bash sudo apt remove otcsdk ``` -------------------------------- ### otc_configure_ethernet with Network Address (Windows) Source: https://optris.github.io/otcsdk_downloads/basic-usage.html Example of using otc_configure_ethernet on Windows to search a specific network. ```bash otc_configure_ethernet.exe -a 192.168.178.0/24 ``` -------------------------------- ### init Source: https://optris.github.io/otcsdk_downloads/classoptris_1_1Sdk.html Initializes the SDK. ```cpp static OTC_SDK_API void | init (Verbosity logScreen, Verbosity logFile, std::string logFilenamePrefix="", std::string customDataDirectory="") ``` -------------------------------- ### Get List of All Available Palettes Source: https://optris.github.io/otcsdk_downloads/color-palettes.html To get a list of all available palettes: ```C++ std::vector names = optris::Sdk::getPaletteNames(); ``` ```C# StringVector names = Sdk.getPaletteNames(); ``` ```Python names = Sdk.getPaletteNames() ``` -------------------------------- ### Get Currently Used Palette Name Source: https://optris.github.io/otcsdk_downloads/color-palettes.html You can get the name of the currently used color palette via: ```C++ std::string name = imageBuilder.getPaletteName(); ``` ```C# string name = imageBuilder.getPaletteName(); ``` ```Python name = imageBuilder.getPaletteName() ``` -------------------------------- ### Measurement Field Configuration Example Source: https://optris.github.io/otcsdk_downloads/important-files.html An example structure for defining a single measurement field within the configuration file. ```xml ... ... ``` ```xml PIF rectangle 35 55 40 40 40 40 ... false 1. ``` -------------------------------- ### Clearing and starting uvcvideo kernel log Source: https://optris.github.io/otcsdk_downloads/troubleshooting.html Commands to clear the dmesg log and then start logging uvcvideo kernel messages to a file. ```bash sudo dmesg -c sudo dmesg -w > ~/uvc_kernel.log ``` -------------------------------- ### VersionInfo Constructor Source: https://optris.github.io/otcsdk_downloads/VersionInfo_8h_source.html Returns the version of the format definitions. ```cpp VersionInfo()=default ``` -------------------------------- ### Constructor Source: https://optris.github.io/otcsdk_downloads/FrameMetadata_8h_source.html Constructor for FrameMetadata. ```cpp OTC_SDK_API FrameMetadata() noexcept ``` -------------------------------- ### Get Value Source: https://optris.github.io/otcsdk_downloads/classoptris_1_1UncommittedValueStatus.html Returns the uncommitted value. ```cpp float getValue () const noexcept ``` -------------------------------- ### Sdk Class Initialization Source: https://optris.github.io/otcsdk_downloads/Sdk_8h_source.html Static method to initialize the SDK with specified logging levels and directories. ```cpp OTC_SDK_API static void init(Verbosity logScreen, Verbosity logFile, std::string logFilenamePrefix = "", std::string customDataDirectory = ""); ``` -------------------------------- ### getBuildDate Source: https://optris.github.io/otcsdk_downloads/VersionInfo_8h_source.html Returns a description of the SDK. ```cpp OTC_SDK_API std::string getBuildDate() noexcept ``` -------------------------------- ### MeasurementFieldConfig configuration Source: https://optris.github.io/otcsdk_downloads/measurement-fields.html Example of a MeasurementFieldConfig configuration function. ```python MeasurementFieldConfig config() ``` -------------------------------- ### Get Unit Source: https://optris.github.io/otcsdk_downloads/classoptris_1_1UncommittedValueStatus.html Returns the unit of the uncommitted value. ```cpp const std::string & getUnit () const noexcept ``` -------------------------------- ### Get Name Source: https://optris.github.io/otcsdk_downloads/classoptris_1_1UncommittedValueStatus.html Returns the name of the uncommitted value. ```cpp const std::string & getName () const noexcept ``` -------------------------------- ### CMake Configuration Source: https://optris.github.io/otcsdk_downloads/start-developing.html Instructions for configuring a CMake project to use the Optris SDK, including linking against shared or static libraries. ```cmake find_package(otcsdk REQUIRED) target_link_libraries( myTarget PRIVATE otcsdk::otcsdk ) ``` ```cmake cmake .. -DCMAKE_BUILD_TYPE=Release cmake --build . ``` ```cmake cmake .. cmake --build . --config Release ``` -------------------------------- ### Get Temperature Converter Source: https://optris.github.io/otcsdk_downloads/ThermalFrame_8h_source.html Returns the temperature converter. ```cpp inline TemperatureConverter ThermalFrame::getConverter() const noexcept { return _converter; } ``` -------------------------------- ### getDescription Source: https://optris.github.io/otcsdk_downloads/VersionInfo_8h_source.html Returns the name of the operating system for which the SDK was build for. ```cpp OTC_SDK_API std::string getDescription() noexcept ``` -------------------------------- ### Get Temperature Precision Source: https://optris.github.io/otcsdk_downloads/ThermalFrame_8h_source.html Returns the precision of the temperatures stored in the frame. ```cpp inline TemperaturePrecision ThermalFrame::getTemperaturePrecision() const noexcept { return _converter.getPrecision(); } ``` -------------------------------- ### Get Temperature by Index Source: https://optris.github.io/otcsdk_downloads/ThermalFrame_8h_source.html Returns the temperature in °C at the given index. ```cpp inline float ThermalFrame::getTemperature(int index) const noexcept(false) { return _converter.toTemperature(getValue(index)); } ``` -------------------------------- ### Alarm Channel Configuration Example Source: https://optris.github.io/otcsdk_downloads/important-files.html An XML configuration snippet illustrating the structure for defining an alarm channel, including input source, thresholds, and output settings. ```xml internal_temperature 0 mean 0 0 true true 20. 40. 25. 40. false ... ... ``` -------------------------------- ### Extracting Detected Device Information Source: https://optris.github.io/otcsdk_downloads/device-enumeration.html Methods to get information about detected devices. ```cpp EnumerationManager::getInstance().getDetectedDevices(); ``` -------------------------------- ### C# Example for Copying Thermal Data Source: https://optris.github.io/otcsdk_downloads/public-api.html Demonstrates how to copy thermal data in internal format and in degrees Celsius to float arrays using C#. ```csharp ushort[] data = new ushort[thermal.getSize()]; // Thermal data in internal format float[] temperatures = new float[thermal.getSize()]; // Thermal data in degree Celsius thermal.copyDataTo(data, data.Length); thermal.copyTemperaturesTo(temperatures, temperatures.Length); ``` -------------------------------- ### Get Temperature by Coordinates Source: https://optris.github.io/otcsdk_downloads/ThermalFrame_8h_source.html Returns the temperature in °C at the given x, y coordinates. ```cpp inline float ThermalFrame::getTemperature(int x, int y) const noexcept(false) { return _converter.toTemperature(getValue(x, y)); } ``` -------------------------------- ### Creating an alarm channel at runtime (Python) Source: https://optris.github.io/otcsdk_downloads/alarms.html Demonstrates how to create an alarm channel object using AlarmChannelConfig and add it to the IRImager. ```python AlarmChannelConfig config() # Set the desired values alarm = imager.addAlarmChannel(config) # raises an error on failure ``` -------------------------------- ### Saving a Palette in Python Source: https://optris.github.io/otcsdk_downloads/color-palettes.html Example of registering and saving a palette in Python. ```python Sdk.registerPalette("MyPalette", colors) Sdk.savePalette("MyPalette") # throws an exception if file operations fail ``` -------------------------------- ### Saving a Palette in C# Source: https://optris.github.io/otcsdk_downloads/color-palettes.html Example of registering and saving a palette in C#. ```csharp Sdk.registerPalette("MyPalette", colors); Sdk.savePalette("MyPalette"); // throws an exception if file operations fail ``` -------------------------------- ### readT Static Public Member Function Source: https://optris.github.io/otcsdk_downloads/classoptris_1_1IRImagerConfigReader.html Reads the XML configuration file with the given filename. ```cpp static OTC_SDK_API IRImagerConfig | readT (const TString &filename) ``` -------------------------------- ### getVersionInfo Source: https://optris.github.io/otcsdk_downloads/classoptris_1_1Sdk.html Returns an object holding version and build information about the SDK. ```cpp static OTC_SDK_API VersionInfo | getVersionInfo () ``` -------------------------------- ### Saving a Palette in C++ Source: https://optris.github.io/otcsdk_downloads/color-palettes.html Example of registering and saving a palette in C++. ```cpp optris::Sdk::registerPalette("MyPalette", colors); optris::Sdk::savePalette("MyPalette"); // throws an exception if file operations fail ``` -------------------------------- ### what() method Source: https://optris.github.io/otcsdk_downloads/classoptris_1_1SDKException.html Returns the error message associated with the exception. ```cpp const char * what() const noexcept override ``` -------------------------------- ### getCopyright Source: https://optris.github.io/otcsdk_downloads/VersionInfo_8h_source.html Returns the build type of the SDK. ```cpp OTC_SDK_API std::string getCopyright() noexcept ``` -------------------------------- ### Adding a measurement field Source: https://optris.github.io/otcsdk_downloads/measurement-fields.html Example of adding a measurement field using the imager object and a configuration. ```java MeasurementField field = imager.addMeasurementField(config); // throws an exception on failure ``` -------------------------------- ### Creating an alarm channel at runtime (C++) Source: https://optris.github.io/otcsdk_downloads/alarms.html Demonstrates how to create an alarm channel object using AlarmChannelConfig and add it to the IRImager. ```cpp AlarmChannelConfig config; // Set the desired values AlarmChannel::ConstShared alarm = imager.addAlarmChannel(config); // throws an exception on failure ```