Update Orbbec SDK to version 2.5.0

This commit is contained in:
obyalian
2025-09-02 17:03:39 +08:00
committed by xiexun
parent e2e0664615
commit fef7345e6d
19 changed files with 180 additions and 82 deletions
@@ -19,26 +19,26 @@
extern "C" {
#endif
typedef struct ob_context_t ob_context;
typedef struct ob_device_t ob_device;
typedef struct ob_device_info_t ob_device_info;
typedef struct ob_device_list_t ob_device_list;
typedef struct ob_record_device_t ob_record_device;
typedef struct ob_playback_device_t ob_playback_device;
typedef struct ob_camera_param_list_t ob_camera_param_list;
typedef struct ob_sensor_t ob_sensor;
typedef struct ob_sensor_list_t ob_sensor_list;
typedef struct ob_stream_profile_t ob_stream_profile;
typedef struct ob_stream_profile_list_t ob_stream_profile_list;
typedef struct ob_frame_t ob_frame;
typedef struct ob_filter_t ob_filter;
typedef struct ob_filter_list_t ob_filter_list;
typedef struct ob_pipeline_t ob_pipeline;
typedef struct ob_config_t ob_config;
typedef struct ob_depth_work_mode_list_t ob_depth_work_mode_list;
typedef struct ob_device_preset_list_t ob_device_preset_list;
typedef struct ob_filter_config_schema_list_t ob_filter_config_schema_list;
typedef struct ob_device_frame_interleave_list_t ob_device_frame_interleave_list;
typedef struct ob_context_t ob_context;
typedef struct ob_device_t ob_device;
typedef struct ob_device_info_t ob_device_info;
typedef struct ob_device_list_t ob_device_list;
typedef struct ob_record_device_t ob_record_device;
typedef struct ob_playback_device_t ob_playback_device;
typedef struct ob_camera_param_list_t ob_camera_param_list;
typedef struct ob_sensor_t ob_sensor;
typedef struct ob_sensor_list_t ob_sensor_list;
typedef struct ob_stream_profile_t ob_stream_profile;
typedef struct ob_stream_profile_list_t ob_stream_profile_list;
typedef struct ob_frame_t ob_frame;
typedef struct ob_filter_t ob_filter;
typedef struct ob_filter_list_t ob_filter_list;
typedef struct ob_pipeline_t ob_pipeline;
typedef struct ob_config_t ob_config;
typedef struct ob_depth_work_mode_list_t ob_depth_work_mode_list;
typedef struct ob_device_preset_list_t ob_device_preset_list;
typedef struct ob_filter_config_schema_list_t ob_filter_config_schema_list;
typedef struct ob_device_frame_interleave_list_t ob_device_frame_interleave_list;
typedef struct ob_preset_resolution_config_list_t ob_preset_resolution_config_list;
#define OB_WIDTH_ANY 0
@@ -126,17 +126,17 @@ typedef struct ob_error {
* @brief Enumeration value describing the sensor type
*/
typedef enum {
OB_SENSOR_UNKNOWN = 0, /**< Unknown type sensor */
OB_SENSOR_IR = 1, /**< IR */
OB_SENSOR_COLOR = 2, /**< Color */
OB_SENSOR_DEPTH = 3, /**< Depth */
OB_SENSOR_ACCEL = 4, /**< Accel */
OB_SENSOR_GYRO = 5, /**< Gyro */
OB_SENSOR_IR_LEFT = 6, /**< left IR for stereo camera*/
OB_SENSOR_IR_RIGHT = 7, /**< Right IR for stereo camera*/
OB_SENSOR_RAW_PHASE = 8, /**< Raw Phase */
OB_SENSOR_CONFIDENCE = 9,/**< Confidence */
OB_SENSOR_TYPE_COUNT, /**The total number of sensor types, is not a valid sensor type */
OB_SENSOR_UNKNOWN = 0, /**< Unknown type sensor */
OB_SENSOR_IR = 1, /**< IR */
OB_SENSOR_COLOR = 2, /**< Color */
OB_SENSOR_DEPTH = 3, /**< Depth */
OB_SENSOR_ACCEL = 4, /**< Accel */
OB_SENSOR_GYRO = 5, /**< Gyro */
OB_SENSOR_IR_LEFT = 6, /**< left IR for stereo camera*/
OB_SENSOR_IR_RIGHT = 7, /**< Right IR for stereo camera*/
OB_SENSOR_RAW_PHASE = 8, /**< Raw Phase */
OB_SENSOR_CONFIDENCE = 9, /**< Confidence */
OB_SENSOR_TYPE_COUNT, /**The total number of sensor types, is not a valid sensor type */
} OBSensorType,
ob_sensor_type;
@@ -144,18 +144,18 @@ typedef enum {
* @brief Enumeration value describing the type of data stream
*/
typedef enum {
OB_STREAM_UNKNOWN = -1, /**< Unknown type stream */
OB_STREAM_VIDEO = 0, /**< Video stream (infrared, color, depth streams are all video streams) */
OB_STREAM_IR = 1, /**< IR stream */
OB_STREAM_COLOR = 2, /**< color stream */
OB_STREAM_DEPTH = 3, /**< depth stream */
OB_STREAM_ACCEL = 4, /**< Accelerometer data stream */
OB_STREAM_GYRO = 5, /**< Gyroscope data stream */
OB_STREAM_IR_LEFT = 6, /**< Left IR stream for stereo camera */
OB_STREAM_IR_RIGHT = 7, /**< Right IR stream for stereo camera */
OB_STREAM_RAW_PHASE = 8, /**< RawPhase Stream */
OB_STREAM_CONFIDENCE = 9, /**< Confidence Stream*/
OB_STREAM_TYPE_COUNT, /**< The total number of stream type,is not a valid stream type */
OB_STREAM_UNKNOWN = -1, /**< Unknown type stream */
OB_STREAM_VIDEO = 0, /**< Video stream (infrared, color, depth streams are all video streams) */
OB_STREAM_IR = 1, /**< IR stream */
OB_STREAM_COLOR = 2, /**< color stream */
OB_STREAM_DEPTH = 3, /**< depth stream */
OB_STREAM_ACCEL = 4, /**< Accelerometer data stream */
OB_STREAM_GYRO = 5, /**< Gyroscope data stream */
OB_STREAM_IR_LEFT = 6, /**< Left IR stream for stereo camera */
OB_STREAM_IR_RIGHT = 7, /**< Right IR stream for stereo camera */
OB_STREAM_RAW_PHASE = 8, /**< RawPhase Stream */
OB_STREAM_CONFIDENCE = 9, /**< Confidence Stream*/
OB_STREAM_TYPE_COUNT, /**< The total number of stream type,is not a valid stream type */
} OBStreamType,
ob_stream_type;
@@ -163,20 +163,20 @@ typedef enum {
* @brief Enumeration value describing the type of frame
*/
typedef enum {
OB_FRAME_UNKNOWN = -1, /**< Unknown frame type */
OB_FRAME_VIDEO = 0, /**< Video frame */
OB_FRAME_IR = 1, /**< IR frame */
OB_FRAME_COLOR = 2, /**< Color frame */
OB_FRAME_DEPTH = 3, /**< Depth frame */
OB_FRAME_ACCEL = 4, /**< Accelerometer data frame */
OB_FRAME_SET = 5, /**< Frame collection (internally contains a variety of data frames) */
OB_FRAME_POINTS = 6, /**< Point cloud frame */
OB_FRAME_GYRO = 7, /**< Gyroscope data frame */
OB_FRAME_IR_LEFT = 8, /**< Left IR frame for stereo camera */
OB_FRAME_IR_RIGHT = 9, /**< Right IR frame for stereo camera */
OB_FRAME_RAW_PHASE = 10, /**< Raw Phase frame*/
OB_FRAME_CONFIDENCE = 11,/**< Confidence frame*/
OB_FRAME_TYPE_COUNT, /**< The total number of frame types, is not a valid frame type */
OB_FRAME_UNKNOWN = -1, /**< Unknown frame type */
OB_FRAME_VIDEO = 0, /**< Video frame */
OB_FRAME_IR = 1, /**< IR frame */
OB_FRAME_COLOR = 2, /**< Color frame */
OB_FRAME_DEPTH = 3, /**< Depth frame */
OB_FRAME_ACCEL = 4, /**< Accelerometer data frame */
OB_FRAME_SET = 5, /**< Frame collection (internally contains a variety of data frames) */
OB_FRAME_POINTS = 6, /**< Point cloud frame */
OB_FRAME_GYRO = 7, /**< Gyroscope data frame */
OB_FRAME_IR_LEFT = 8, /**< Left IR frame for stereo camera */
OB_FRAME_IR_RIGHT = 9, /**< Right IR frame for stereo camera */
OB_FRAME_RAW_PHASE = 10, /**< Raw Phase frame*/
OB_FRAME_CONFIDENCE = 11, /**< Confidence frame*/
OB_FRAME_TYPE_COUNT, /**< The total number of frame types, is not a valid frame type */
} OBFrameType,
ob_frame_type;
@@ -1736,6 +1736,16 @@ typedef enum {
} ob_playback_status,
OBPlaybackStatus;
/**
* @brief Intra-camera Sync Reference based on the exposure start time, the exposure middle time, or the exposure end time.
*/
typedef enum {
START_OF_EXPOSURE = 0, /**< start of exposure */
MIDDLE_OF_EXPOSURE, /**< middle of exposure */
END_OF_EXPOSURE, /**< end of exposure */
} ob_intra_camera_sync_reference,
OBIntraCameraSyncReference;
// For compatibility
#define OB_FRAME_METADATA_TYPE_LASER_POWER_MODE OB_FRAME_METADATA_TYPE_LASER_POWER_LEVEL
#define OB_FRAME_METADATA_TYPE_EMITTER_MODE OB_FRAME_METADATA_TYPE_LASER_STATUS
@@ -538,12 +538,18 @@ typedef enum {
/**
* @brief Confidence stream flip enable
*/
OB_PROP_CONFIDENCE_FLIP_BOOL = 230,
OB_PROP_CONFIDENCE_FLIP_BOOL = 230,
/**
* @brief Confidence stream rotate angle{0, 90, 180, 270}
*/
OB_PROP_CONFIDENCE_ROTATE_INT = 231,
OB_PROP_CONFIDENCE_ROTATE_INT = 231,
/**
* @brief Intra-camera Sync Reference based on the exposure start time, the exposure middle time, or the exposure end time. the definition in @ref
* OBIntraCameraSyncReference
*/
OB_PROP_INTRA_CAMERA_SYNC_REFERENCE_INT = 236,
/**
* @brief Baseline calibration parameters
@@ -818,7 +818,7 @@ public:
*/
OBSpatialFastFilterParams getFilterParams() {
OBSpatialFastFilterParams params{};
params.radius = static_cast<uint8_t>(getConfigValue("radius"));
params.radius = static_cast<uint8_t>(getConfigValue("radius"));
return params;
}
@@ -832,7 +832,6 @@ public:
}
};
/**
* @brief The Spatial Moderate Filter utilizes an optimized average smoothing algorithm,
* to achieve a balance between processing speed and the quality of smoothing achieved.
@@ -872,7 +871,7 @@ public:
*/
OBIntPropertyRange getRadiusRange() {
OBIntPropertyRange range{};
const auto & schemaVec = getConfigSchemaVec();
const auto &schemaVec = getConfigSchemaVec();
for(const auto &item: schemaVec) {
if(strcmp(item.name, "radius") == 0) {
range = getPropertyRange<OBIntPropertyRange>(item, getConfigValue("radius"));
@@ -924,7 +923,6 @@ public:
}
};
/**
* @brief Hole filling filter,the processing performed depends on the selected hole filling mode.
*/
@@ -1157,24 +1155,33 @@ public:
};
/**
* @brief Define the Filter type map
* @brief Returns the mapping of filter type names to their corresponding type_index.
*/
static const std::unordered_map<std::string, std::type_index> obFilterTypeMap = {
{ "PointCloudFilter", typeid(PointCloudFilter) }, { "Align", typeid(Align) },
{ "FormatConverter", typeid(FormatConvertFilter) }, { "HDRMerge", typeid(HdrMerge) },
{ "SequenceIdFilter", typeid(SequenceIdFilter) }, { "DecimationFilter", typeid(DecimationFilter) },
{ "ThresholdFilter", typeid(ThresholdFilter) }, { "SpatialAdvancedFilter", typeid(SpatialAdvancedFilter) },
{ "HoleFillingFilter", typeid(HoleFillingFilter) }, { "NoiseRemovalFilter", typeid(NoiseRemovalFilter) },
{ "TemporalFilter", typeid(TemporalFilter) }, { "DisparityTransform", typeid(DisparityTransform) }
};
inline const std::unordered_map<std::string, std::type_index> &getFilterTypeMap() {
static const std::unordered_map<std::string, std::type_index> filterTypeMap = {
{ "PointCloudFilter", typeid(PointCloudFilter) }, { "Align", typeid(Align) },
{ "FormatConverter", typeid(FormatConvertFilter) }, { "HDRMerge", typeid(HdrMerge) },
{ "SequenceIdFilter", typeid(SequenceIdFilter) }, { "DecimationFilter", typeid(DecimationFilter) },
{ "ThresholdFilter", typeid(ThresholdFilter) }, { "SpatialAdvancedFilter", typeid(SpatialAdvancedFilter) },
{ "HoleFillingFilter", typeid(HoleFillingFilter) }, { "NoiseRemovalFilter", typeid(NoiseRemovalFilter) },
{ "TemporalFilter", typeid(TemporalFilter) }, { "DisparityTransform", typeid(DisparityTransform) },
{ "SpatialFastFilter", typeid(SpatialFastFilter) }, { "SpatialModerateFilter", typeid(SpatialModerateFilter) },
};
return filterTypeMap;
}
/**
* @brief Define the is() template function for the Filter class
*
* @note When adding a new filter class, ensure the filter type map
* (see getFilterTypeMap()) is updated accordingly to maintain correct type matching.
*/
template <typename T> bool Filter::is() {
std::string name = type();
auto it = obFilterTypeMap.find(name);
if(it != obFilterTypeMap.end()) {
const auto &filterTypeMap = getFilterTypeMap();
auto it = filterTypeMap.find(name);
if(it != filterTypeMap.end()) {
return std::type_index(typeid(T)) == it->second;
}
return false;