Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stereo: Add support for extended and subpixel together #572

Merged
merged 6 commits into from Jun 8, 2022

Conversation

SzabolcsGergely
Copy link
Collaborator

@SzabolcsGergely SzabolcsGergely commented May 3, 2022

Note:
When subpixel and extended are enabled extended mode runs without subpixel interpolation. The reasoning behind it is:

  • Faster
  • Extended mode is to extend minimum range, for close range there's no need for subpixel interpolation (the step between consecutive depth values is ~1 cm without subixel for close range (<80 cm) )
  • Median filter can be enabled: The number of disparities is 760 (subpixel run) + 95 (extended run). Median filter is limited to 1024.

The above behavior is subject to change before mainlining.

Update:
Behavior changed, extended mode does subpixel interpolation too, as per community request.
Up to 6080 distinct disparities with 5 fractional bits, 3040 with 4, 1520 with 3.

Known issues:
-extended mode together with confidence map output doesn't work as expected

Related:
luxonis/depthai-core#498

@Luxonis-Brandon
Copy link
Contributor

Thanks. I think this logic makes sense. But to just check if I understand it correctly, here's my summary:

  • This actually allows subpixel and extended disparity to be enabled at the same time, but really it's then just actually only running extended disparity only (with subpixel off).

Is that a correct summary?

@SzabolcsGergely
Copy link
Collaborator Author

SzabolcsGergely commented May 3, 2022

  • This actually allows subpixel and extended disparity to be enabled at the same time, but really it's then just actually only running extended disparity only (with subpixel off).

It runs subpixel for range [0,96), and combines with extended range [96, 190], which is without subpixel, so the result is a hybrid. High resolution for long-range, small for close range (which already has high res). The smaller the disparity, the higher the depth, thus the difference between 2 consecutive depth values is larger, which results in a quantization effect. That's what subpixel does, fills the gap. E.g. the difference between disparity 30 and 31 in terms of depth is 7.1 cm (makes sense to do subpixel to reduce the gap), while the difference between disp 96 and 98 is just 1.4 cm (would it make sense to do subpixel to get sub 1.4 cm accuracy given sensor noise etc.?).

This was mainly done to enable median filtering, but up to debate if we want to do subpixel for the extended range too.

@Luxonis-Brandon
Copy link
Contributor

Ah I get it! This is slick! Thanks!

@SzabolcsGergely SzabolcsGergely merged commit cd558bc into develop Jun 8, 2022
@SzabolcsGergely SzabolcsGergely deleted the stereo_extended_subpixel branch June 8, 2022 21:48
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.

None yet

3 participants