update SDK

This commit is contained in:
Joe Dong
2024-04-07 11:00:47 +08:00
parent ee0a2f7011
commit 4ca5c40909
24 changed files with 1953 additions and 2204 deletions
@@ -889,6 +889,94 @@ void ob_device_load_depth_filter_config(ob_device *device, const char *file_path
*/
void ob_device_reset_default_depth_filter_config(ob_device *device, ob_error **error);
/**
* @breif Get the current preset name.
* @brief The preset mean a set of parameters or configurations that can be applied to the device to achieve a specific effect or function.
*
* @param device The device object.
* @param error Log error messages.
* @return The current preset name, it should be one of the preset names returned by @ref ob_device_get_available_preset_list.
*/
const char *ob_device_get_current_preset_name(ob_device *device, ob_error **error);
/**
* @brief Get the available preset list.
* @attention After loading the preset, the settings in the preset will set to the device immediately. Therefore, it is recommended to re-read the device
* settings to update the user program temporarily.
*
* @param device The device object.
* @param preset_name Log error messages. The name should be one of the preset names returned by @ref ob_device_get_available_preset_list.
* @param error Log error messages.
*/
void ob_device_load_preset(ob_device *device, const char *preset_name, ob_error **error);
/**
* @brief Load preset from json string.
* @brief After loading the custom preset, the settings in the custom preset will set to the device immediately.
* @brief After loading the custom preset, the available preset list will be appended with the custom preset and named as the file name.
*
* @param device The device object.
* @param json_file_path The json file path.
* @param error Log error messages.
*/
void ob_device_load_preset_from_json_file(ob_device *device, const char *json_file_path, ob_error **error);
/**
* @brief Export current settings as a preset json file.
* @brief After exporting the custom preset, the available preset list will be appended with the custom preset and named as the file name.
*
* @param device The device object.
* @param json_file_path The json file path.
* @param error Log error messages.
*/
void ob_device_export_current_settings_as_preset_json_file(ob_device *device, const char *json_file_path, ob_error **error);
/**
* @brief Get the available preset list.
*
* @param device The device object.
* @param error Log error messages.
* @return The available preset list.
*/
ob_device_preset_list *ob_device_get_available_preset_list(ob_device *device, ob_error **error);
/**
* @brief Delete the available preset list.
*
* @param preset_list The available preset list.
* @param error Log error messages.
*/
void ob_delete_preset_list(ob_device_preset_list *preset_list, ob_error **error);
/**
* @brief Get the number of preset in the preset list.
*
* @param preset_list The available preset list.
* @param error Log error messages.
* @return The number of preset in the preset list.
*/
uint32_t ob_device_preset_list_count(ob_device_preset_list *preset_list, ob_error **error);
/**
* @brief Get the name of the preset in the preset list.
*
* @param preset_list The available preset list.
* @param index The index of the preset in the preset list.
* @param error Log error messages.
* @return The name of the preset in the preset list.
*/
const char *ob_device_preset_list_get_name(ob_device_preset_list *preset_list, uint32_t index, ob_error **error);
/**
* @brief Check if the preset list has the preset.
*
* @param preset_list The available preset list.
* @param preset_name The name of the preset.
* @param error Log error messages.
* @return Whether the preset list has the preset. If true, the preset list has the preset. If false, the preset list does not have the preset.
*/
bool ob_device_preset_list_has_preset(ob_device_preset_list *preset_list, const char *preset_name, ob_error **error);
#ifdef __cplusplus
}
#endif
@@ -122,6 +122,321 @@ void ob_compression_filter_set_compression_params(ob_filter *filter, ob_compress
*/
ob_filter *ob_create_decompression_filter(ob_error **error);
/**
* @brief Create a HoleFilling Filter.
*
* @param[out] error Log error messages.
*
* @return A depth_filter object.
*/
ob_filter *ob_create_holefilling_filter(ob_error **error);
/**
* @brief Set the HoleFillingFilter mode.
*
* @param[in] filter A holefilling_filter object.
* @param[in] mode holefilling mode OB_HOLE_FILL_TOP,OB_HOLE_FILL_NEAREST or OB_HOLE_FILL_FAREST.
* @param[out] error Log error messages.
*/
void ob_holefilling_filter_set_mode(ob_filter *filter, ob_hole_filling_mode mode, ob_error **error);
/**
* @brief Get the HoleFillingFilter mode.
*
* @param[in] filter A holefilling_filter object.
* @param[out] error Log error messages.
* @return ob_hole_filling_mode
*/
ob_hole_filling_mode ob_holefilling_filter_get_mode(ob_filter *filter, ob_error **error);
/**
* @brief Create a Temporal Filter.
*
* @param[out] error Log error messages.
*
* @return A depth_filter object.
*/
ob_filter *ob_create_temporal_filter(ob_error **error);
/**
* @brief Get the TemporalFilter diffscale range.
*
* @param[in] filter A temporal_filter object.
* @param[out] error Log error messages.
* @return ob_float_property_range the value of property range.
*/
ob_float_property_range ob_temporal_filter_get_diffscale_range(ob_filter *filter, ob_error **error);
/**
* @brief Set the TemporalFilter diffscale value.
*
* @param[in] filter A temporal_filter object.
* @param[in] value diffscale value.
* @param[out] error Log error messages.
*/
void ob_temporal_filter_set_diffscale_value(ob_filter *filter, float value, ob_error **error);
/**
* @brief Get the TemporalFilter weight range.
*
* @param[in] filter A temporal filter object.
* @param[out] error Log error messages.
*/
ob_float_property_range ob_temporal_filter_get_weight_range(ob_filter *filter, ob_error **error);
/**
* @brief Set the TemporalFilter weight range.
*
* @param[in] filter A temporal_filter object.
* @param[in] value weight value.
* @param[out] error Log error messages.
*/
void ob_temporal_filter_set_weight_value(ob_filter *filter, float value, ob_error **error);
/**
* @brief Create a spatial advanced filter.
* @param[out] error Log error messages.
* @return A depth_filter object.
*/
ob_filter *ob_create_spatial_advanced_filter(ob_error **error);
/**
* @brief Get the spatial advanced filter alpha range.
*
* @param[in] filter A spatial advanced filter object.
* @param[out] error Log error messages.
* @return ob_float_property_range the alpha value of property range.
*/
ob_float_property_range ob_spatial_advanced_filter_get_alpha_range(ob_filter *filter, ob_error **error);
/**
* @brief Get the spatial advanced filter disp diff range.
*
* @param[in] filter A spatial advanced filter object.
* @param[out] error Log error messages.
* @return ob_uint16_property_range the dispdiff value of property range.
*/
ob_uint16_property_range ob_spatial_advanced_filter_get_disp_diff_range(ob_filter *filter, ob_error **error);
/**
* @brief Get the spatial advanced filter radius range.
*
* @param[in] filter A spatial advanced filter object.
* @param[out] error Log error messages.
* @return ob_uint16_property_range the radius value of property range.
*/
ob_uint16_property_range ob_spatial_advanced_filter_get_radius_range(ob_filter *filter, ob_error **error);
/**
* @brief Get the spatial advanced filter magnitude range.
*
* @param[in] filter A spatial advanced filter object.
* @param[out] error Log error messages.
* @return ob_int_property_range the magnitude value of property range.
*/
ob_int_property_range ob_spatial_advanced_filter_get_magnitude_range(ob_filter *filter, ob_error **error);
/**
* @brief Get the spatial advanced filter params.
*
* @param[in] filter A spatial advanced filter object.
* @param[out] error Log error messages.
* @return ob_spatial_advanced_filter_params.
*/
ob_spatial_advanced_filter_params ob_spatial_advanced_filter_get_filter_params(ob_filter *filter, ob_error **error);
/**
* @brief Set the spatial advanced filter params.
*
* @param[in] filter A temporal_filter object.
* @param[in] params ob_spatial_advanced_filter_params.
* @param[out] error Log error messages.
*/
void ob_spatial_advanced_filter_set_filter_params(ob_filter *filter, ob_spatial_advanced_filter_params params, ob_error **error);
/**
* @brief Create a noise removal filter.
* @param[out] error Log error messages.
* @return A depth_filter object.
*/
ob_filter *ob_create_noise_removal_filter(ob_error **error);
/**
* @brief Get the noise removal filter disp diff range.
*
* @param[in] filter A noise removal filter object.
* @param[out] error Log error messages.
* @return ob_uint16_property_range the disp_diff value of property range.
*/
ob_uint16_property_range ob_noise_removal_filter_get_disp_diff_range(ob_filter *filter, ob_error **error);
/**
* @brief Get the noise removal filter max size range.
*
* @param[in] filter noise removal filter object.
* @param[out] error Log error messages.
* @return ob_int_property_range the _max_size value of property range.
*/
ob_int_property_range ob_noise_removal_filter_get_max_size_range(ob_filter *filter, ob_error **error);
/**
* @brief Set the noise removal filter params.
*
* @param[in] filter noise removal filter object.
* @param[in] params ob_noise_removal_filter_params.
* @param[out] error Log error messages.
*/
void ob_noise_removal_filter_set_filter_params(ob_filter *filter, ob_noise_removal_filter_params params, ob_error **error);
/**
* @brief Get the noise removal filter params.
*
* @param[in] filter noise removal filter object.
* @param[out] error Log error messages.
* @return ob_noise_removal_filter_params.
*/
ob_noise_removal_filter_params ob_noise_removal_filter_get_filter_params(ob_filter *filter, ob_error **error);
/**
* @brief Create a decimation filter.
* @param[out] error Log error messages.
* @return A depth_filter object.
*/
ob_filter *ob_create_decimation_filter(ob_error **error);
/**
* @brief Get the decimation filter scale range.
*
* @param[in] filter A decimation filter object.
* @param[out] error Log error messages.
*/
ob_uint8_property_range ob_decimation_filter_get_scale_range(ob_filter *filter, ob_error **error);
/**
* @brief Set the decimation filter scale value.
*
* @param[in] filter A decimation object.
* @param[in] value decimation filter scale value.
* @param[out] error Log error messages.
*/
void ob_decimation_filter_set_scale_value(ob_filter *filter, uint8_t value, ob_error **error);
/**
* @brief Get the decimation filter scale value.
*
* @param[in] filter A decimation object.
* @param[out] error Log error messages.
* @return decimation filter scale value.
*/
uint8_t ob_decimation_filter_get_scale_value(ob_filter *filter, ob_error **error);
/**
* @brief Create a threshold filter.
* @param[out] error Log error messages.
* @return A depth_filter object.
*/
ob_filter *ob_create_threshold_filter(ob_error **error);
/**
* @brief Get the threshold filter min range.
*
* @param[in] filter A threshold filter object.
* @param[out] error Log error messages.
*/
ob_int_property_range ob_threshold_filter_get_min_range(ob_filter *filter, ob_error **error);
/**
* @brief Get the threshold filter max range.
*
* @param[in] filter A threshold filter object.
* @param[out] error Log error messages.
*/
ob_int_property_range ob_threshold_filter_get_max_range(ob_filter *filter, ob_error **error);
/**
* @brief Set the threshold filter scale range.
*
* @param[in] filter A threshold object.
* @param[in] min threshold filter scale min value.
* @param[in] max threshold filter scale max value.
* @param[out] error Log error messages.
*/
void ob_threshold_filter_set_scale_value(ob_filter *filter, uint16_t min, uint16_t max, ob_error **error);
/**
* @brief Create a SequenceId filter.
* @param[out] error Log error messages.
* @return A depth_filter object.
*/
ob_filter *ob_create_sequenceId_filter(ob_error **error);
/**
* @brief Set the sequence id filter select sequence id.
*
* @param[in] filter A sequence id object.
* @param[in] sequence_id sequence id to pass the filter.
* @param[out] error Log error messages.
*/
void ob_sequence_id_filter_select_sequence_id(ob_filter *filter, int sequence_id, ob_error **error);
/**
* @brief Get the current sequence id.
*
* @param[in] filter A sequence id object.
* @param[out] error Log error messages.
* @return sequence id to pass the filter.
*/
int ob_sequence_id_filter_get_sequence_id(ob_filter *filter, ob_error **error);
/**
* @brief Get the current sequence id list.
*
* @param[in] filter A sequence id object.
* @param[out] error Log error messages.
*/
ob_sequence_id_item *ob_sequence_id_filter_get_sequence_id_list(ob_filter *filter, ob_error **error);
/**
* @brief Get the current sequence id list size.
*
* @param[in] filter A sequence id object.
* @param[out] error Log error messages.
*/
int ob_sequence_id_filter_get_sequence_id_list_size(ob_filter *filter, ob_error **error);
/**
* @brief Create a hdr merge.
* @param[out] error Log error messages.
* @return A depth_filter object.
*/
ob_filter *ob_create_hdr_merge(ob_error **error);
/**
* @brief Create a align.
* @param[in] align_to_stream ob_stream_type.
* @param[out] error Log error messages.
* @return A depth_filter object.
*/
ob_filter *ob_create_align(ob_error **error, ob_stream_type align_to_stream);
/**
* @brief Get the algin stream type.
*
* @param[in] filter A align object.
* @param[out] error Log error messages.
* @return A ob_stream_type.
*/
ob_stream_type ob_align_get_to_stream_type(ob_filter *filter, ob_error **error);
/**
* @brief Create a disparity transform.
* @param[in] depth_to_disparity disparity to depth, depth to disparity Conversion.
* @param[out] error Log error messages.
* @return A depth_filter object.
*/
ob_filter *ob_create_disparity_transform(ob_error **error, bool depth_to_disparity);
/**
* @brief Reset the filter, clears the cache, and resets the state. If the asynchronous interface is used, the processing thread will also be stopped and the
* pending cache frames will be cleared.
@@ -142,6 +457,25 @@ void ob_filter_reset(ob_filter *filter, ob_error **error);
*/
ob_frame *ob_filter_process(ob_filter *filter, ob_frame *frame, ob_error **error);
/**
* @brief Enable the frame post processing
*
* @param[in] filter A filter object.
* @param[in] enable enable status
* @param[out] error Log error messages.
*/
void ob_filter_enable(ob_filter *filter, bool enable, ob_error **error);
/**
* @brief Get the enable status of the frame post processing
*
* @param[in] filter A filter object.
* @param[out] error Log error messages.
*
* @return The post processing filter status.
*/
bool ob_filter_is_enable(ob_filter *filter, ob_error **error);
/**
* @brief Set the processing result callback function for the filter (asynchronous callback interface).
*
@@ -67,6 +67,9 @@ typedef struct ConfigImpl ob_config;
typedef struct RecorderImpl ob_recorder;
typedef struct PlaybackImpl ob_playback;
typedef struct OBDepthWorkModeListImpl ob_depth_work_mode_list;
typedef struct FilterListImpl ob_filter_list;
typedef struct OBFilterListImpl ob_filters;
typedef struct DevicePresetListImpl ob_device_preset_list;
#define OB_WIDTH_ANY 0
#define OB_HEIGHT_ANY 0
@@ -236,6 +239,8 @@ typedef enum {
OB_FORMAT_YV12 = 29, /**< Is same as Y12, using for right ir stream*/
OB_FORMAT_BA81 = 30, /**< Is same as Y8, using for right ir stream*/
OB_FORMAT_RGBA = 31, /**< RGBA format */
OB_FORMAT_BYR2 = 32, /**< byr2 format */
OB_FORMAT_RW16 = 33, /**< RAW16 format */
OB_FORMAT_UNKNOWN = 0xff, /**< unknown format */
} OBFormat,
ob_format;
@@ -345,10 +350,10 @@ typedef struct {
*/
typedef struct {
uint8_t cur; ///< Current value
uint8_t max; ///< Maximum value
uint8_t min; ///< Minimum value
uint8_t step; ///< Step value
uint8_t def; ///< Default value
uint8_t max; ///< Maximum value
uint8_t min; ///< Minimum value
uint8_t step; ///< Step value
uint8_t def; ///< Default value
} OBUint8PropertyRange, ob_uint8_property_range;
/**
@@ -416,18 +421,20 @@ typedef struct {
/** \brief Distortion model: defines how pixel coordinates should be mapped to sensor coordinates. */
typedef enum {
OB_DISTORTION_NONE, /**< Rectilinear images. No distortion compensation required. */
OB_DISTORTION_MODIFIED_BROWN_CONRADY, /**< Equivalent to Brown-Conrady distortion, except that tangential distortion is applied to radially distorted points */
OB_DISTORTION_INVERSE_BROWN_CONRADY, /**< Equivalent to Brown-Conrady distortion, except undistorts image instead of distorting it */
OB_DISTORTION_BROWN_CONRADY, /**< Unmodified Brown-Conrady distortion model */
} OBCameraDistortionModel, ob_camera_distortion_model;
} OBCameraDistortionModel,
ob_camera_distortion_model;
/** \brief Video stream intrinsics. */
typedef struct {
int width; /**< Width of the image in pixels */
int height; /**< Height of the image in pixels */
float ppx; /**< Horizontal coordinate of the principal point of the image, as a pixel offset from the left edge */
float ppy; /**< Vertical coordinate of the principal point of the image, as a pixel offset from the top edge */
float fx; /**< Focal length of the image plane, as a multiple of pixel width */
float fy; /**< Focal length of the image plane, as a multiple of pixel height */
int width; /**< Width of the image in pixels */
int height; /**< Height of the image in pixels */
float ppx; /**< Horizontal coordinate of the principal point of the image, as a pixel offset from the left edge */
float ppy; /**< Vertical coordinate of the principal point of the image, as a pixel offset from the top edge */
float fx; /**< Focal length of the image plane, as a multiple of pixel width */
float fy; /**< Focal length of the image plane, as a multiple of pixel height */
OBCameraDistortionModel model; /**< Distortion model of the image */
float coeffs[5]; /**< Distortion coefficients. Order for Brown-Conrady: [k1, k2, p1, p2, k3]. Order for F-Theta Fish-eye: [k1, k2, k3, k4, 0]. Other models
are subject to their own interpretations */
@@ -721,7 +728,6 @@ typedef enum {
OB_TOF_FILTER_RANGE_DEBUG = 100, /**< Debug range */
} OBTofFilterRange,
ob_tof_filter_range, TOF_FILTER_RANGE;
/**
* @brief 3D point structure in the SDK
*/
@@ -932,6 +938,14 @@ typedef struct {
char name[32];
} OBDepthWorkMode, ob_depth_work_mode;
/**
* @brief SequenceId fliter list item
*/
typedef struct {
int sequenceSelectId;
char name[8];
} OBSequenceIdItem, ob_sequence_id_item;
/**
* @brief Hole fillig mode
*/
@@ -939,13 +953,14 @@ typedef enum {
OB_HOLE_FILL_TOP = 0,
OB_HOLE_FILL_NEAREST = 1, // "max" means farest for depth, and nearest for disparity; FILL_NEAREST
OB_HOLE_FILL_FAREST = 2, // FILL_FAREST
} OBHoleFillingMode, ob_hole_filling_mode;
} OBHoleFillingMode,
ob_hole_filling_mode;
typedef struct {
uint8_t magnitude; // magnitude
float alpha; // smooth_alpha
uint16_t disp_diff; // smooth_delta
uint16_t radius; // hole_fill
uint8_t magnitude; // magnitude
float alpha; // smooth_alpha
uint16_t disp_diff; // smooth_delta
uint16_t radius; // hole_fill
} OBSpatialAdvancedFilterParams, ob_spatial_advanced_filter_params;
/**
@@ -954,11 +969,12 @@ typedef struct {
typedef enum OB_DDO_NOISE_REMOVAL_TYPE {
OB_NR_LUT = 0, // SPLIT
OB_NR_OVERALL = 1, // NON_SPLIT
} OBDDONoiseRemovalType, ob_ddo_noise_removal_type;
} OBDDONoiseRemovalType,
ob_ddo_noise_removal_type;
typedef struct {
uint16_t size;
uint16_t disp_diff;
uint16_t max_size;
uint16_t disp_diff;
OBDDONoiseRemovalType type;
} OBNoiseRemovalFilterParams, ob_noise_removal_filter_params;
;
@@ -1583,6 +1599,7 @@ typedef enum {
/**
* @brief The number of frame metadata types, using for types iterating
* @attention It is not a valid frame metadata type
*/
OB_FRAME_METADATA_TYPE_COUNT,
} ob_frame_metadata_type,
@@ -179,7 +179,7 @@ typedef enum {
OB_PROP_INDICATOR_LIGHT_BOOL = 83,
/**
* @brief Disparity to depth switch, 0: off, the depth stream outputs the disparity map; 1. On, the depth stream outputs the depth map.
* @brief Disparity to depth switch, false: switch to software disparity convert to depth, true: switch to hardware disparity convert to depth
*/
OB_PROP_DISPARITY_TO_DEPTH_BOOL = 85,
@@ -407,6 +407,11 @@ typedef enum {
*/
OB_PROP_LASER_CONTROL_INT = 182,
/**
* @brief IR brightness
*/
OB_PROP_IR_BRIGHTNESS_INT = 184,
/**
* @brief Baseline calibration parameters
*/
@@ -28,6 +28,52 @@ ob_sensor_type ob_sensor_get_type(ob_sensor *sensor, ob_error **error);
*/
ob_stream_profile_list *ob_sensor_get_stream_profile_list(ob_sensor *sensor, ob_error **error);
/**
* @brief Request the list of recommended filter list
*
* @param[in] sensor The ob_sensor object.
* @param[out] error Log error messages.
*
* @return ob_filter_list
*/
ob_filter_list *ob_sensor_get_recommended_filter_list(ob_sensor *sensor, ob_error **error);
/**
* @brief Get the number of recommended filter list
*
* @param ob_filter_list Recommended filter list
* @param error Log error messages
* @return uint32_t The number of list
*/
uint32_t ob_filter_list_get_count(ob_filter_list *filter_list, ob_error **error);
/**
* @brief Get the number of recommended filter list
*
* @param ob_filter_list Recommended filter list
* @param index Recommended filter index
* @param error Log error messages
* @return ob_filter The index of ob_filter
*/
ob_filter *ob_get_filter(ob_filter_list *filter_list, uint32_t index, ob_error **error);
/**
* @brief Get the name of ob_filter
*
* @param filter ob_filter object
* @param error Log error messages
* @return char The filter of name
*/
const char *ob_get_filter_name(ob_filter *filter, ob_error **error);
/**
* @brief Delete a list of ob_filter objects.
*
* @param[in] filter_list The list of ob_filter objects to delete.
* @param[out] error Logs error messages.
*/
void ob_delete_filter_list(ob_filter_list *filter_list, ob_error **error);
/**
* @brief Open the current sensor and set the callback data frame.
*