From 8e536a165771ab3f5b0a84a30b58b550b0f02c05 Mon Sep 17 00:00:00 2001 From: Erol444 Date: Mon, 17 May 2021 14:01:04 +0100 Subject: [PATCH 1/2] Added explanation of depth modes into stereoDepth node docs. This is copied from the faq --- docs/source/components/nodes/stereo_depth.rst | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/docs/source/components/nodes/stereo_depth.rst b/docs/source/components/nodes/stereo_depth.rst index 306eaffd8..bfc8ebe55 100644 --- a/docs/source/components/nodes/stereo_depth.rst +++ b/docs/source/components/nodes/stereo_depth.rst @@ -74,6 +74,42 @@ If one or more of the additional depth modes (:code:`lrcheck`, :code:`extended`, Otherwise, :code:`depth` output is **U16** (in millimeters) and median is functional. +Depth Modes +########### + +Left-Right Check +**************** + +Left-Right Check, or LR-Check is used to remove incorrectly calculated disparity pixels due to occlusions at object borders (Left and Right camera views +are slightly different). + +#. Computes disparity by matching in R->L direction +#. Computes disparity by matching in L->R direction +#. Combines results from 1 and 2, running on Shave: each pixel d = disparity_LR(x,y) is compared with disparity_RL(x-d,y). If the difference is above a threshold, the pixel at (x,y) in final disparity map is invalidated. + +Extended Disparity +****************** + +The :code:`extended disparity` allows detecting closer distance objects for the given baseline. This increases the maximum disparity search from 96 to 191. +So this cuts the minimum perceivable distance in half, given that the minimum distance is now :code:`focal_length * base_line_dist / 191` instead +of :code:`focal_length * base_line_dist / 96`. + +#. Computes disparity on the original size images (e.g. 1280x720) +#. Computes disparity on 2x downscaled images (e.g. 640x360) +#. Combines the two level disparities on Shave, effectively covering a total disparity range of 191 pixels (in relation to the original resolution). + +Subpixel Disparity +****************** + +Subpixel improves the precision and is especially useful for long range measurements. It also helps for better estimating surface normals + +Beside the integer disparity output, the Stereo engine is programmed to dump to memory the cost volume, that is 96 levels (disparities) per pixel, +then software interpolation is done on Shave, resulting a final disparity with 5 fractional bits, resulting in significantly more granual depth +steps (32 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/32 of a pixel. + +For comparison of normal disparity vs. subpixel disparity images, click `here `__. + Usage ##### From 67bb887c0b869fdcc6195c0bb4564736952e8fa9 Mon Sep 17 00:00:00 2001 From: Erol444 Date: Tue, 18 May 2021 10:17:14 +0100 Subject: [PATCH 2/2] Fixed minimum distance calculation and typos --- docs/source/components/nodes/stereo_depth.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/source/components/nodes/stereo_depth.rst b/docs/source/components/nodes/stereo_depth.rst index bfc8ebe55..5a31d63c2 100644 --- a/docs/source/components/nodes/stereo_depth.rst +++ b/docs/source/components/nodes/stereo_depth.rst @@ -80,19 +80,19 @@ Depth Modes Left-Right Check **************** -Left-Right Check, or LR-Check is used to remove incorrectly calculated disparity pixels due to occlusions at object borders (Left and Right camera views +Left-Right Check or LR-Check is used to remove incorrectly calculated disparity pixels due to occlusions at object borders (Left and Right camera views are slightly different). #. Computes disparity by matching in R->L direction #. Computes disparity by matching in L->R direction -#. Combines results from 1 and 2, running on Shave: each pixel d = disparity_LR(x,y) is compared with disparity_RL(x-d,y). If the difference is above a threshold, the pixel at (x,y) in final disparity map is invalidated. +#. Combines results from 1 and 2, running on Shave: each pixel d = disparity_LR(x,y) is compared with disparity_RL(x-d,y). If the difference is above a threshold, the pixel at (x,y) in the final disparity map is invalidated. Extended Disparity ****************** The :code:`extended disparity` allows detecting closer distance objects for the given baseline. This increases the maximum disparity search from 96 to 191. -So this cuts the minimum perceivable distance in half, given that the minimum distance is now :code:`focal_length * base_line_dist / 191` instead -of :code:`focal_length * base_line_dist / 96`. +So this cuts the minimum perceivable distance in half, given that the minimum distance is now :code:`focal_length * base_line_dist / 190` instead +of :code:`focal_length * base_line_dist / 95`. #. Computes disparity on the original size images (e.g. 1280x720) #. Computes disparity on 2x downscaled images (e.g. 640x360) @@ -103,8 +103,8 @@ Subpixel Disparity Subpixel improves the precision and is especially useful for long range measurements. It also helps for better estimating surface normals -Beside the integer disparity output, the Stereo engine is programmed to dump to memory the cost volume, that is 96 levels (disparities) per pixel, -then software interpolation is done on Shave, resulting a final disparity with 5 fractional bits, resulting in significantly more granual depth +Besides the integer disparity output, the Stereo engine is programmed to dump to memory the cost volume, that is 96 levels (disparities) per pixel, +then software interpolation is done on Shave, resulting a final disparity with 5 fractional bits, resulting in significantly more granular depth steps (32 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/32 of a pixel.