Skip to content

add DisparityWidth, Disparity Companding, SubpixelFractionalBits options#279

Merged
Serafadam merged 3 commits intoluxonis:humblefrom
borongyuan:humble
Apr 20, 2023
Merged

add DisparityWidth, Disparity Companding, SubpixelFractionalBits options#279
Serafadam merged 3 commits intoluxonis:humblefrom
borongyuan:humble

Conversation

@borongyuan
Copy link
Copy Markdown
Contributor

@borongyuan borongyuan commented Apr 6, 2023

Adding these options can help with better Stereo Depth tuning.

Using DISPARITY_64 alone is not a good idea. But it's not the same when using it with other parameters. The doc says "Median filter postprocessing is supported only for 3 fractional bits". This is because the median filter supports a maximum of 1024 Disparity. For DISPARITY_96 and 4 fractional bits, the maximun disparity is 1520. However, for DISPARITY_64 and 4 fractional bits, the maximum disparity is 1008, which is just below the limit. Another choice is to use DISPARITY_64 with extended disparity and 3 fractional bits. It's maximun disparity is also 1008. Which means the disparity range is increased to 126, while median filter is still available.

Another way to increase disparity range is to enable Companding. Unlike extended disparity, it does not consume more HW resources. So it is useful for high resolution inputs.

After adding these options, I found the following two sets of good parameter combinations.

/oak:
  ros__parameters:
    stereo:
      i_depth_filter_size: 5
      i_disparity_width: DISPARITY_64
      i_enable_companding: false
      i_extended_disp: true
      i_subpixel: true
      i_subpixel_fractional_bits: 3
/oak:
  ros__parameters:
    stereo:
      i_depth_filter_size: 5
      i_disparity_width: DISPARITY_64
      i_enable_companding: true
      i_extended_disp: false
      i_subpixel: true
      i_subpixel_fractional_bits: 4

Signed-off-by: Borong Yuan <yuanborong@hotmail.com>
Signed-off-by: Borong Yuan <yuanborong@hotmail.com>
Signed-off-by: Borong Yuan <yuanborong@hotmail.com>
@borongyuan borongyuan changed the title add SubpixelFractionalBits option add DisparityWidth, Disparity Companding, SubpixelFractionalBits options Apr 7, 2023
@Serafadam
Copy link
Copy Markdown
Contributor

Thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants