You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To get the HFOV you can use `this script <https://gist.github.com/Erol444/4aff71f4576637624d56dce4a60ad62e>`__, which also works for wide-FOV cameras and allows you to
33
+
specif alpha parameter.
34
34
35
-
// With 800P mono camera resolution where HFOV=71.9 degrees
Examples for calculating the depth value, using the OAK-D (7.5cm baseline OV9282), for 400P resolution and disparity of 50 pixels:
40
+
41
+
.. math::
42
+
43
+
depth = 441.25 * 7.5 / 50 = 66.19 cm
39
44
40
45
`RVC2 <https://docs.luxonis.com/projects/hardware/en/latest/pages/rvc/rvc2.html>`__-based cameras have a **0..95 disparity search** range,
41
46
which limits the minimal depth perception. Baseline is the distance between two cameras of the
@@ -280,22 +285,27 @@ Stereo subpixel effect on layering
280
285
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
281
286
282
287
Default stereo depth output has 0..95 disparity pixels, which would produce 96 unique depth values. This can especially be seen when using pointcloud representation
283
-
and seeing how there are discrete "layers" of points, instead of a smooth transition:
288
+
and seeing how there are discrete "layers" of points, instead of a smooth transition:
This layering can especially be seen at longer distances, where these layers are exponentially further apart.
288
293
289
294
But with Stereo Subpixel mode enabled, there are many more unique values possible, which produces more granular depth steps, and thus smoother a pointcloud.
290
295
296
+
.. code-block:: python
297
+
298
+
# Number of unique values based on subpixel bits setting
One can change the number of subpixel bits by setting ``stereoDepth.setSubpixelFractionalBits(int)`` parameter to 3, 4 or 5 bits.
301
311
@@ -317,10 +327,10 @@ Going back to :ref:`Depth from disparity`, minimal depth perception (**MinZ**) i
317
327
(maximum number of pixel for disparity search):
318
328
319
329
.. math::
320
-
depth = focal_length * baseline / disparity
330
+
depth = focalLength * baseline / disparity
321
331
322
332
.. math::
323
-
MinZ = focal_length * baseline / 95
333
+
MinZ = focalLength * baseline / 95
324
334
325
335
How to get lower MinZ
326
336
---------------------
@@ -343,10 +353,10 @@ Above we have a formula for MinZ, and by lowering the resolution, we are lowerin
343
353
MinZ = focalLength * baseline / 95
344
354
345
355
.. math::
346
-
MinZ [800P OAK-D] = 882.5 * 7.5 / 95 = 70 cm
356
+
MinZ [800P] = 882.5 * 7.5 / 95 = 70 cm
347
357
348
358
.. math::
349
-
MinZ [400P OAK-D] = 441 * 7.5 / 95 = 35 cm
359
+
MinZ [400P] = 441 * 7.5 / 95 = 35 cm
350
360
351
361
As you can see, by lowering resolution by 2, we are also lowering MinZ by 2. Note that because you have fewer pixels, you will also have lower depth accuracy (in cm).
352
362
@@ -431,7 +441,7 @@ That gives the following formula:
431
441
B = 2 * Dv * tan(HFOV/2) * W / (2 * D * tan(HFOV/2))
432
442
433
443
.. math::
434
-
B = W * Dv / D # pixels
444
+
B [pixels] = W * Dv / D
435
445
436
446
Example: If we are using OAK-D, which has a HFOV of 72°, a baseline (:code:`BL`) of 7.5 cm and
437
447
640x400 (400P) resolution is used, therefore :code:`W = 640` and an object is :code:`D = 100` cm away, we can
@@ -440,7 +450,7 @@ calculate :code:`B` in the following way:
440
450
.. math::
441
451
442
452
Dv = 7.5 / 2 * tan(90 - 72/2) = 3.75 * tan(54°) = 5.16 cm
443
-
B = 640 * 5.16 / 100 = 33 # pixels
453
+
B = 640 * 5.16 / 100 = 33
444
454
445
455
Credit for calculations and images goes to our community member gregflurry, which he made on
@@ -468,6 +478,7 @@ For noisy pointcloud we suggest a few approaches:
468
478
469
479
* (mentioned above) Start with the :ref:`Fixing noisy depth <2. Fixing noisy depth>` chapter, as otherwise, noise will produce points all over the pointcloud
470
480
* (mentioned above) Continue with the :ref:`Improving depth accuracy <3. Improving depth accuracy>` chapter - depth inaccuracy will be easily visible in pointcloud
481
+
471
482
* Enable Stereo subpixel mode, especially due to the :ref:`Stereo subpixel effect on layering`
472
483
473
484
* :ref:`Decimation filter for pointcloud` for faster processing (FPS) and additional filtering
0 commit comments