DJI Thermal SDK API
v1.5
Infrared camera image processing and temperature measurement library API
|
#include "stdint.h"
Go to the source code of this file.
Data Structures | |
struct | dirp_api_version_t |
API version structure definition. More... | |
struct | dirp_rjpeg_version_t |
R-JPEG version structure definition. More... | |
struct | dirp_resolution_t |
The image size structure definition. More... | |
struct | dirp_isotherm_t |
Isotherm parameters structure definition. More... | |
struct | dirp_color_bar_t |
Color bar parameters structure definition. More... | |
struct | dirp_isp_pseudo_color_lut_t |
Pseudo color LUT array structure definition. More... | |
struct | dirp_enhancement_params_t |
Image enhancement parameteres structure definition. More... | |
struct | dirp_measurement_params_t |
Customize temperature measurement parameteres structure definition. More... | |
struct | dirp_measurement_params_range_t |
Range of temperature measurement parameteres structure definition. More... | |
Macros | |
#define | _DIRP_API_H_ |
#define | dllexport __attribute__ ((visibility("default"))) |
#define | DIRP_PSEUDO_COLOR_LUT_DEPTH (256) |
Typedefs | |
typedef void * | DIRP_HANDLE |
Structure representing a handle on a DIRP instance. More... | |
Functions | |
dllexport int32_t | dirp_create_from_rjpeg (const uint8_t *data, int32_t size, DIRP_HANDLE *ph) |
Create a new DIRP handle with specified R-JPEG binary data. More... | |
dllexport int32_t | dirp_destroy (DIRP_HANDLE h) |
Destroy the DIRP handle. More... | |
dllexport int32_t | dirp_get_api_version (DIRP_HANDLE h, dirp_api_version_t *version) |
Get API version. More... | |
dllexport int32_t | dirp_get_rjpeg_version (DIRP_HANDLE h, dirp_rjpeg_version_t *version) |
Get R-JPEG version. More... | |
dllexport int32_t | dirp_get_rjpeg_resolution (DIRP_HANDLE h, dirp_resolution_t *resolution) |
Get R-JPEG image resolution information. More... | |
dllexport int32_t | dirp_get_original_raw (DIRP_HANDLE h, uint16_t *raw_image, int32_t size) |
Get original RAW binary data from R-JPEG. More... | |
dllexport int32_t | dirp_process (DIRP_HANDLE h, uint8_t *color_image, int32_t size) |
Run ISP algorithm with RAW data in R-JPEG and output RGB pseudo color image. More... | |
dllexport int32_t | dirp_process_strech (DIRP_HANDLE h, float *strech_image, int32_t size) |
Run ISP strech algorithm with RAW data in R-JPEG and output FLOAT32 streching image. More... | |
dllexport int32_t | dirp_measure (DIRP_HANDLE h, int16_t *temp_image, int32_t size) |
Measure temperature of whole thermal image with RAW data in R-JPEG. More... | |
dllexport int32_t | dirp_measure_ex (DIRP_HANDLE h, float *temp_image, int32_t size) |
Measure temperature of whole thermal image with RAW data in R-JPEG. More... | |
dllexport int32_t | dirp_set_isotherm (DIRP_HANDLE h, const dirp_isotherm_t *isotherm) |
Set custom ISP isotherm parameters. More... | |
dllexport int32_t | dirp_get_isotherm (DIRP_HANDLE h, dirp_isotherm_t *isotherm) |
Get orignial/custom ISP isotherm parameters. More... | |
dllexport int32_t | dirp_set_color_bar (DIRP_HANDLE h, const dirp_color_bar_t *color_bar) |
Set custom ISP color bar parameters. More... | |
dllexport int32_t | dirp_get_color_bar (DIRP_HANDLE h, dirp_color_bar_t *color_bar) |
Get orignial/custom ISP color bar parameters. More... | |
dllexport int32_t | dirp_get_color_bar_adaptive_params (DIRP_HANDLE h, dirp_color_bar_t *color_bar) |
Get adaptive ISP color bar parameters in automatic mode. More... | |
dllexport int32_t | dirp_set_pseudo_color (DIRP_HANDLE h, dirp_pseudo_color_e pseudo_color) |
Set custom ISP pseudo color type. More... | |
dllexport int32_t | dirp_get_pseudo_color (DIRP_HANDLE h, dirp_pseudo_color_e *pseudo_color) |
Get orignial/custom ISP pseudo color type. More... | |
dllexport int32_t | dirp_get_pseudo_color_lut (DIRP_HANDLE h, dirp_isp_pseudo_color_lut_t *pseudo_lut) |
Get ISP pseudo color LUT. More... | |
dllexport int32_t | dirp_set_enhancement_params (DIRP_HANDLE h, const dirp_enhancement_params_t *enhancement_params) |
Set custom ISP enhancement parameters. More... | |
dllexport int32_t | dirp_get_enhancement_params (DIRP_HANDLE h, dirp_enhancement_params_t *enhancement_params) |
Get orignial/custom ISP enhancement parameters. More... | |
dllexport int32_t | dirp_set_measurement_params (DIRP_HANDLE h, const dirp_measurement_params_t *measurement_params) |
Set custom temperature measurement parameters. More... | |
dllexport int32_t | dirp_get_measurement_params (DIRP_HANDLE h, dirp_measurement_params_t *measurement_params) |
Get orignial/custom temperature measurement parameters. More... | |
dllexport int32_t | dirp_get_measurement_params_range (DIRP_HANDLE h, dirp_measurement_params_range_t *params_range) |
Get range of temperature measurement parameters that user can set. More... | |
dllexport void | dirp_set_verbose_level (dirp_verbose_level_e level) |
Set log print level. More... | |
dllexport void | dirp_set_logger_file (const char *file_name) |
Set external logger file. More... | |
#define _DIRP_API_H_ |
#define DIRP_PSEUDO_COLOR_LUT_DEPTH (256) |
#define dllexport __attribute__ ((visibility("default"))) |
typedef void* DIRP_HANDLE |
Structure representing a handle on a DIRP instance.
It is usually originating from dirp_create_from_rjpeg function. A DIRP handle is used to perform image processing and temperature measurement operations. When finished a DIRP processing, you should call dirp_destroy function.
enum dirp_pseudo_color_e |
Palette types.
There are variety of palette options. Distinct colors are used to show temperature differences in the thermal image, which are related to grayscale intensity.
enum dirp_ret_code_e |
Error codes.
Most DIRP functions return 0 on success or one of negative value on failure.
enum dirp_verbose_level_e |
dllexport int32_t dirp_create_from_rjpeg | ( | const uint8_t * | data, |
int32_t | size, | ||
DIRP_HANDLE * | ph | ||
) |
Create a new DIRP handle with specified R-JPEG binary data.
The R-JPEG binary data buffer must remain valid until the handle is destroyed. The DIRP API library will create some alloc buffers for inner usage. So the application should reserve enough stack size for the library.
[in] | data | R-JPEG binary data buffer pointer |
[in] | size | R-JPEG binary data buffer size in bytes |
[out] | ph | DIRP API handle pointer |
dllexport int32_t dirp_destroy | ( | DIRP_HANDLE | h | ) |
dllexport int32_t dirp_get_api_version | ( | DIRP_HANDLE | h, |
dirp_api_version_t * | version | ||
) |
Get API version.
[in] | h | DIRP API handle |
[out] | version | DIRP API version information pointer |
dllexport int32_t dirp_get_color_bar | ( | DIRP_HANDLE | h, |
dirp_color_bar_t * | color_bar | ||
) |
Get orignial/custom ISP color bar parameters.
[in] | h | DIRP API handle |
[out] | color_bar | ISP color bar parameters pointer |
dllexport int32_t dirp_get_color_bar_adaptive_params | ( | DIRP_HANDLE | h, |
dirp_color_bar_t * | color_bar | ||
) |
Get adaptive ISP color bar parameters in automatic mode.
In color bar automatic mode : manual_enable in dirp_color_bar_t is set as false. The inner ISP algorithm will calculate the best range values for color bar. Before calling this API you should call dirp_process once at least. And if any processing or measurement parameters had been changed, you should also call dirp_process again for getting new color bar adaptive parameters. In the above calling dirp_process, manual_enable in dirp_color_bar_t must be set as false.
[in] | h | DIRP API handle |
[out] | color_bar | ISP color bar parameters pointer |
dllexport int32_t dirp_get_enhancement_params | ( | DIRP_HANDLE | h, |
dirp_enhancement_params_t * | enhancement_params | ||
) |
Get orignial/custom ISP enhancement parameters.
[in] | h | DIRP API handle |
[out] | enhancement_params | ISP enhancement parameters pointer |
dllexport int32_t dirp_get_isotherm | ( | DIRP_HANDLE | h, |
dirp_isotherm_t * | isotherm | ||
) |
Get orignial/custom ISP isotherm parameters.
[in] | h | DIRP API handle |
[out] | isotherm | ISP isotherm parameters pointer |
dllexport int32_t dirp_get_measurement_params | ( | DIRP_HANDLE | h, |
dirp_measurement_params_t * | measurement_params | ||
) |
Get orignial/custom temperature measurement parameters.
[in] | h | DIRP API handle |
[out] | measurement_params | Temperature measurement parameters pointer |
dllexport int32_t dirp_get_measurement_params_range | ( | DIRP_HANDLE | h, |
dirp_measurement_params_range_t * | params_range | ||
) |
Get range of temperature measurement parameters that user can set.
[in] | h | DIRP API handle |
[out] | params_range | Temperature measurement parameters range pointer |
dllexport int32_t dirp_get_original_raw | ( | DIRP_HANDLE | h, |
uint16_t * | raw_image, | ||
int32_t | size | ||
) |
Get original RAW binary data from R-JPEG.
[in] | h | DIRP API handle |
[out] | raw_image | Original RAW image data buffer pointer |
[in] | size | Original RAW image data buffer size in bytes |
dllexport int32_t dirp_get_pseudo_color | ( | DIRP_HANDLE | h, |
dirp_pseudo_color_e * | pseudo_color | ||
) |
Get orignial/custom ISP pseudo color type.
[in] | h | DIRP API handle |
[out] | pseudo_color | ISP pseudo color type pointer dirp_pseudo_color_e |
dllexport int32_t dirp_get_pseudo_color_lut | ( | DIRP_HANDLE | h, |
dirp_isp_pseudo_color_lut_t * | pseudo_lut | ||
) |
Get ISP pseudo color LUT.
[in] | h | DIRP API handle |
[out] | pseudo_lut | ISP pseudo color LUT pointer |
dllexport int32_t dirp_get_rjpeg_resolution | ( | DIRP_HANDLE | h, |
dirp_resolution_t * | resolution | ||
) |
Get R-JPEG image resolution information.
[in] | h | DIRP API handle |
[out] | rjpeg_info | R-JPEG basic information pointer |
dllexport int32_t dirp_get_rjpeg_version | ( | DIRP_HANDLE | h, |
dirp_rjpeg_version_t * | version | ||
) |
Get R-JPEG version.
[in] | h | DIRP API handle |
[out] | version | R-JPEG version information pointer |
dllexport int32_t dirp_measure | ( | DIRP_HANDLE | h, |
int16_t * | temp_image, | ||
int32_t | size | ||
) |
Measure temperature of whole thermal image with RAW data in R-JPEG.
Each INT16 pixel value represents ten times the temperature value in Celsius. In other words, each LSB represents 0.1 degrees Celsius. The custom measurement parameters can be modifed by this API:
[in] | h | DIRP API handle |
[out] | temp_image | Temperature image data buffer pointer |
[in] | size | Temperature image data buffer size in bytes |
dllexport int32_t dirp_measure_ex | ( | DIRP_HANDLE | h, |
float * | temp_image, | ||
int32_t | size | ||
) |
Measure temperature of whole thermal image with RAW data in R-JPEG.
Each FLOAT32 pixel value represents the real temperature in Celsius. The custom measurement parameters can be modifed by this API:
[in] | h | DIRP API handle |
[out] | temp_image | Temperature image data buffer pointer |
[in] | size | Temperature image data buffer size in bytes |
dllexport int32_t dirp_process | ( | DIRP_HANDLE | h, |
uint8_t * | color_image, | ||
int32_t | size | ||
) |
Run ISP algorithm with RAW data in R-JPEG and output RGB pseudo color image.
The ISP configurable parameters can be modifed by these APIs:
[in] | h | DIRP API handle |
[out] | color_image | Color image data buffer pointer |
[in] | size | Color image data buffer size in bytes. |
dllexport int32_t dirp_process_strech | ( | DIRP_HANDLE | h, |
float * | strech_image, | ||
int32_t | size | ||
) |
Run ISP strech algorithm with RAW data in R-JPEG and output FLOAT32 streching image.
The ISP strech configurable parameters can be modifed by these APIs:
[in] | h | DIRP API handle |
[out] | strech_image | Strech image data buffer pointer |
[in] | size | Strech image data buffer size in bytes. |
dllexport int32_t dirp_set_color_bar | ( | DIRP_HANDLE | h, |
const dirp_color_bar_t * | color_bar | ||
) |
Set custom ISP color bar parameters.
[in] | h | DIRP API handle |
[in] | color_bar | ISP color bar parameters pointer |
dllexport int32_t dirp_set_enhancement_params | ( | DIRP_HANDLE | h, |
const dirp_enhancement_params_t * | enhancement_params | ||
) |
Set custom ISP enhancement parameters.
[in] | h | DIRP API handle |
[in] | enhancement_params | ISP enhancement parameters pointer |
dllexport int32_t dirp_set_isotherm | ( | DIRP_HANDLE | h, |
const dirp_isotherm_t * | isotherm | ||
) |
Set custom ISP isotherm parameters.
[in] | h | DIRP API handle |
[in] | isotherm | ISP isotherm parameters pointer |
dllexport void dirp_set_logger_file | ( | const char * | file_name | ) |
Set external logger file.
[in] | file_name | File name which save log information. Set it as nullptr if you want print log on console. |
dllexport int32_t dirp_set_measurement_params | ( | DIRP_HANDLE | h, |
const dirp_measurement_params_t * | measurement_params | ||
) |
Set custom temperature measurement parameters.
[in] | h | DIRP API handle |
[in] | measurement_params | Temperature measurement parameters pointer |
dllexport int32_t dirp_set_pseudo_color | ( | DIRP_HANDLE | h, |
dirp_pseudo_color_e | pseudo_color | ||
) |
Set custom ISP pseudo color type.
[in] | h | DIRP API handle |
[in] | pseudo_color | ISP pseudo color type dirp_pseudo_color_e |
dllexport void dirp_set_verbose_level | ( | dirp_verbose_level_e | level | ) |
Set log print level.
[in] | level | Log pring level dirp_verbose_level_e |