From 41feacdc29f069fe77a41fda45b641bf12c28925 Mon Sep 17 00:00:00 2001 From: alex-luxonis Date: Fri, 5 May 2023 00:44:45 +0300 Subject: [PATCH 01/34] CameraControl: add API to set/handle miscellaneous controls --- .../pipeline/datatype/CameraControl.hpp | 35 +++++++++++++++++++ shared/depthai-shared | 2 +- src/pipeline/datatype/CameraControl.cpp | 17 +++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/include/depthai/pipeline/datatype/CameraControl.hpp b/include/depthai/pipeline/datatype/CameraControl.hpp index c9606f817..78e471b44 100644 --- a/include/depthai/pipeline/datatype/CameraControl.hpp +++ b/include/depthai/pipeline/datatype/CameraControl.hpp @@ -254,6 +254,41 @@ class CameraControl : public Buffer { */ CameraControl& setEffectMode(EffectMode mode); + /** + * Set a miscellaneous control. The controls set by this function get appended + * to a list, processed after the standard controls + * @param control Control name + * @param value Value as a string + */ + CameraControl& setMisc(std::string control, std::string value); + + /** + * Set a miscellaneous control. The controls set by this function get appended + * to a list, processed after the standard controls + * @param control Control name + * @param value Value as an integer number + */ + CameraControl& setMisc(std::string control, int value); + + /** + * Set a miscellaneous control. The controls set by this function get appended + * to a list, processed after the standard controls + * @param control Control name + * @param value Value as a floating point number + */ + CameraControl& setMisc(std::string control, float value); + + /** + * Clear the list of miscellaneous controls set by `setControl` + */ + void clearMiscControls(); + + /** + * Get the list of miscellaneous controls set by `setControl` + * @returns A list of pairs as strings + */ + std::vector> getMiscControls(); + // Functions to retrieve properties /** * Check whether command to capture a still is set diff --git a/shared/depthai-shared b/shared/depthai-shared index 089f8a378..f55339b32 160000 --- a/shared/depthai-shared +++ b/shared/depthai-shared @@ -1 +1 @@ -Subproject commit 089f8a3782298760c9d3726acb5c489fc76672d9 +Subproject commit f55339b3248e0e3e25cd8473618ae90cffe61cb7 diff --git a/src/pipeline/datatype/CameraControl.cpp b/src/pipeline/datatype/CameraControl.cpp index 8ec645a4f..67e11d466 100644 --- a/src/pipeline/datatype/CameraControl.cpp +++ b/src/pipeline/datatype/CameraControl.cpp @@ -191,6 +191,23 @@ CameraControl& CameraControl::setEffectMode(EffectMode mode) { return *this; } +CameraControl& CameraControl::setMisc(std::string control, std::string value) { + cfg.miscControls.push_back(std::make_pair(control, value)); + return *this; +} +CameraControl& CameraControl::setMisc(std::string control, int value) { + return setMisc(control, std::to_string(value)); +} +CameraControl& CameraControl::setMisc(std::string control, float value) { + return setMisc(control, std::to_string(value)); +} +void CameraControl::clearMiscControls() { + cfg.miscControls.clear(); +} +std::vector> CameraControl::getMiscControls() { + return cfg.miscControls; +} + bool CameraControl::getCaptureStill() const { return cfg.getCommand(RawCameraControl::Command::STILL_CAPTURE); } From 3a202c711c836344dc2e623d781660cc5ea08788 Mon Sep 17 00:00:00 2001 From: alex-luxonis Date: Fri, 12 May 2023 04:35:07 +0300 Subject: [PATCH 02/34] FW: IMX378/IMX582 manual ISO up to 3200, handle miscellaneous controls: .initialControl.setMisc("downsampling-mode", "binning") # default: "scaling" .initialControl.setMisc("binning-mode", "sum") # default: "avg" Max FPS for IMX378 1080p back to 118 (from 60) with binning enabled --- cmake/Depthai/DepthaiDeviceSideConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Depthai/DepthaiDeviceSideConfig.cmake b/cmake/Depthai/DepthaiDeviceSideConfig.cmake index 6ff7ccdf0..1d96235f3 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 "a30f307db9c7879e660037697e18bf6c90456847") +set(DEPTHAI_DEVICE_SIDE_COMMIT "d6d87845b7705581f934f645a3cd587ed8e1f794") # "version if applicable" set(DEPTHAI_DEVICE_SIDE_VERSION "") From 7dfa8ea2c52994ee32b3867ea4210efc09991450 Mon Sep 17 00:00:00 2001 From: alex-luxonis Date: Fri, 12 May 2023 05:15:54 +0300 Subject: [PATCH 03/34] FW: IMX378/IMX582 manual ISO up to 35000, higher than 3200 only with misc control: .initialControl.setMisc("manual-exposure-handling", "fast") --- cmake/Depthai/DepthaiDeviceSideConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Depthai/DepthaiDeviceSideConfig.cmake b/cmake/Depthai/DepthaiDeviceSideConfig.cmake index 1d96235f3..935841519 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 "d6d87845b7705581f934f645a3cd587ed8e1f794") +set(DEPTHAI_DEVICE_SIDE_COMMIT "0ff8a1fe6601ec41218ede6a892975147b369cc1") # "version if applicable" set(DEPTHAI_DEVICE_SIDE_VERSION "") From f02126fd6075cd8210fe009081f1034532cfa7ab Mon Sep 17 00:00:00 2001 From: alex-luxonis Date: Sat, 27 May 2023 16:52:55 +0300 Subject: [PATCH 04/34] FW: IMX586 on-sensor HDR, with new misc controls: .initialControl.setMisc("hdr-exposure-ratio", 4) # enables HDR when set `> 1`, current options: 2, 4, 8 .initialControl.setMisc("hdr-local-tone-weight", 75) # default 75, range 0..100 --- cmake/Depthai/DepthaiDeviceSideConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Depthai/DepthaiDeviceSideConfig.cmake b/cmake/Depthai/DepthaiDeviceSideConfig.cmake index 935841519..e82c36e18 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 "0ff8a1fe6601ec41218ede6a892975147b369cc1") +set(DEPTHAI_DEVICE_SIDE_COMMIT "cf38dd36af81bd02474a647966e439a292943969") # "version if applicable" set(DEPTHAI_DEVICE_SIDE_VERSION "") From 378a690d430f98210ddcc6eb2c4f4f110c4ec850 Mon Sep 17 00:00:00 2001 From: alex-luxonis Date: Fri, 2 Feb 2024 15:37:32 +0200 Subject: [PATCH 05/34] FW: initial IMX678 support (4K). TMP IMX462 enable HCG (high conversion gain) --- cmake/Depthai/DepthaiDeviceSideConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Depthai/DepthaiDeviceSideConfig.cmake b/cmake/Depthai/DepthaiDeviceSideConfig.cmake index abc1a8ea6..cf7031856 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 "f089593893c1b1ccb29c99ccdc9a0e723db57a3b") +set(DEPTHAI_DEVICE_SIDE_COMMIT "957b5ec282571370ad2701dfc9c0225292c3afd8") # "version if applicable" set(DEPTHAI_DEVICE_SIDE_VERSION "") From 2595d569055f514153aa38deea3e09b2b47d951c Mon Sep 17 00:00:00 2001 From: alex-luxonis Date: Wed, 7 Feb 2024 09:32:21 +0200 Subject: [PATCH 06/34] "high-conversion-gain" camera misc control for IMX462 and IMX678, enabled by default. Values: 0, 1, can also change during streaming --- cmake/Depthai/DepthaiDeviceSideConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Depthai/DepthaiDeviceSideConfig.cmake b/cmake/Depthai/DepthaiDeviceSideConfig.cmake index dbf3213a2..635563070 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 "75f859b01cf8a62b61c21ea36d4f13baa80e4bff") +set(DEPTHAI_DEVICE_SIDE_COMMIT "66e35b2bde14b638ef39a140848aec7a5422c7fe") # "version if applicable" set(DEPTHAI_DEVICE_SIDE_VERSION "") From 198c6bc26c8e77acb247065646cb7ba370f41733 Mon Sep 17 00:00:00 2001 From: alex-luxonis Date: Thu, 8 Feb 2024 13:08:20 +0200 Subject: [PATCH 07/34] FW: initial support for IMX715, 4lane, 4K, max FPS 9.7 for now --- cmake/Depthai/DepthaiDeviceSideConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Depthai/DepthaiDeviceSideConfig.cmake b/cmake/Depthai/DepthaiDeviceSideConfig.cmake index 635563070..8afda0b63 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 "66e35b2bde14b638ef39a140848aec7a5422c7fe") +set(DEPTHAI_DEVICE_SIDE_COMMIT "98ba7fd36749051e345bc25cb8369af61c2dd7a4") # "version if applicable" set(DEPTHAI_DEVICE_SIDE_VERSION "") From ffd129f6ea889ca3408d47489fa4aa78619ccc6a Mon Sep 17 00:00:00 2001 From: alex-luxonis Date: Fri, 9 Feb 2024 20:13:42 +0200 Subject: [PATCH 08/34] FW: IMX678 binning option (1080p, 60fps), IMX582 HDR: - better config for 10fps HDR - runtime configurable hdr-exposure-ratio (1,2,4,8), hdr-local-tone-weight (0..1, float normalized) --- cmake/Depthai/DepthaiDeviceSideConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Depthai/DepthaiDeviceSideConfig.cmake b/cmake/Depthai/DepthaiDeviceSideConfig.cmake index 8afda0b63..4568f4516 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 "98ba7fd36749051e345bc25cb8369af61c2dd7a4") +set(DEPTHAI_DEVICE_SIDE_COMMIT "0597fa75efa780190b9f1bf08f806e0ef907ccfd") # "version if applicable" set(DEPTHAI_DEVICE_SIDE_VERSION "") From cbbe8661a9df2941946192f56a1bbcb03c984239 Mon Sep 17 00:00:00 2001 From: SzabolcsGergely Date: Fri, 10 May 2024 19:53:03 +0300 Subject: [PATCH 09/34] Add runtime stereo calib reconfig --- cmake/Depthai/DepthaiDeviceSideConfig.cmake | 2 +- include/depthai/device/DeviceBase.hpp | 8 ++++++++ src/device/DeviceBase.cpp | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/cmake/Depthai/DepthaiDeviceSideConfig.cmake b/cmake/Depthai/DepthaiDeviceSideConfig.cmake index 8375def30..c0d115d87 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 "c7127782f2da45aac89d5b5b816d04cc45ae40be") +set(DEPTHAI_DEVICE_SIDE_COMMIT "c7b04677eeb88b38f636d21f17f0f1e35d8d5acb") # "version if applicable" set(DEPTHAI_DEVICE_SIDE_VERSION "") diff --git a/include/depthai/device/DeviceBase.hpp b/include/depthai/device/DeviceBase.hpp index 380812be2..e5bce11ee 100644 --- a/include/depthai/device/DeviceBase.hpp +++ b/include/depthai/device/DeviceBase.hpp @@ -747,6 +747,14 @@ class DeviceBase { */ void flashCalibration2(CalibrationHandler calibrationDataHandler); + /** + * Sets the Calibration at runtime. This is not persistent and will be lost after device reset. + * + * @param calibrationObj CalibrationHandler object which is loaded with calibration information. + * + */ + void setCalibration(CalibrationHandler calibrationDataHandler); + /** * Fetches the EEPROM data from the device and loads it into CalibrationHandler object * If no calibration is flashed, it returns default diff --git a/src/device/DeviceBase.cpp b/src/device/DeviceBase.cpp index 6f6dfb487..29705315f 100644 --- a/src/device/DeviceBase.cpp +++ b/src/device/DeviceBase.cpp @@ -1359,6 +1359,10 @@ void DeviceBase::flashCalibration2(CalibrationHandler calibrationDataHandler) { } } +void DeviceBase::setCalibration(CalibrationHandler calibrationDataHandler) { + pimpl->rpcClient->call("setCalibration", calibrationDataHandler.getEepromData()); +} + CalibrationHandler DeviceBase::readCalibration() { dai::EepromData eepromData{}; try { From 79ec49be42ab2580f8ab3a16f35c3cad3303e4f2 Mon Sep 17 00:00:00 2001 From: SzabolcsGergely Date: Tue, 4 Jun 2024 12:50:20 +0300 Subject: [PATCH 10/34] Remove tailing ; --- src/device/DeviceBase.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/device/DeviceBase.cpp b/src/device/DeviceBase.cpp index 9c3ba3e08..74de19df2 100644 --- a/src/device/DeviceBase.cpp +++ b/src/device/DeviceBase.cpp @@ -1352,7 +1352,6 @@ void DeviceBase::setCalibration(CalibrationHandler calibrationDataHandler) { bool success; std::string errorMsg; std::tie(success, errorMsg) = pimpl->rpcClient->call("setCalibration", calibrationDataHandler.getEepromData()).as>(); - ; if(!success) { throw std::runtime_error(errorMsg); } From dc03563e1d3de072390bdf30a127a99be99f3f6f Mon Sep 17 00:00:00 2001 From: alex-luxonis Date: Tue, 20 Aug 2024 02:00:50 +0300 Subject: [PATCH 11/34] FW: AR0234 tuning increase max exposure: 33 -> 890 ms --- cmake/Depthai/DepthaiDeviceSideConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Depthai/DepthaiDeviceSideConfig.cmake b/cmake/Depthai/DepthaiDeviceSideConfig.cmake index a493b37d6..21198c818 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 "9ed7c9ae4c232ff93a3500a585a6b1c00650e22c") +set(DEPTHAI_DEVICE_SIDE_COMMIT "2c85c946a036ee2caa6c1219917201ab7a1dcdd3") # "version if applicable" set(DEPTHAI_DEVICE_SIDE_VERSION "") From c17a80e3102aae7896d58e3a47aec7a38eef15ab Mon Sep 17 00:00:00 2001 From: alex-luxonis Date: Thu, 22 Aug 2024 04:03:05 +0300 Subject: [PATCH 12/34] FW: fix ToF EEPROM reading for certain FFC camera permutations --- cmake/Depthai/DepthaiDeviceSideConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Depthai/DepthaiDeviceSideConfig.cmake b/cmake/Depthai/DepthaiDeviceSideConfig.cmake index 21198c818..4d7be1819 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 "2c85c946a036ee2caa6c1219917201ab7a1dcdd3") +set(DEPTHAI_DEVICE_SIDE_COMMIT "cee0e0be66ae6b1cce48fcbb75a83676aea5c5fc") # "version if applicable" set(DEPTHAI_DEVICE_SIDE_VERSION "") From 73a77d44abe99e67585408e29d79a241d2dd213b Mon Sep 17 00:00:00 2001 From: alex-luxonis Date: Mon, 26 Aug 2024 14:55:14 +0300 Subject: [PATCH 13/34] FW: update after merge, add "3a-follow" misc control: ``` cam["cama"].initialControl.setMisc("3a-follow", dai.CameraBoardSocket.CAM_A) cam["camb"].initialControl.setMisc("3a-follow", dai.CameraBoardSocket.CAM_B) ``` generic fast manual exposure (for all sensors) --- cmake/Depthai/DepthaiDeviceSideConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Depthai/DepthaiDeviceSideConfig.cmake b/cmake/Depthai/DepthaiDeviceSideConfig.cmake index 4d7be1819..ca1a0ba7b 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 "cee0e0be66ae6b1cce48fcbb75a83676aea5c5fc") +set(DEPTHAI_DEVICE_SIDE_COMMIT "01b465eceaef943349270c59fbc1633ba9b95024") # "version if applicable" set(DEPTHAI_DEVICE_SIDE_VERSION "") From 04564dfa8bfe470e500482472962489c1685bf7c Mon Sep 17 00:00:00 2001 From: alex-luxonis Date: Mon, 23 Sep 2024 15:42:37 +0300 Subject: [PATCH 14/34] FW: update after merge. Also fix colors for IMX378 THE_1352X1012 with rotation --- cmake/Depthai/DepthaiDeviceSideConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Depthai/DepthaiDeviceSideConfig.cmake b/cmake/Depthai/DepthaiDeviceSideConfig.cmake index ca1a0ba7b..62fcd606c 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 "01b465eceaef943349270c59fbc1633ba9b95024") +set(DEPTHAI_DEVICE_SIDE_COMMIT "762b13707068b5279c822a245602d43778442153") # "version if applicable" set(DEPTHAI_DEVICE_SIDE_VERSION "") From 727981605e92bdb62f5780259c98475ba333d36c Mon Sep 17 00:00:00 2001 From: SzabolcsGergely Date: Wed, 25 Sep 2024 15:23:39 +0300 Subject: [PATCH 15/34] CrashDump: disable on shutdown --- cmake/Depthai/DepthaiDeviceSideConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Depthai/DepthaiDeviceSideConfig.cmake b/cmake/Depthai/DepthaiDeviceSideConfig.cmake index 62fcd606c..b30c1401c 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 "762b13707068b5279c822a245602d43778442153") +set(DEPTHAI_DEVICE_SIDE_COMMIT "ad289e1220d3f007efc52187082722db77e9ab20") # "version if applicable" set(DEPTHAI_DEVICE_SIDE_VERSION "") From 2e824de00f76478034f797877ef4bf344f8809e9 Mon Sep 17 00:00:00 2001 From: alex-luxonis Date: Thu, 26 Sep 2024 01:08:08 +0300 Subject: [PATCH 16/34] FW: misc controls for multi-ToF staggering: frame-sync-id, frame-sync-delay-us --- cmake/Depthai/DepthaiDeviceSideConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Depthai/DepthaiDeviceSideConfig.cmake b/cmake/Depthai/DepthaiDeviceSideConfig.cmake index b30c1401c..4d7cea812 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 "ad289e1220d3f007efc52187082722db77e9ab20") +set(DEPTHAI_DEVICE_SIDE_COMMIT "0adb9bf58e0b3c80f8669e71d2840ecc7852e3dd") # "version if applicable" set(DEPTHAI_DEVICE_SIDE_VERSION "") From 89e9ee840537f0e041fcd5ce49b6a78dd29002d6 Mon Sep 17 00:00:00 2001 From: Matevz Morato Date: Mon, 30 Sep 2024 12:30:02 +0200 Subject: [PATCH 17/34] Format --- include/depthai/common/CameraFeatures.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/depthai/common/CameraFeatures.hpp b/include/depthai/common/CameraFeatures.hpp index cf362d0ca..c36569336 100644 --- a/include/depthai/common/CameraFeatures.hpp +++ b/include/depthai/common/CameraFeatures.hpp @@ -49,7 +49,8 @@ inline std::ostream& operator<<(std::ostream& out, const dai::CameraSensorConfig out << "minFps: " << config.minFps << ", "; out << "maxFps: " << config.maxFps << ", "; out << "type: " << config.type << ", "; - out << "fov: " << "{x:" << config.fov.x << ", "; + out << "fov: " + << "{x:" << config.fov.x << ", "; out << "y: " << config.fov.y << ", "; out << "width: " << config.fov.width << ", "; out << "height: " << config.fov.height << "}"; From 15d6a7911989dbfdf5165c4c0497c55bbfaa2ece Mon Sep 17 00:00:00 2001 From: SzabolcsGergely Date: Thu, 3 Oct 2024 18:29:52 +0300 Subject: [PATCH 18/34] SpeckleFilter: Add differenceThreshold config --- cmake/Depthai/DepthaiDeviceSideConfig.cmake | 2 +- shared/depthai-shared | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/Depthai/DepthaiDeviceSideConfig.cmake b/cmake/Depthai/DepthaiDeviceSideConfig.cmake index 948626a30..a45330b6d 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 "efd7622159a172791cc3c1f59175bfbd1ccdab32") +set(DEPTHAI_DEVICE_SIDE_COMMIT "1498234108ce6d900c7c80437ea997df3b0ffd65") # "version if applicable" set(DEPTHAI_DEVICE_SIDE_VERSION "") diff --git a/shared/depthai-shared b/shared/depthai-shared index 5dece0072..41f9c0e2b 160000 --- a/shared/depthai-shared +++ b/shared/depthai-shared @@ -1 +1 @@ -Subproject commit 5dece007271e1d61dfd1078991b7f911caa7c2eb +Subproject commit 41f9c0e2b28ff5e771b95971e26c4fd0075eec90 From 76e5cbd15309fbdb259267120e38a93c72a65cb2 Mon Sep 17 00:00:00 2001 From: SzabolcsGergely Date: Fri, 4 Oct 2024 19:38:32 +0300 Subject: [PATCH 19/34] Implement configurable filtering order --- cmake/Depthai/DepthaiDeviceSideConfig.cmake | 2 +- shared/depthai-shared | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/Depthai/DepthaiDeviceSideConfig.cmake b/cmake/Depthai/DepthaiDeviceSideConfig.cmake index a45330b6d..6adc2a7df 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 "1498234108ce6d900c7c80437ea997df3b0ffd65") +set(DEPTHAI_DEVICE_SIDE_COMMIT "1d380e6aef6c14ea6b499f1b08dbb8a1fddc2eb3") # "version if applicable" set(DEPTHAI_DEVICE_SIDE_VERSION "") diff --git a/shared/depthai-shared b/shared/depthai-shared index 41f9c0e2b..6b906091d 160000 --- a/shared/depthai-shared +++ b/shared/depthai-shared @@ -1 +1 @@ -Subproject commit 41f9c0e2b28ff5e771b95971e26c4fd0075eec90 +Subproject commit 6b906091d795b31833b97f6347880a2cbca6fb1b From 7e11d0603c7a716d79426051f5d4740fca579069 Mon Sep 17 00:00:00 2001 From: SzabolcsGergely Date: Wed, 9 Oct 2024 18:00:19 +0300 Subject: [PATCH 20/34] Stereo: Scale disparity to 13 bit range prior to filtering --- cmake/Depthai/DepthaiDeviceSideConfig.cmake | 2 +- shared/depthai-shared | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/Depthai/DepthaiDeviceSideConfig.cmake b/cmake/Depthai/DepthaiDeviceSideConfig.cmake index 6adc2a7df..7830776f6 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 "1d380e6aef6c14ea6b499f1b08dbb8a1fddc2eb3") +set(DEPTHAI_DEVICE_SIDE_COMMIT "4280f8084e08f54d9e0f8c2e011aa27f1321a442") # "version if applicable" set(DEPTHAI_DEVICE_SIDE_VERSION "") diff --git a/shared/depthai-shared b/shared/depthai-shared index 6b906091d..a720ab8cf 160000 --- a/shared/depthai-shared +++ b/shared/depthai-shared @@ -1 +1 @@ -Subproject commit 6b906091d795b31833b97f6347880a2cbca6fb1b +Subproject commit a720ab8cf4e397d2efa001adb26066c9b396bd98 From bc7c7cc202e16fb8f1b5f89c45679e657929feb0 Mon Sep 17 00:00:00 2001 From: SzabolcsGergely Date: Fri, 11 Oct 2024 13:36:50 +0300 Subject: [PATCH 21/34] StereoDepth: postprocessing: handle edge case when post-processing filter is enabled, disparity output disabled, median enabled --- cmake/Depthai/DepthaiDeviceSideConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Depthai/DepthaiDeviceSideConfig.cmake b/cmake/Depthai/DepthaiDeviceSideConfig.cmake index 7830776f6..97a9bf062 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 "4280f8084e08f54d9e0f8c2e011aa27f1321a442") +set(DEPTHAI_DEVICE_SIDE_COMMIT "9f1412b723dd7c6dbcbdb46c0ce0a46647a851e4") # "version if applicable" set(DEPTHAI_DEVICE_SIDE_VERSION "") From 69f7669b43b1a45777f5e02f203e3ab8e2146d01 Mon Sep 17 00:00:00 2001 From: SzabolcsGergely Date: Thu, 17 Oct 2024 15:21:45 +0300 Subject: [PATCH 22/34] StereoDepth postprocessing: improve SpatialFilt/er and TemporalFilter delta parameter handling --- cmake/Depthai/DepthaiDeviceSideConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Depthai/DepthaiDeviceSideConfig.cmake b/cmake/Depthai/DepthaiDeviceSideConfig.cmake index 97a9bf062..ed88ed8b0 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 "9f1412b723dd7c6dbcbdb46c0ce0a46647a851e4") +set(DEPTHAI_DEVICE_SIDE_COMMIT "1d1152e0c179d2918e15522d99cfea4abb7f5ea5") # "version if applicable" set(DEPTHAI_DEVICE_SIDE_VERSION "") From 60d84e7206e765477d09e0bb8d0b0f7d003581dd Mon Sep 17 00:00:00 2001 From: SzabolcsGergely Date: Mon, 21 Oct 2024 15:50:16 +0300 Subject: [PATCH 23/34] StereoDepth: add arbitrary filtering order support with scaling --- cmake/Depthai/DepthaiDeviceSideConfig.cmake | 2 +- shared/depthai-shared | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/Depthai/DepthaiDeviceSideConfig.cmake b/cmake/Depthai/DepthaiDeviceSideConfig.cmake index ed88ed8b0..75653f3c8 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 "1d1152e0c179d2918e15522d99cfea4abb7f5ea5") +set(DEPTHAI_DEVICE_SIDE_COMMIT "367245d0784f0d2bc00ff4e50edf2955869e4ee4") # "version if applicable" set(DEPTHAI_DEVICE_SIDE_VERSION "") diff --git a/shared/depthai-shared b/shared/depthai-shared index a720ab8cf..be6009abc 160000 --- a/shared/depthai-shared +++ b/shared/depthai-shared @@ -1 +1 @@ -Subproject commit a720ab8cf4e397d2efa001adb26066c9b396bd98 +Subproject commit be6009abc3ea329877fb746532de0b6b4445842e From acafbabf0142de616050e3ecd93e483f942e3ca0 Mon Sep 17 00:00:00 2001 From: SzabolcsGergely Date: Tue, 29 Oct 2024 16:55:33 +0200 Subject: [PATCH 24/34] FW: Stereo: issue debug prints once on calibration update event --- cmake/Depthai/DepthaiDeviceSideConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Depthai/DepthaiDeviceSideConfig.cmake b/cmake/Depthai/DepthaiDeviceSideConfig.cmake index 948626a30..776354d24 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 "efd7622159a172791cc3c1f59175bfbd1ccdab32") +set(DEPTHAI_DEVICE_SIDE_COMMIT "5a168b72adfbd1bcc7c5e0e0cb8506a18304fcd4") # "version if applicable" set(DEPTHAI_DEVICE_SIDE_VERSION "") From 02f004daa70d6b0c5f7a00469b81897f3bb6ccea Mon Sep 17 00:00:00 2001 From: SzabolcsGergely Date: Thu, 7 Nov 2024 11:46:57 +0200 Subject: [PATCH 25/34] Stereo: Core: add new stereo presets --- include/depthai/pipeline/node/StereoDepth.hpp | 11 +- src/pipeline/node/StereoDepth.cpp | 234 ++++++++++++++++++ 2 files changed, 243 insertions(+), 2 deletions(-) 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/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; } } From 66567931d71bbb0b9b7f3b495742ce0e82eb14ef Mon Sep 17 00:00:00 2001 From: Matevz Morato Date: Mon, 11 Nov 2024 00:38:27 +0100 Subject: [PATCH 26/34] Bump version to 2.29.0 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ac7877fc..8c2671877 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,7 +55,7 @@ if(WIN32) endif() # Create depthai project -project(depthai VERSION "2.28.0" LANGUAGES CXX C) +project(depthai VERSION "2.29.0" LANGUAGES CXX C) get_directory_property(has_parent PARENT_DIRECTORY) if(has_parent) set(DEPTHAI_VERSION ${PROJECT_VERSION} PARENT_SCOPE) From 898f086e476ba9f0385b9ca968a51fbfc3f1eff6 Mon Sep 17 00:00:00 2001 From: SzabolcsGergely Date: Mon, 11 Nov 2024 18:38:17 +0200 Subject: [PATCH 27/34] Stereo: PostProcessing: Handle edge case --- cmake/Depthai/DepthaiDeviceSideConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Depthai/DepthaiDeviceSideConfig.cmake b/cmake/Depthai/DepthaiDeviceSideConfig.cmake index 3cc5ed139..ced1571ec 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 "f5f9f88ada8dc7ac279e44e6a02d37198e333549") +set(DEPTHAI_DEVICE_SIDE_COMMIT "14594d8b5d7b367e2726a9d85fc252dd5c2a1035") # "version if applicable" set(DEPTHAI_DEVICE_SIDE_VERSION "") From 36d37439048d7c616db92309cc6df6c28d8fae34 Mon Sep 17 00:00:00 2001 From: SzabolcsGergely Date: Tue, 12 Nov 2024 06:30:57 +0200 Subject: [PATCH 28/34] Stereo: PostProcess: Fix edge case when decimation is before median --- cmake/Depthai/DepthaiDeviceSideConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Depthai/DepthaiDeviceSideConfig.cmake b/cmake/Depthai/DepthaiDeviceSideConfig.cmake index ced1571ec..855146052 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 "14594d8b5d7b367e2726a9d85fc252dd5c2a1035") +set(DEPTHAI_DEVICE_SIDE_COMMIT "30fe0b8eee71a49f5194cd3c056bf50db4e21502") # "version if applicable" set(DEPTHAI_DEVICE_SIDE_VERSION "") From fe5b1fb9f17432aa2f68d5ff638b4abe105401ec Mon Sep 17 00:00:00 2001 From: SzabolcsGergely Date: Tue, 12 Nov 2024 13:13:12 +0200 Subject: [PATCH 29/34] StereoDepth: update getMaxDisparity --- src/pipeline/datatype/StereoDepthConfig.cpp | 42 +++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/pipeline/datatype/StereoDepthConfig.cpp b/src/pipeline/datatype/StereoDepthConfig.cpp index d7715b72a..1bbff1f60 100644 --- a/src/pipeline/datatype/StereoDepthConfig.cpp +++ b/src/pipeline/datatype/StereoDepthConfig.cpp @@ -99,6 +99,48 @@ float StereoDepthConfig::getMaxDisparity() const { maxDisp += cfg.algorithmControl.disparityShift; if(cfg.algorithmControl.enableExtended) maxDisp *= 2; if(cfg.algorithmControl.enableSubpixel) maxDisp *= (1 << cfg.algorithmControl.subpixelFractionalBits); + + std::vector filtersToExecute; + for(auto filter : cfg.postProcessing.filteringOrder) { + switch(filter) { + case RawStereoDepthConfig::PostProcessing::Filter::SPECKLE: + if(cfg.postProcessing.speckleFilter.enable) { + filtersToExecute.push_back(filter); + } + break; + case RawStereoDepthConfig::PostProcessing::Filter::TEMPORAL: + if(cfg.postProcessing.temporalFilter.enable) { + filtersToExecute.push_back(filter); + } + break; + case RawStereoDepthConfig::PostProcessing::Filter::SPATIAL: + if(cfg.postProcessing.spatialFilter.enable) { + filtersToExecute.push_back(filter); + } + break; + case RawStereoDepthConfig::PostProcessing::Filter::DECIMATION: + if(cfg.postProcessing.decimationFilter.decimationFactor > 1) { + filtersToExecute.push_back(filter); + } + break; + case RawStereoDepthConfig::PostProcessing::Filter::MEDIAN: + if(cfg.postProcessing.median != dai::MedianFilter::MEDIAN_OFF) { + filtersToExecute.push_back(filter); + } + break; + case RawStereoDepthConfig::PostProcessing::Filter::NONE: + break; + default: + break; + } + } + + if(filtersToExecute.size() != 0) { + if(filtersToExecute.back() != RawStereoDepthConfig::PostProcessing::Filter::MEDIAN) { + maxDisp = 1 << 13; + } + } + return maxDisp; } From 0a65ae48093e8128a34abd689124b415147886e3 Mon Sep 17 00:00:00 2001 From: asahtik Date: Thu, 14 Nov 2024 13:44:55 +0100 Subject: [PATCH 30/34] Add width and height to encoded frame --- cmake/Depthai/DepthaiDeviceSideConfig.cmake | 2 +- .../pipeline/datatype/EncodedFrame.hpp | 23 +++++++++++++++++++ shared/depthai-shared | 2 +- src/pipeline/datatype/EncodedFrame.cpp | 14 +++++++++++ 4 files changed, 39 insertions(+), 2 deletions(-) diff --git a/cmake/Depthai/DepthaiDeviceSideConfig.cmake b/cmake/Depthai/DepthaiDeviceSideConfig.cmake index 855146052..393254a63 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 "30fe0b8eee71a49f5194cd3c056bf50db4e21502") +set(DEPTHAI_DEVICE_SIDE_COMMIT "97329ec22d4ef0bc4961e09c673d2c6a33bdc6d8") # "version if applicable" set(DEPTHAI_DEVICE_SIDE_VERSION "") diff --git a/include/depthai/pipeline/datatype/EncodedFrame.hpp b/include/depthai/pipeline/datatype/EncodedFrame.hpp index 13d5b1058..0244d12ad 100644 --- a/include/depthai/pipeline/datatype/EncodedFrame.hpp +++ b/include/depthai/pipeline/datatype/EncodedFrame.hpp @@ -36,6 +36,15 @@ class EncodedFrame : public Buffer { * Retrieves instance number */ unsigned int getInstanceNum() const; + /** + * Retrieves image width in pixels + */ + unsigned int getWidth() const; + + /** + * Retrieves image height in pixels + */ + unsigned int getHeight() const; /** * Retrieves exposure time */ @@ -111,6 +120,20 @@ class EncodedFrame : public Buffer { */ EncodedFrame& setInstanceNum(unsigned int instance); + /** + * Specifies frame width + * + * @param width frame width + */ + EncodedFrame& setWidth(unsigned int width); + + /** + * Specifies frame height + * + * @param height frame height + */ + EncodedFrame& setHeight(unsigned int height); + /** * Specifies the encoding quality * diff --git a/shared/depthai-shared b/shared/depthai-shared index be6009abc..e8d92d41d 160000 --- a/shared/depthai-shared +++ b/shared/depthai-shared @@ -1 +1 @@ -Subproject commit be6009abc3ea329877fb746532de0b6b4445842e +Subproject commit e8d92d41daa87edc2d44d53e9ccc42f152ac3db1 diff --git a/src/pipeline/datatype/EncodedFrame.cpp b/src/pipeline/datatype/EncodedFrame.cpp index a19d29be4..626ca6ff4 100644 --- a/src/pipeline/datatype/EncodedFrame.cpp +++ b/src/pipeline/datatype/EncodedFrame.cpp @@ -18,6 +18,12 @@ EncodedFrame::EncodedFrame(std::shared_ptr ptr) : Buffer(std::m unsigned int EncodedFrame::getInstanceNum() const { return frame.instanceNum; } +unsigned int EncodedFrame::getWidth() const { + return frame.width; +} +unsigned int EncodedFrame::getHeight() const { + return frame.height; +} std::chrono::microseconds EncodedFrame::getExposureTime() const { return std::chrono::microseconds(frame.cam.exposureTimeUs); } @@ -99,6 +105,14 @@ EncodedFrame& EncodedFrame::setInstanceNum(unsigned int instanceNum) { frame.instanceNum = instanceNum; return *this; } +EncodedFrame& EncodedFrame::setWidth(unsigned int width) { + frame.width = width; + return *this; +} +EncodedFrame& EncodedFrame::setHeight(unsigned int height) { + frame.height = height; + return *this; +} EncodedFrame& EncodedFrame::setQuality(unsigned int quality) { frame.quality = quality; return *this; From b3a778f32d202eecae8deb079156c02c3da9ada1 Mon Sep 17 00:00:00 2001 From: SzabolcsGergely Date: Mon, 18 Nov 2024 11:58:38 +0200 Subject: [PATCH 31/34] Update stereo profile presets --- src/pipeline/node/StereoDepth.cpp | 55 +++++-------------------------- 1 file changed, 8 insertions(+), 47 deletions(-) diff --git a/src/pipeline/node/StereoDepth.cpp b/src/pipeline/node/StereoDepth.cpp index b25ad0447..d65404ba3 100644 --- a/src/pipeline/node/StereoDepth.cpp +++ b/src/pipeline/node/StereoDepth.cpp @@ -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; @@ -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; @@ -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; @@ -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); @@ -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; @@ -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; From 1c9229bc1e495db7e35229c2e35ce7de540a23ba Mon Sep 17 00:00:00 2001 From: SzabolcsGergely Date: Mon, 18 Nov 2024 13:35:49 +0200 Subject: [PATCH 32/34] Remove HIGH_ACCURACY2 --- src/pipeline/node/StereoDepth.cpp | 39 ------------------------------- 1 file changed, 39 deletions(-) diff --git a/src/pipeline/node/StereoDepth.cpp b/src/pipeline/node/StereoDepth.cpp index d65404ba3..2cbe6ca96 100644 --- a/src/pipeline/node/StereoDepth.cpp +++ b/src/pipeline/node/StereoDepth.cpp @@ -304,45 +304,6 @@ void StereoDepth::setDefaultProfilePreset(PresetMode mode) { 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::PIXEL_SKIPPING; - - config.postProcessing.spatialFilter.enable = true; - config.postProcessing.spatialFilter.holeFillingRadius = 1; - config.postProcessing.spatialFilter.numIterations = 1; - 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_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, From 79de99d5a011c3429d8a6c59f394a4d7caa04c02 Mon Sep 17 00:00:00 2001 From: Matevz Morato Date: Thu, 21 Nov 2024 14:57:45 +0100 Subject: [PATCH 33/34] [FW] - add logs for timing of stereo filters --- cmake/Depthai/DepthaiDeviceSideConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Depthai/DepthaiDeviceSideConfig.cmake b/cmake/Depthai/DepthaiDeviceSideConfig.cmake index 393254a63..e88448ce3 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 "97329ec22d4ef0bc4961e09c673d2c6a33bdc6d8") +set(DEPTHAI_DEVICE_SIDE_COMMIT "4d360b5c56225f23e9a3d3a3999ce46c90cfdeaf") # "version if applicable" set(DEPTHAI_DEVICE_SIDE_VERSION "") From 68fe9beb14d6c844c4fc2dc4ddc77d44c82eb1cf Mon Sep 17 00:00:00 2001 From: Matevz Morato Date: Fri, 22 Nov 2024 11:42:32 +0100 Subject: [PATCH 34/34] Remove unused preset modes --- include/depthai/pipeline/node/StereoDepth.hpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/depthai/pipeline/node/StereoDepth.hpp b/include/depthai/pipeline/node/StereoDepth.hpp index b3d45143e..2b64c9e2a 100644 --- a/include/depthai/pipeline/node/StereoDepth.hpp +++ b/include/depthai/pipeline/node/StereoDepth.hpp @@ -32,8 +32,6 @@ class StereoDepth : public NodeCRTP { DEFAULT, FACE, HIGH_DETAIL, - HIGH_FPS, - HIGH_ACCURACY2, ROBOTICS };