From d6c9f7a82d6be77e1f2be5e9b2f97a362798bfd6 Mon Sep 17 00:00:00 2001 From: Borong Yuan Date: Sat, 19 Aug 2023 14:55:58 +0800 Subject: [PATCH 1/2] update OAK stereo config and imu rate --- corelib/src/camera/CameraDepthAI.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/corelib/src/camera/CameraDepthAI.cpp b/corelib/src/camera/CameraDepthAI.cpp index beb36ce755..3a0568b916 100644 --- a/corelib/src/camera/CameraDepthAI.cpp +++ b/corelib/src/camera/CameraDepthAI.cpp @@ -320,7 +320,11 @@ bool CameraDepthAI::init(const std::string & calibrationFolder, const std::strin stereo->initialConfig.setConfidenceThreshold(depthConfidence_); stereo->initialConfig.setLeftRightCheck(true); stereo->initialConfig.setLeftRightCheckThreshold(5); - stereo->initialConfig.setMedianFilter(dai::MedianFilter::KERNEL_5x5); + stereo->initialConfig.setMedianFilter(dai::MedianFilter::KERNEL_7x7); + auto config = stereo->initialConfig.get(); + config.censusTransform.kernelSize = dai::StereoDepthConfig::CensusTransform::KernelSize::KERNEL_7x9; + config.censusTransform.kernelMask = 0X2AA00AA805540155; + stereo->initialConfig.set(config); // Link plugins CAM -> STEREO -> XLINK monoLeft->out.link(stereo->left); @@ -345,7 +349,7 @@ bool CameraDepthAI::init(const std::string & calibrationFolder, const std::strin { stereo->setSubpixel(true); stereo->setSubpixelFractionalBits(4); - auto config = stereo->initialConfig.get(); + config = stereo->initialConfig.get(); config.costMatching.disparityWidth = dai::StereoDepthConfig::CostMatching::DisparityWidth::DISPARITY_64; config.costMatching.enableCompanding = true; stereo->initialConfig.set(config); @@ -358,8 +362,8 @@ bool CameraDepthAI::init(const std::string & calibrationFolder, const std::strin if(imuPublished_) { - // enable ACCELEROMETER_RAW and GYROSCOPE_RAW at 200 hz rate - imu->enableIMUSensor({dai::IMUSensor::ACCELEROMETER_RAW, dai::IMUSensor::GYROSCOPE_RAW}, 200); + // enable ACCELEROMETER_RAW and GYROSCOPE_RAW at 100 hz rate + imu->enableIMUSensor({dai::IMUSensor::ACCELEROMETER_RAW, dai::IMUSensor::GYROSCOPE_RAW}, 100); // above this threshold packets will be sent in batch of X, if the host is not blocked and USB bandwidth is available imu->setBatchReportThreshold(1); // maximum number of IMU packets in a batch, if it's reached device will block sending until host can receive it From f52ee80d67402298d3e2fe4d27b9bd4f1d593af4 Mon Sep 17 00:00:00 2001 From: Borong Yuan Date: Sat, 19 Aug 2023 16:02:20 +0800 Subject: [PATCH 2/2] enable brightness filter --- corelib/src/camera/CameraDepthAI.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/corelib/src/camera/CameraDepthAI.cpp b/corelib/src/camera/CameraDepthAI.cpp index 3a0568b916..e4779c77e3 100644 --- a/corelib/src/camera/CameraDepthAI.cpp +++ b/corelib/src/camera/CameraDepthAI.cpp @@ -324,6 +324,7 @@ bool CameraDepthAI::init(const std::string & calibrationFolder, const std::strin auto config = stereo->initialConfig.get(); config.censusTransform.kernelSize = dai::StereoDepthConfig::CensusTransform::KernelSize::KERNEL_7x9; config.censusTransform.kernelMask = 0X2AA00AA805540155; + config.postProcessing.brightnessFilter.maxBrightness = 255; stereo->initialConfig.set(config); // Link plugins CAM -> STEREO -> XLINK