Skip to content

Commit 3ce18f2

Browse files
committed
Add focus length parameter to stereo depth
1 parent 382cf9f commit 3ce18f2

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

depthai_ros_driver/config/rgbd.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
i_pipeline_type: rgbd
77
stereo:
88
i_depth_preset: DEFAULT
9+
# Optional disparity-to-depth override in pixels. Leave at default to use calibration.
10+
# i_focal_length: 860.0
911
# uncomment for better performance in RVC2 PoE devices
1012
# i_publish_topic: false
1113
# rgb:

depthai_ros_driver/src/param_handlers/stereo_param_handler.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ void StereoParamHandler::declareParams(std::shared_ptr<dai::node::StereoDepth> s
137137
if(declareAndLogParam<bool>("i_set_disparity_to_depth_use_spec_translation", false)) {
138138
stereo->setDisparityToDepthUseSpecTranslation(true);
139139
}
140+
float focalLength = declareAndLogParam<float>("i_focal_length", 0.0f);
141+
if(focalLength > 0.0f) {
142+
stereo->setFocalLength(focalLength);
143+
}
140144
//
141145
stereo->initialConfig->setBilateralFilterSigma(declareAndLogParam<int>("i_bilateral_sigma", 0));
142146
stereo->initialConfig->setLeftRightCheckThreshold(declareAndLogParam<int>("i_lrc_threshold", 10));

0 commit comments

Comments
 (0)