From 118cf0cb9d4d6280aa6bce6e258c47f976fda963 Mon Sep 17 00:00:00 2001 From: SzabolcsGergely Date: Thu, 3 Oct 2024 18:30:11 +0300 Subject: [PATCH 1/8] SpeckleFilter: Add differenceThreshold config --- depthai-core | 2 +- src/pipeline/datatype/StereoDepthConfigBindings.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/depthai-core b/depthai-core index 89e9ee840..15d6a7911 160000 --- a/depthai-core +++ b/depthai-core @@ -1 +1 @@ -Subproject commit 89e9ee840537f0e041fcd5ce49b6a78dd29002d6 +Subproject commit 15d6a7911989dbfdf5165c4c0497c55bbfaa2ece diff --git a/src/pipeline/datatype/StereoDepthConfigBindings.cpp b/src/pipeline/datatype/StereoDepthConfigBindings.cpp index 3e202908a..557f55d24 100644 --- a/src/pipeline/datatype/StereoDepthConfigBindings.cpp +++ b/src/pipeline/datatype/StereoDepthConfigBindings.cpp @@ -137,6 +137,7 @@ void bind_stereodepthconfig(pybind11::module& m, void* pCallstack){ .def(py::init<>()) .def_readwrite("enable", &RawStereoDepthConfig::PostProcessing::SpeckleFilter::enable, DOC(dai, RawStereoDepthConfig, PostProcessing, SpeckleFilter, enable)) .def_readwrite("speckleRange", &RawStereoDepthConfig::PostProcessing::SpeckleFilter::speckleRange, DOC(dai, RawStereoDepthConfig, PostProcessing, SpeckleFilter, speckleRange)) + .def_readwrite("differenceThreshold", &RawStereoDepthConfig::PostProcessing::SpeckleFilter::differenceThreshold, DOC(dai, RawStereoDepthConfig, PostProcessing, SpeckleFilter, differenceThreshold)) ; decimationMode From c3af129731ac6175dcf5fd6fcf0b5bdde0ec2139 Mon Sep 17 00:00:00 2001 From: SzabolcsGergely Date: Fri, 4 Oct 2024 19:38:54 +0300 Subject: [PATCH 2/8] Implement configurable filtering order --- depthai-core | 2 +- src/pipeline/datatype/StereoDepthConfigBindings.cpp | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/depthai-core b/depthai-core index 15d6a7911..76e5cbd15 160000 --- a/depthai-core +++ b/depthai-core @@ -1 +1 @@ -Subproject commit 15d6a7911989dbfdf5165c4c0497c55bbfaa2ece +Subproject commit 76e5cbd15309fbdb259267120e38a93c72a65cb2 diff --git a/src/pipeline/datatype/StereoDepthConfigBindings.cpp b/src/pipeline/datatype/StereoDepthConfigBindings.cpp index 557f55d24..2c07e0bf5 100644 --- a/src/pipeline/datatype/StereoDepthConfigBindings.cpp +++ b/src/pipeline/datatype/StereoDepthConfigBindings.cpp @@ -22,6 +22,7 @@ void bind_stereodepthconfig(pybind11::module& m, void* pCallstack){ py::enum_ depthAlign(algorithmControl, "DepthAlign", DOC(dai, RawStereoDepthConfig, AlgorithmControl, DepthAlign)); py::enum_ depthUnit(algorithmControl, "DepthUnit", DOC(dai, RawStereoDepthConfig, AlgorithmControl, DepthUnit)); py::class_ postProcessing(rawStereoDepthConfig, "PostProcessing", DOC(dai, RawStereoDepthConfig, PostProcessing)); + py::enum_ filter(postProcessing, "Filter", DOC(dai, RawStereoDepthConfig, PostProcessing, Filter)); py::class_ spatialFilter(postProcessing, "SpatialFilter", DOC(dai, RawStereoDepthConfig, PostProcessing, SpatialFilter)); py::class_ temporalFilter(postProcessing, "TemporalFilter", DOC(dai, RawStereoDepthConfig, PostProcessing, TemporalFilter)); py::enum_ persistencyMode(temporalFilter, "PersistencyMode", DOC(dai, RawStereoDepthConfig, PostProcessing, TemporalFilter, PersistencyMode)); @@ -51,7 +52,15 @@ void bind_stereodepthconfig(pybind11::module& m, void* pCallstack){ /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// - // Metadata / raw + filter + .value("DECIMATION", RawStereoDepthConfig::PostProcessing::Filter::DECIMATION, DOC(dai, RawStereoDepthConfig, PostProcessing, Filter, DECIMATION)) + .value("SPECKLE", RawStereoDepthConfig::PostProcessing::Filter::SPECKLE, DOC(dai, RawStereoDepthConfig, PostProcessing, Filter, SPECKLE)) + .value("MEDIAN", RawStereoDepthConfig::PostProcessing::Filter::MEDIAN, DOC(dai, RawStereoDepthConfig, PostProcessing, Filter, MEDIAN)) + .value("TEMPORAL", RawStereoDepthConfig::PostProcessing::Filter::TEMPORAL, DOC(dai, RawStereoDepthConfig, PostProcessing, Filter, TEMPORAL)) + .value("SPATIAL", RawStereoDepthConfig::PostProcessing::Filter::SPATIAL, DOC(dai, RawStereoDepthConfig, PostProcessing, Filter, SPATIAL)) + .value("FILTER_COUNT", RawStereoDepthConfig::PostProcessing::Filter::FILTER_COUNT, DOC(dai, RawStereoDepthConfig, PostProcessing, Filter, FILTER_COUNT)) + ; + medianFilter .value("MEDIAN_OFF", MedianFilter::MEDIAN_OFF) .value("KERNEL_3x3", MedianFilter::KERNEL_3x3) @@ -154,6 +163,7 @@ void bind_stereodepthconfig(pybind11::module& m, void* pCallstack){ postProcessing .def(py::init<>()) + .def_readwrite("filteringOrder", &RawStereoDepthConfig::PostProcessing::filteringOrder, DOC(dai, RawStereoDepthConfig, PostProcessing, filteringOrder)) .def_readwrite("median", &RawStereoDepthConfig::PostProcessing::median, DOC(dai, RawStereoDepthConfig, PostProcessing, median)) .def_readwrite("bilateralSigmaValue", &RawStereoDepthConfig::PostProcessing::bilateralSigmaValue, DOC(dai, RawStereoDepthConfig, PostProcessing, bilateralSigmaValue)) .def_readwrite("spatialFilter", &RawStereoDepthConfig::PostProcessing::spatialFilter, DOC(dai, RawStereoDepthConfig, PostProcessing, spatialFilter)) From 9d437e1837147c0bdb366dd5e0fc87e645362972 Mon Sep 17 00:00:00 2001 From: SzabolcsGergely Date: Wed, 9 Oct 2024 18:00:43 +0300 Subject: [PATCH 3/8] Stereo: Scale disparity to 13 bit range prior to filtering --- depthai-core | 2 +- src/pipeline/datatype/StereoDepthConfigBindings.cpp | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/depthai-core b/depthai-core index 76e5cbd15..7e11d0603 160000 --- a/depthai-core +++ b/depthai-core @@ -1 +1 @@ -Subproject commit 76e5cbd15309fbdb259267120e38a93c72a65cb2 +Subproject commit 7e11d0603c7a716d79426051f5d4740fca579069 diff --git a/src/pipeline/datatype/StereoDepthConfigBindings.cpp b/src/pipeline/datatype/StereoDepthConfigBindings.cpp index 2c07e0bf5..3dd024b40 100644 --- a/src/pipeline/datatype/StereoDepthConfigBindings.cpp +++ b/src/pipeline/datatype/StereoDepthConfigBindings.cpp @@ -55,7 +55,6 @@ void bind_stereodepthconfig(pybind11::module& m, void* pCallstack){ filter .value("DECIMATION", RawStereoDepthConfig::PostProcessing::Filter::DECIMATION, DOC(dai, RawStereoDepthConfig, PostProcessing, Filter, DECIMATION)) .value("SPECKLE", RawStereoDepthConfig::PostProcessing::Filter::SPECKLE, DOC(dai, RawStereoDepthConfig, PostProcessing, Filter, SPECKLE)) - .value("MEDIAN", RawStereoDepthConfig::PostProcessing::Filter::MEDIAN, DOC(dai, RawStereoDepthConfig, PostProcessing, Filter, MEDIAN)) .value("TEMPORAL", RawStereoDepthConfig::PostProcessing::Filter::TEMPORAL, DOC(dai, RawStereoDepthConfig, PostProcessing, Filter, TEMPORAL)) .value("SPATIAL", RawStereoDepthConfig::PostProcessing::Filter::SPATIAL, DOC(dai, RawStereoDepthConfig, PostProcessing, Filter, SPATIAL)) .value("FILTER_COUNT", RawStereoDepthConfig::PostProcessing::Filter::FILTER_COUNT, DOC(dai, RawStereoDepthConfig, PostProcessing, Filter, FILTER_COUNT)) From ef571f1412688562f6b9d10d646be222bf77cff2 Mon Sep 17 00:00:00 2001 From: SzabolcsGergely Date: Fri, 11 Oct 2024 13:37:05 +0300 Subject: [PATCH 4/8] StereoDepth: postprocessing: handle edge case when post-processing filter is enabled, disparity output disabled, median enabled --- depthai-core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depthai-core b/depthai-core index 7e11d0603..bc7c7cc20 160000 --- a/depthai-core +++ b/depthai-core @@ -1 +1 @@ -Subproject commit 7e11d0603c7a716d79426051f5d4740fca579069 +Subproject commit bc7c7cc202e16fb8f1b5f89c45679e657929feb0 From 1f1a1e4e7be59ecbe39d73f4c7dbfc2ba0318510 Mon Sep 17 00:00:00 2001 From: SzabolcsGergely Date: Thu, 17 Oct 2024 15:21:55 +0300 Subject: [PATCH 5/8] StereoDepth: Add back MedianFilter to filtering order --- depthai-core | 2 +- src/pipeline/datatype/StereoDepthConfigBindings.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/depthai-core b/depthai-core index bc7c7cc20..69f7669b4 160000 --- a/depthai-core +++ b/depthai-core @@ -1 +1 @@ -Subproject commit bc7c7cc202e16fb8f1b5f89c45679e657929feb0 +Subproject commit 69f7669b43b1a45777f5e02f203e3ab8e2146d01 diff --git a/src/pipeline/datatype/StereoDepthConfigBindings.cpp b/src/pipeline/datatype/StereoDepthConfigBindings.cpp index 3dd024b40..2c07e0bf5 100644 --- a/src/pipeline/datatype/StereoDepthConfigBindings.cpp +++ b/src/pipeline/datatype/StereoDepthConfigBindings.cpp @@ -55,6 +55,7 @@ void bind_stereodepthconfig(pybind11::module& m, void* pCallstack){ filter .value("DECIMATION", RawStereoDepthConfig::PostProcessing::Filter::DECIMATION, DOC(dai, RawStereoDepthConfig, PostProcessing, Filter, DECIMATION)) .value("SPECKLE", RawStereoDepthConfig::PostProcessing::Filter::SPECKLE, DOC(dai, RawStereoDepthConfig, PostProcessing, Filter, SPECKLE)) + .value("MEDIAN", RawStereoDepthConfig::PostProcessing::Filter::MEDIAN, DOC(dai, RawStereoDepthConfig, PostProcessing, Filter, MEDIAN)) .value("TEMPORAL", RawStereoDepthConfig::PostProcessing::Filter::TEMPORAL, DOC(dai, RawStereoDepthConfig, PostProcessing, Filter, TEMPORAL)) .value("SPATIAL", RawStereoDepthConfig::PostProcessing::Filter::SPATIAL, DOC(dai, RawStereoDepthConfig, PostProcessing, Filter, SPATIAL)) .value("FILTER_COUNT", RawStereoDepthConfig::PostProcessing::Filter::FILTER_COUNT, DOC(dai, RawStereoDepthConfig, PostProcessing, Filter, FILTER_COUNT)) From 53887f7ef959b2b21d132e70c070c7b618a12089 Mon Sep 17 00:00:00 2001 From: SzabolcsGergely Date: Mon, 21 Oct 2024 15:50:41 +0300 Subject: [PATCH 6/8] StereoDepth: add arbitrary filtering order support with scaling --- depthai-core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depthai-core b/depthai-core index 69f7669b4..60d84e720 160000 --- a/depthai-core +++ b/depthai-core @@ -1 +1 @@ -Subproject commit 69f7669b43b1a45777f5e02f203e3ab8e2146d01 +Subproject commit 60d84e7206e765477d09e0bb8d0b0f7d003581dd From fe29bdef6acd41b19548533a733e278987a8bfc5 Mon Sep 17 00:00:00 2001 From: SzabolcsGergely Date: Thu, 7 Nov 2024 11:47:25 +0200 Subject: [PATCH 7/8] Stereo: Core: add new stereo presets --- depthai-core | 2 +- src/pipeline/node/StereoDepthBindings.cpp | 23 +++++++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/depthai-core b/depthai-core index 60d84e720..02f004daa 160000 --- a/depthai-core +++ b/depthai-core @@ -1 +1 @@ -Subproject commit 60d84e7206e765477d09e0bb8d0b0f7d003581dd +Subproject commit 02f004daa70d6b0c5f7a00469b81897f3bb6ccea diff --git a/src/pipeline/node/StereoDepthBindings.cpp b/src/pipeline/node/StereoDepthBindings.cpp index 674a591a7..138c214cf 100644 --- a/src/pipeline/node/StereoDepthBindings.cpp +++ b/src/pipeline/node/StereoDepthBindings.cpp @@ -64,8 +64,27 @@ void bind_stereodepth(pybind11::module& m, void* pCallstack){ ; stereoDepthPresetMode - .value("HIGH_ACCURACY", StereoDepth::PresetMode::HIGH_ACCURACY, DOC(dai, node, StereoDepth, PresetMode, HIGH_ACCURACY)) - .value("HIGH_DENSITY", StereoDepth::PresetMode::HIGH_DENSITY, DOC(dai, node, StereoDepth, PresetMode, HIGH_DENSITY)) + .value("HIGH_ACCURACY", StereoDepth::PresetMode::HIGH_ACCURACY, "**Deprecated:** Will be removed in future releases and replaced with DEFAULT") + .value("HIGH_DENSITY", StereoDepth::PresetMode::HIGH_DENSITY, "**Deprecated:** Will be removed in future releases and replaced with DEFAULT") + + .value("DEFAULT", StereoDepth::PresetMode::DEFAULT) + .value("FACE", StereoDepth::PresetMode::FACE) + .value("HIGH_DETAIL", StereoDepth::PresetMode::HIGH_DETAIL) + .value("HIGH_FPS", StereoDepth::PresetMode::HIGH_FPS) + .value("HIGH_ACCURACY2", StereoDepth::PresetMode::HIGH_ACCURACY2) + .value("ROBOTICS", StereoDepth::PresetMode::ROBOTICS) + + // Deprecated overriden + .def_property_readonly_static("HIGH_ACCURACY", [](py::object){ + PyErr_WarnEx(PyExc_DeprecationWarning, "HIGH_ACCURACY is deprecated, will be removed in future releases and replaced with DEFAULT.", 1); + return StereoDepth::PresetMode::HIGH_ACCURACY; + }) + + .def_property_readonly_static("HIGH_DENSITY", [](py::object){ + PyErr_WarnEx(PyExc_DeprecationWarning, "HIGH_DENSITY is deprecated, will be removed in future releases and replaced with DEFAULT.", 1); + return StereoDepth::PresetMode::HIGH_DENSITY; + }) + ; // Node From 872b74c1019fbdd9292101ddba878b5ed18f013b Mon Sep 17 00:00:00 2001 From: SzabolcsGergely Date: Fri, 8 Nov 2024 15:55:25 +0200 Subject: [PATCH 8/8] Update core to latest develop --- depthai-core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depthai-core b/depthai-core index 02f004daa..b0b4d4918 160000 --- a/depthai-core +++ b/depthai-core @@ -1 +1 @@ -Subproject commit 02f004daa70d6b0c5f7a00469b81897f3bb6ccea +Subproject commit b0b4d4918d1ff68521b1499bc5fa69f84b3c16b6