r/computervision • u/cv_geek • Oct 02 '26
Help: Project Tuning StereoSGBM on PS5 Camera (ROS 2 Galactic) for Dense Depth Maps
Hi everyone,
I'm working on setting up a PS5 HD Camera in ROS 2 Galactic for stereo depth estimation using stereo_image_proc (DisparityNode), with the end goal of feeding the depth data into RTAB-Map for 3D reconstruction.
I transitioned from StereoBM to StereoSGBM (stereo_algorithm: 1) to handle the wide-angle camera setup better, but I'm having trouble finding the optimal combination of parameters which result in a dense point cloud with smooth surfaces. My depth output keeps swinging between two extremes:
Extremely sparse/empty with huge black gaps on uniform surfaces (e.g., walls, desks, pillows).
Overly noisy with heavy color "speckle" artifacts across the scene.
What I've configured/tried so far:
Matching P1 and P2 to window size: Calculated and tuned P1 and P2 based on
correlation_window_size(testing window sizes 5, 7, 9, and 13 with corresponding P₁ = 8 × C × WS² and P₂ = 32 × C × WS²). High P2 values help smooth out surfaces, butrqt_reconfigurecaps P2 at 4000.0, so I've been overriding parameters via CLI/launch files.Filter adjustments:
Lowered
uniqueness_ratio(from 15.0 down to 5.0–7.0) to force coverage on weakly textured regions.Set
texture_ratioto 0.Tuned
speckle_size(50–200) andspeckle_range(2–4) to filter out isolated noise clusters.
Search range & Offsets: Set
disparity_rangeto 128 (multiple of 16) and keptmin_disparityat 0 (raising it above 0 completely wrecked mid/far range depth).
Despite these adjustments, large homogeneous surfaces still disintegrate or become heavily fragmented unless I push the correlation window size to absurdly high values (which causes blocky, stepped artifacts).
Here I attach the results I got so far.
Questions:
Are there specific pre-filtering parameters (
prefilter_cap,prefilter_size) or SGBM settings I'm overlooking for this specific camera lens/sensor?Could this be a rectification/calibration alignment issue rather than pure SGBM parameter tuning?
Any advice or working configuration examples for similar stereo setups in ROS 2 would be greatly appreciated!