Skip to content

Commit

Permalink
Update stereo profile presets
Browse files Browse the repository at this point in the history
  • Loading branch information
SzabolcsGergely committed Nov 18, 2024
1 parent 9994eb3 commit b3a778f
Showing 1 changed file with 8 additions and 47 deletions.
55 changes: 8 additions & 47 deletions src/pipeline/node/StereoDepth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,11 @@ void StereoDepth::setDefaultProfilePreset(PresetMode mode) {
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.decimationFilter.decimationMode = RawStereoDepthConfig::PostProcessing::DecimationFilter::DecimationMode::PIXEL_SKIPPING;

config.postProcessing.spatialFilter.enable = true;
config.postProcessing.spatialFilter.holeFillingRadius = 1;
config.postProcessing.spatialFilter.numIterations = 2;
config.postProcessing.spatialFilter.numIterations = 1;
config.postProcessing.spatialFilter.alpha = 0.5;
config.postProcessing.spatialFilter.delta = 3;

Expand Down Expand Up @@ -271,7 +271,7 @@ void StereoDepth::setDefaultProfilePreset(PresetMode mode) {
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.decimationFilter.decimationMode = RawStereoDepthConfig::PostProcessing::DecimationFilter::DecimationMode::PIXEL_SKIPPING;

config.postProcessing.spatialFilter.enable = true;
config.postProcessing.spatialFilter.holeFillingRadius = 1;
Expand Down Expand Up @@ -310,11 +310,11 @@ void StereoDepth::setDefaultProfilePreset(PresetMode mode) {
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.decimationFilter.decimationMode = RawStereoDepthConfig::PostProcessing::DecimationFilter::DecimationMode::PIXEL_SKIPPING;

config.postProcessing.spatialFilter.enable = true;
config.postProcessing.spatialFilter.holeFillingRadius = 1;
config.postProcessing.spatialFilter.numIterations = 3;
config.postProcessing.spatialFilter.numIterations = 1;
config.postProcessing.spatialFilter.alpha = 0.7;
config.postProcessing.spatialFilter.delta = 3;

Expand All @@ -333,45 +333,6 @@ void StereoDepth::setDefaultProfilePreset(PresetMode mode) {

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);
Expand All @@ -388,11 +349,11 @@ void StereoDepth::setDefaultProfilePreset(PresetMode mode) {
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.decimationFilter.decimationMode = RawStereoDepthConfig::PostProcessing::DecimationFilter::DecimationMode::PIXEL_SKIPPING;

config.postProcessing.spatialFilter.enable = true;
config.postProcessing.spatialFilter.holeFillingRadius = 1;
config.postProcessing.spatialFilter.numIterations = 3;
config.postProcessing.spatialFilter.numIterations = 1;
config.postProcessing.spatialFilter.alpha = 0.5;
config.postProcessing.spatialFilter.delta = 3;

Expand Down Expand Up @@ -427,7 +388,7 @@ void StereoDepth::setDefaultProfilePreset(PresetMode mode) {
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.decimationFilter.decimationMode = RawStereoDepthConfig::PostProcessing::DecimationFilter::DecimationMode::PIXEL_SKIPPING;

config.postProcessing.spatialFilter.enable = true;
config.postProcessing.spatialFilter.holeFillingRadius = 2;
Expand Down

0 comments on commit b3a778f

Please sign in to comment.