diff --git a/include/depthai-shared/datatype/RawSpatialLocationCalculatorConfig.hpp b/include/depthai-shared/datatype/RawSpatialLocationCalculatorConfig.hpp index b087f70c..10786518 100644 --- a/include/depthai-shared/datatype/RawSpatialLocationCalculatorConfig.hpp +++ b/include/depthai-shared/datatype/RawSpatialLocationCalculatorConfig.hpp @@ -13,7 +13,7 @@ namespace dai { /** * SpatialLocation configuration thresholds structure * - * Contains configuration data for lower and upper threshold in millimeters for ROI. + * Contains configuration data for lower and upper threshold in depth units (millimeter by default) for ROI. * Values outside of threshold range will be ignored when calculating spatial coordinates from depth map. */ struct SpatialLocationCalculatorConfigThresholds { diff --git a/include/depthai-shared/datatype/RawSpatialLocations.hpp b/include/depthai-shared/datatype/RawSpatialLocations.hpp index 4b6db698..fb376d13 100644 --- a/include/depthai-shared/datatype/RawSpatialLocations.hpp +++ b/include/depthai-shared/datatype/RawSpatialLocations.hpp @@ -16,7 +16,7 @@ namespace dai { * * Contains configuration data, average depth for the calculated ROI on depth map. * Together with spatial coordinates: x,y,z relative to the center of depth map. - * Units are in millimeters. + * Units are in depth units (millimeter by default). */ struct SpatialLocations { /** diff --git a/include/depthai-shared/datatype/RawStereoDepthConfig.hpp b/include/depthai-shared/datatype/RawStereoDepthConfig.hpp index 1d7eafbe..498b270f 100644 --- a/include/depthai-shared/datatype/RawStereoDepthConfig.hpp +++ b/include/depthai-shared/datatype/RawStereoDepthConfig.hpp @@ -24,11 +24,28 @@ struct RawStereoDepthConfig : public RawBuffer { */ enum class DepthAlign : int32_t { RECTIFIED_RIGHT, RECTIFIED_LEFT, CENTER }; + /** + * Measurement unit for depth data + */ + enum class DepthUnit : int32_t { METER, CENTIMETER, MILLIMETER, INCH, FOOT, CUSTOM }; + /** * Set the disparity/depth alignment to the perspective of a rectified output, or center it */ DepthAlign depthAlign = DepthAlign::RECTIFIED_RIGHT; + /** + * Measurement unit for depth data. + * Depth data is integer value, multiple of depth unit. + */ + DepthUnit depthUnit = DepthUnit::MILLIMETER; + + /** + * Custom depth unit multiplier, if custom depth unit is enabled, relative to 1 meter. + * A multiplier of 1000 effectively means depth unit in millimeter. + */ + float customDepthUnitMultiplier = 1000.f; + /** * Computes and combines disparities in both L-R and R-L directions, and combine them. * For better occlusion handling @@ -64,7 +81,15 @@ struct RawStereoDepthConfig : public RawBuffer { */ std::int32_t subpixelFractionalBits = 3; - DEPTHAI_SERIALIZE(AlgorithmControl, depthAlign, enableLeftRightCheck, enableExtended, enableSubpixel, leftRightCheckThreshold, subpixelFractionalBits); + DEPTHAI_SERIALIZE(AlgorithmControl, + depthAlign, + depthUnit, + customDepthUnitMultiplier, + enableLeftRightCheck, + enableExtended, + enableSubpixel, + leftRightCheckThreshold, + subpixelFractionalBits); }; /** @@ -135,7 +160,6 @@ struct RawStereoDepthConfig : public RawBuffer { /** * Temporal filtering with optional persistence. - * More details about the filter can be found here: */ struct TemporalFilter { static constexpr const std::int32_t DEFAULT_DELTA_VALUE = 3; @@ -186,7 +210,6 @@ struct RawStereoDepthConfig : public RawBuffer { /** * Temporal filtering with optional persistence. - * More details about the filter can be found here: */ TemporalFilter temporalFilter; @@ -196,12 +219,12 @@ struct RawStereoDepthConfig : public RawBuffer { */ struct ThresholdFilter { /** - * Minimum range in millimeters. + * Minimum range in depth units. * Depth values under this value are invalidated. */ std::int32_t minRange = 0; /** - * Maximum range in millimeters. + * Maximum range in depth units. * Depth values over this value are invalidated. */ std::int32_t maxRange = 65535;