From 03755970577842cfeb9e79e30d232c18bf34a952 Mon Sep 17 00:00:00 2001 From: Erol444 Date: Fri, 29 Jul 2022 15:20:51 +0200 Subject: [PATCH 1/2] Updated stereo depth node docs --- docs/source/components/nodes/stereo_depth.rst | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/docs/source/components/nodes/stereo_depth.rst b/docs/source/components/nodes/stereo_depth.rst index 6b38f3589..37eaa3fbf 100644 --- a/docs/source/components/nodes/stereo_depth.rst +++ b/docs/source/components/nodes/stereo_depth.rst @@ -122,7 +122,6 @@ Currently configurable blocks then software interpolation is done on Shave, resulting a final disparity with 3 fractional bits, resulting in significantly more granular depth steps (8 additional steps between the integer-pixel depth steps), and also theoretically, longer-distance depth viewing - as the maximum depth is no longer limited by a feature being a full integer pixel-step apart, but rather 1/8 of a pixel. In this mode, stereo cameras perform: :code:`94 depth steps * 8 subpixel depth steps + 2 (min/max values) = 754 depth steps` - Note that Subpixel and Extended Disparity are not yet supported simultaneously. For comparison of normal disparity vs. subpixel disparity images, click `here `__. @@ -301,9 +300,21 @@ By considering this fact, depth can be calculated using this formula: depth = focal_length_in_pixels * baseline / disparity_in_pixels -where baseline is the distance between two mono cameras. Note the unit used for baseline and depth is the same. +Where baseline is the distance between two mono cameras. Note the unit used for baseline and depth is the same. -To get focal length in pixels, use this formula: +To get focal length in pixels, you can :ref:`read camera calibration `, as focal length in pixels is +written in camera intrinsics (``intrinsics[0][0]``): + +.. code-block:: python + + import depthai as dai + + with dai.Device() as device: + calibData = device.readCalibration() + intrinsics, w, h = calibData.getDefaultIntrinsics(dai.CameraBoardSocket.RIGHT) + print('Right mono camera focal length in pixels:', intrinsics[0][0]) + +Here's theoretical calculation of the focal lenght in pixels: .. code-block:: python From 7744162526780b9c6baf4dc7cc069ac78c3eb932 Mon Sep 17 00:00:00 2001 From: Erol444 Date: Sat, 6 Aug 2022 13:28:16 +0200 Subject: [PATCH 2/2] Fixes based on PR review --- docs/source/components/nodes/stereo_depth.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/components/nodes/stereo_depth.rst b/docs/source/components/nodes/stereo_depth.rst index 37eaa3fbf..535a77302 100644 --- a/docs/source/components/nodes/stereo_depth.rst +++ b/docs/source/components/nodes/stereo_depth.rst @@ -311,10 +311,10 @@ written in camera intrinsics (``intrinsics[0][0]``): with dai.Device() as device: calibData = device.readCalibration() - intrinsics, w, h = calibData.getDefaultIntrinsics(dai.CameraBoardSocket.RIGHT) + intrinsics = calibData.getCameraIntrinsics(dai.CameraBoardSocket.RIGHT) print('Right mono camera focal length in pixels:', intrinsics[0][0]) -Here's theoretical calculation of the focal lenght in pixels: +Here's theoretical calculation of the focal length in pixels: .. code-block:: python