diff --git a/cmake/Depthai/DepthaiDeviceSideConfig.cmake b/cmake/Depthai/DepthaiDeviceSideConfig.cmake index 776354d24..3cc5ed139 100644 --- a/cmake/Depthai/DepthaiDeviceSideConfig.cmake +++ b/cmake/Depthai/DepthaiDeviceSideConfig.cmake @@ -2,7 +2,7 @@ set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot") # "full commit hash of device side binary" -set(DEPTHAI_DEVICE_SIDE_COMMIT "5a168b72adfbd1bcc7c5e0e0cb8506a18304fcd4") +set(DEPTHAI_DEVICE_SIDE_COMMIT "f5f9f88ada8dc7ac279e44e6a02d37198e333549") # "version if applicable" set(DEPTHAI_DEVICE_SIDE_VERSION "") diff --git a/include/depthai/pipeline/node/StereoDepth.hpp b/include/depthai/pipeline/node/StereoDepth.hpp index 8976e2bdb..b3d45143e 100644 --- a/include/depthai/pipeline/node/StereoDepth.hpp +++ b/include/depthai/pipeline/node/StereoDepth.hpp @@ -23,11 +23,18 @@ class StereoDepth : public NodeCRTP { /** * Prefers accuracy over density. More invalid depth values, but less outliers. */ - HIGH_ACCURACY, + HIGH_ACCURACY [[deprecated("Will be removed in future releases and replaced with DEFAULT")]], /** * Prefers density over accuracy. Less invalid depth values, but more outliers. */ - HIGH_DENSITY + HIGH_DENSITY [[deprecated("Will be removed in future releases and replaced with DEFAULT")]], + + DEFAULT, + FACE, + HIGH_DETAIL, + HIGH_FPS, + HIGH_ACCURACY2, + ROBOTICS }; protected: diff --git a/shared/depthai-shared b/shared/depthai-shared index 5dece0072..be6009abc 160000 --- a/shared/depthai-shared +++ b/shared/depthai-shared @@ -1 +1 @@ -Subproject commit 5dece007271e1d61dfd1078991b7f911caa7c2eb +Subproject commit be6009abc3ea329877fb746532de0b6b4445842e diff --git a/src/pipeline/node/StereoDepth.cpp b/src/pipeline/node/StereoDepth.cpp index fba8d4e60..b25ad0447 100644 --- a/src/pipeline/node/StereoDepth.cpp +++ b/src/pipeline/node/StereoDepth.cpp @@ -216,6 +216,240 @@ void StereoDepth::setDefaultProfilePreset(PresetMode mode) { initialConfig.setLeftRightCheck(true); initialConfig.setLeftRightCheckThreshold(10); } break; + case PresetMode::DEFAULT: { + setDefaultProfilePreset(PresetMode::HIGH_DENSITY); + initialConfig.setLeftRightCheck(true); + initialConfig.setExtendedDisparity(false); + initialConfig.setSubpixel(true); + initialConfig.setSubpixelFractionalBits(3); + initialConfig.setMedianFilter(MedianFilter::KERNEL_7x7); + + dai::RawStereoDepthConfig config = initialConfig.get(); + + config.postProcessing.filteringOrder = {RawStereoDepthConfig::PostProcessing::Filter::DECIMATION, + RawStereoDepthConfig::PostProcessing::Filter::MEDIAN, + RawStereoDepthConfig::PostProcessing::Filter::SPECKLE, + RawStereoDepthConfig::PostProcessing::Filter::SPATIAL, + RawStereoDepthConfig::PostProcessing::Filter::TEMPORAL}; + config.postProcessing.decimationFilter.decimationFactor = 2; + config.postProcessing.decimationFilter.decimationMode = RawStereoDepthConfig::PostProcessing::DecimationFilter::DecimationMode::NON_ZERO_MEAN; + + config.postProcessing.spatialFilter.enable = true; + config.postProcessing.spatialFilter.holeFillingRadius = 1; + config.postProcessing.spatialFilter.numIterations = 2; + config.postProcessing.spatialFilter.alpha = 0.5; + config.postProcessing.spatialFilter.delta = 3; + + config.postProcessing.temporalFilter.enable = true; + config.postProcessing.temporalFilter.alpha = 0.5; + config.postProcessing.temporalFilter.delta = 3; + + config.postProcessing.speckleFilter.enable = true; + config.postProcessing.speckleFilter.speckleRange = 200; + config.postProcessing.speckleFilter.differenceThreshold = 2; + + config.postProcessing.thresholdFilter.minRange = 0; + config.postProcessing.thresholdFilter.maxRange = 15000; + + initialConfig.set(config); + + setPostProcessingHardwareResources(3, 3); + } break; + case PresetMode::FACE: { + setDefaultProfilePreset(PresetMode::HIGH_DENSITY); + initialConfig.setLeftRightCheck(true); + initialConfig.setExtendedDisparity(true); + initialConfig.setSubpixel(true); + initialConfig.setSubpixelFractionalBits(5); + initialConfig.setMedianFilter(MedianFilter::MEDIAN_OFF); + + dai::RawStereoDepthConfig config = initialConfig.get(); + + config.postProcessing.filteringOrder = {RawStereoDepthConfig::PostProcessing::Filter::DECIMATION, + RawStereoDepthConfig::PostProcessing::Filter::MEDIAN, + RawStereoDepthConfig::PostProcessing::Filter::SPECKLE, + RawStereoDepthConfig::PostProcessing::Filter::SPATIAL, + RawStereoDepthConfig::PostProcessing::Filter::TEMPORAL}; + config.postProcessing.decimationFilter.decimationFactor = 2; + config.postProcessing.decimationFilter.decimationMode = RawStereoDepthConfig::PostProcessing::DecimationFilter::DecimationMode::NON_ZERO_MEAN; + + config.postProcessing.spatialFilter.enable = true; + config.postProcessing.spatialFilter.holeFillingRadius = 1; + config.postProcessing.spatialFilter.numIterations = 1; + config.postProcessing.spatialFilter.alpha = 0.5; + config.postProcessing.spatialFilter.delta = 3; + + config.postProcessing.temporalFilter.enable = true; + config.postProcessing.temporalFilter.alpha = 0.5; + config.postProcessing.temporalFilter.delta = 3; + + config.postProcessing.speckleFilter.enable = true; + config.postProcessing.speckleFilter.speckleRange = 200; + config.postProcessing.speckleFilter.differenceThreshold = 2; + + config.postProcessing.thresholdFilter.minRange = 30; + config.postProcessing.thresholdFilter.maxRange = 3000; + + initialConfig.set(config); + + setPostProcessingHardwareResources(3, 3); + } break; + case PresetMode::HIGH_DETAIL: { + setDefaultProfilePreset(PresetMode::HIGH_ACCURACY); + initialConfig.setLeftRightCheck(true); + initialConfig.setExtendedDisparity(true); + initialConfig.setSubpixel(true); + initialConfig.setSubpixelFractionalBits(5); + initialConfig.setMedianFilter(MedianFilter::MEDIAN_OFF); + + dai::RawStereoDepthConfig config = initialConfig.get(); + + config.postProcessing.filteringOrder = {RawStereoDepthConfig::PostProcessing::Filter::DECIMATION, + RawStereoDepthConfig::PostProcessing::Filter::MEDIAN, + RawStereoDepthConfig::PostProcessing::Filter::SPECKLE, + RawStereoDepthConfig::PostProcessing::Filter::SPATIAL, + RawStereoDepthConfig::PostProcessing::Filter::TEMPORAL}; + config.postProcessing.decimationFilter.decimationFactor = 1; + config.postProcessing.decimationFilter.decimationMode = RawStereoDepthConfig::PostProcessing::DecimationFilter::DecimationMode::NON_ZERO_MEAN; + + config.postProcessing.spatialFilter.enable = true; + config.postProcessing.spatialFilter.holeFillingRadius = 1; + config.postProcessing.spatialFilter.numIterations = 3; + config.postProcessing.spatialFilter.alpha = 0.7; + config.postProcessing.spatialFilter.delta = 3; + + config.postProcessing.temporalFilter.enable = true; + config.postProcessing.temporalFilter.alpha = 0.5; + config.postProcessing.temporalFilter.delta = 3; + + config.postProcessing.speckleFilter.enable = true; + config.postProcessing.speckleFilter.speckleRange = 200; + config.postProcessing.speckleFilter.differenceThreshold = 2; + + config.postProcessing.thresholdFilter.minRange = 0; + config.postProcessing.thresholdFilter.maxRange = 15000; + + initialConfig.set(config); + + setPostProcessingHardwareResources(3, 3); + } break; + case PresetMode::HIGH_FPS: { + setDefaultProfilePreset(PresetMode::HIGH_DENSITY); + initialConfig.setLeftRightCheck(true); + initialConfig.setExtendedDisparity(false); + initialConfig.setSubpixel(true); + initialConfig.setSubpixelFractionalBits(3); + initialConfig.setMedianFilter(MedianFilter::KERNEL_3x3); + + dai::RawStereoDepthConfig config = initialConfig.get(); + + config.postProcessing.filteringOrder = {RawStereoDepthConfig::PostProcessing::Filter::DECIMATION, + RawStereoDepthConfig::PostProcessing::Filter::MEDIAN, + RawStereoDepthConfig::PostProcessing::Filter::SPECKLE, + RawStereoDepthConfig::PostProcessing::Filter::SPATIAL, + RawStereoDepthConfig::PostProcessing::Filter::TEMPORAL}; + config.postProcessing.decimationFilter.decimationFactor = 2; + config.postProcessing.decimationFilter.decimationMode = RawStereoDepthConfig::PostProcessing::DecimationFilter::DecimationMode::NON_ZERO_MEAN; + + config.postProcessing.spatialFilter.enable = true; + config.postProcessing.spatialFilter.holeFillingRadius = 1; + config.postProcessing.spatialFilter.numIterations = 2; + config.postProcessing.spatialFilter.alpha = 0.5; + config.postProcessing.spatialFilter.delta = 3; + + config.postProcessing.temporalFilter.enable = false; + config.postProcessing.temporalFilter.alpha = 0.5; + config.postProcessing.temporalFilter.delta = 3; + + config.postProcessing.speckleFilter.enable = true; + config.postProcessing.speckleFilter.speckleRange = 50; + config.postProcessing.speckleFilter.differenceThreshold = 2; + + config.postProcessing.thresholdFilter.minRange = 0; + config.postProcessing.thresholdFilter.maxRange = 15000; + + initialConfig.set(config); + + setPostProcessingHardwareResources(3, 3); + } break; + case PresetMode::HIGH_ACCURACY2: { + setDefaultProfilePreset(PresetMode::HIGH_ACCURACY); + initialConfig.setLeftRightCheck(true); + initialConfig.setExtendedDisparity(true); + initialConfig.setSubpixel(true); + initialConfig.setSubpixelFractionalBits(5); + initialConfig.setMedianFilter(MedianFilter::MEDIAN_OFF); + + dai::RawStereoDepthConfig config = initialConfig.get(); + + config.postProcessing.filteringOrder = {RawStereoDepthConfig::PostProcessing::Filter::DECIMATION, + RawStereoDepthConfig::PostProcessing::Filter::MEDIAN, + RawStereoDepthConfig::PostProcessing::Filter::SPECKLE, + RawStereoDepthConfig::PostProcessing::Filter::SPATIAL, + RawStereoDepthConfig::PostProcessing::Filter::TEMPORAL}; + config.postProcessing.decimationFilter.decimationFactor = 2; + config.postProcessing.decimationFilter.decimationMode = RawStereoDepthConfig::PostProcessing::DecimationFilter::DecimationMode::NON_ZERO_MEAN; + + config.postProcessing.spatialFilter.enable = true; + config.postProcessing.spatialFilter.holeFillingRadius = 1; + config.postProcessing.spatialFilter.numIterations = 3; + config.postProcessing.spatialFilter.alpha = 0.5; + config.postProcessing.spatialFilter.delta = 3; + + config.postProcessing.temporalFilter.enable = true; + config.postProcessing.temporalFilter.alpha = 0.5; + config.postProcessing.temporalFilter.delta = 3; + + config.postProcessing.speckleFilter.enable = true; + config.postProcessing.speckleFilter.speckleRange = 200; + config.postProcessing.speckleFilter.differenceThreshold = 2; + + config.postProcessing.thresholdFilter.minRange = 0; + config.postProcessing.thresholdFilter.maxRange = 15000; + + initialConfig.set(config); + + setPostProcessingHardwareResources(3, 3); + } break; + case PresetMode::ROBOTICS: { + setDefaultProfilePreset(PresetMode::HIGH_DENSITY); + initialConfig.setLeftRightCheck(true); + initialConfig.setExtendedDisparity(false); + initialConfig.setSubpixel(true); + initialConfig.setSubpixelFractionalBits(3); + initialConfig.setMedianFilter(MedianFilter::KERNEL_7x7); + + dai::RawStereoDepthConfig config = initialConfig.get(); + + config.postProcessing.filteringOrder = {RawStereoDepthConfig::PostProcessing::Filter::DECIMATION, + RawStereoDepthConfig::PostProcessing::Filter::MEDIAN, + RawStereoDepthConfig::PostProcessing::Filter::SPECKLE, + RawStereoDepthConfig::PostProcessing::Filter::SPATIAL, + RawStereoDepthConfig::PostProcessing::Filter::TEMPORAL}; + config.postProcessing.decimationFilter.decimationFactor = 2; + config.postProcessing.decimationFilter.decimationMode = RawStereoDepthConfig::PostProcessing::DecimationFilter::DecimationMode::NON_ZERO_MEAN; + + config.postProcessing.spatialFilter.enable = true; + config.postProcessing.spatialFilter.holeFillingRadius = 2; + config.postProcessing.spatialFilter.numIterations = 1; + config.postProcessing.spatialFilter.alpha = 0.5; + config.postProcessing.spatialFilter.delta = 20; + + config.postProcessing.temporalFilter.enable = false; + config.postProcessing.temporalFilter.alpha = 0.5; + config.postProcessing.temporalFilter.delta = 3; + + config.postProcessing.speckleFilter.enable = true; + config.postProcessing.speckleFilter.speckleRange = 200; + config.postProcessing.speckleFilter.differenceThreshold = 2; + + config.postProcessing.thresholdFilter.minRange = 0; + config.postProcessing.thresholdFilter.maxRange = 10000; + + initialConfig.set(config); + + setPostProcessingHardwareResources(3, 3); + } break; } }