• DepthAI-v2
  • Distance to closest point on an object, BW1098OBC

Hi!
I am working on getting familiar with the BW1098OBC unit. I am however having some trouble with getting accurate distance to an object. When running "python3 depthai_demo.py -s metaout depth -bb" (depthai v0.3) I am getting completely wrong distances to objects, e.g 2 meters to an object 50cm away.

The calibration values read out from eeprom match the default calibration values specified the BW10980BC.json file.
Does anyone have any idea on what might be wrong?

Additionally, I am wondering what point on the detected object the x,y,z values refer to? Is it possible to get the distance to the closest point on the detected object?

    5 days later

    Hi rldeveloper ,

    Sorry about the delay. Our staff was mostly offline over the past 5 days because of Thanksgiving here in the US.

    So I think the issue on the distance being incorrect is that the BW1098OBC has a minimum depth of 0.7 meters. (See here)

    So we now support both extended disparity and also lower resolution operation, both of which independently halve the minimum depth. So running extended disparity at full 1280x800 resolution on the BW1098OBC would result in 0.35m (35cm) minimum depth. And runnning 640x400 resolution -and- extended disparity would result in a theoretical minimum depth of 0.175m (17.5cm) but actually would be limited by the min in-focus distance of the grayscale global shutter cameras, which is 0.196m (19.6cm).

    So I'd recommend trying out extended disparity from here, and visualize the depth (like the default example does) to see if you can properly get depth information when extended disparity is enabled:
    https://github.com/luxonis/depthai-experiments/tree/master/gen2-camera-demo

    image

    For example, above, you can see my knuckles are too close to that BW1092 w/ subpixel enabled.

    Thoughts?

    Thanks,
    Brandon

    Oh also for pulling the closest depth of an object, yes, we can provide an example of how to do this. I was just discussing with Lukasz offline.

    Thanks a lot for explaining the minimum depth issues. I will try out the experiment you linked. And its great that you can provide an example on how do find the closest depth!

      a month later

      Hi, first of all congratulations on a brilliant product - I've been playing with the OAK-D for a few hours now - I wondered if the extended disparity mode mentioned above is available on the OAK-D - if so, how might I enable it? Whilst the min-dist of 0.7m is by no means a showstopper for one of my applications, being able to reduce it would be incredibly useful.

      Thanks @hopkira for the kind words!

      So you can configure DepthAI to use 640x400 resolution (instead of 1280x800) with -monor 400 to reduce the resolution and allow closer depths to be seen. Full command below:
      python3 depthai_demo.py -monor 400 -s previewout metaout depth -bb

      image

      Notice that with standard settings, when I put my hand close to the camera (closer than 70cm) I see the same sort of effect.
      image

      So with the reduced resolution (or Extended Disparity, below), the minimum depth is 0.35cm. With reduced resolution and Extended Disparity, the limit becomes the focal distance of the grayscale cameras, which is 19.6cm.

      You can enable Extended Disparity, which allows full resolution while also seeing closer objects:
      https://github.com/luxonis/depthai-experiments/tree/master/gen2-camera-demo#real-time-depth-from-depthai-stereo-pair

      Then set lrcheck and subpixel to False, and set extended to True in the script.

      Note that at this time, Extended Disparity does not run with object detection (at least not stable), it's something we are debugging. So for right now (Jan 2021), I'd recommend simply doing the lower resolution depth to enable closer depth sensing.

      And I just updated the FAQ to provide more information on this. It's still propagating to the website, so you can see it here in the meantime: https://github.com/luxonis/depthai-docs-website/blob/master/source/pages/faq.rst#how-to-enable-depthai-to-perceive-closer-distances

      Thanks,
      Brandon

      @Brandon - what a fantastic and quick response - thank you - I'm going to try and generate a simple octree representation from the stream so these options are very useful indeed (and reduced resolution will also help with the load on the my Pi, so win win 🙂. Thank you! Richard.

        hopkira Thanks for the kind words! And excited to see what you build! Sounds quite exciting!