Skip to content

Commit 080d0a0

Browse files
authored
Merge branch 'main' into camera_tuning
2 parents 15f80f1 + 6581557 commit 080d0a0

File tree

18 files changed

+144
-23
lines changed

18 files changed

+144
-23
lines changed
-91.2 KB
Binary file not shown.
110 KB
Loading
583 KB
Loading

docs/source/components/nodes/script.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ In the script node you can interface with GPIOs of the VPU using module GPIO. Cu
106106
107107
# Interrupts
108108
GPIO.waitInterruptEvent(gpio = -1) # blocks until any interrupt or interrupt by specified gpio is fired. Interrupts with callbacks are ignored here
109-
GPIO.hasInterruptEvent(gpio = -1) # returns whether interrupt happened on any or specfied gpio. Interrupts with callbacks are ignored here
109+
GPIO.hasInterruptEvent(gpio = -1) # returns whether interrupt happened on any or specified gpio. Interrupts with callbacks are ignored here
110110
GPIO.setInterrupt(gpio, edge, priority, callback = None) # adds interrupt to specified pin
111111
GPIO.clearInterrupt(gpio) # clears interrupt of specified pin
112112

docs/source/components/nodes/stereo_depth.rst

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Inputs and Outputs
7373
Internal block diagram of StereoDepth node
7474
##########################################
7575

76-
.. image:: /_static/images/components/depth_diagram.jpeg
76+
.. image:: /_static/images/components/depth_diagram.png
7777
:target: https://whimsical.com/stereo-node-EKcfcXGjGpNL6cwRPV6NPv
7878

7979
On the diagram, red rectangle are firmware settings that are configurable via the API. Gray rectangles are settings that that are not yet
@@ -126,9 +126,15 @@ Currently configurable blocks
126126

127127
For comparison of normal disparity vs. subpixel disparity images, click `here <https://github.com/luxonis/depthai/issues/184>`__.
128128

129-
.. tab:: Mesh file / Homography matrix
129+
.. tab:: Depth Filters
130130

131-
Mesh files are generated using the camera intrinsics, distortion coeffs, and rectification rotations.
131+
**Depth Filtering** / **Depth Post-Processing** is performed at the end of the depth pipeline. It helps with noise reduction and overall depth quality.
132+
133+
.. include:: ../../includes/depth-filters.rst
134+
135+
.. tab:: Mesh files
136+
137+
Mesh files (homography matrix) are generated using the camera intrinsics, distortion coeffs, and rectification rotations.
132138
These files helps in overcoming the distortions in the camera increasing the accuracy and also help in when `wide FOV <https://docs.luxonis.com/projects/hardware/en/latest/pages/arducam.html#arducam-compatible-cameras>`__ lens are used.
133139

134140
.. note::
@@ -148,7 +154,7 @@ Currently configurable blocks
148154

149155
.. tab:: Confidence Threshold
150156

151-
- **Confidence threshold**: Stereo depth algorithm searches for the matching feature from right camera point to the left image (along the 96 disparity levels). During this process it computes the cost for each disparity level and choses the minimal cost between two disparities and uses it to compute the confidence at each pixel. Stereo node will output disparity/depth pixels only where depth confidence is below the **confidence threshold** (lower the confidence value means better depth accuracy). Note: This threshold only applies to Normal stereo mode as of now.
157+
- **Confidence threshold**: Stereo depth algorithm searches for the matching feature from right camera point to the left image (along the 96 disparity levels). During this process it computes the cost for each disparity level and chooses the minimal cost between two disparities and uses it to compute the confidence at each pixel. Stereo node will output disparity/depth pixels only where depth confidence is below the **confidence threshold** (lower the confidence value means better depth accuracy).
152158
- **LR check threshold**: Disparity is considered for the output when the difference between LR and RL disparities is smaller than the LR check threshold.
153159

154160
.. doxygenfunction:: dai::StereoDepthConfig::setConfidenceThreshold
@@ -159,8 +165,8 @@ Currently configurable blocks
159165
:project: depthai-core
160166
:no-link:
161167

162-
Current limitations
163-
###################
168+
Limitations
169+
###########
164170

165171
- Median filtering is disabled when subpixel mode is set to 4 or 5 bits.
166172

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
.. tabs::
2+
3+
.. tab:: Median
4+
5+
This is a non-edge preserving `Median filter <https://en.wikipedia.org/wiki/Median_filter>`__, which can be used
6+
to reduce noise and smoothen the depth map. Median filter is implemented in hardware, so it's the fastest filter.
7+
8+
.. doxygenenum:: dai::MedianFilter
9+
:project: depthai-core
10+
:no-link:
11+
12+
.. tab:: Speckle
13+
14+
**Speckle Filter** is used to reduce the speckle noise. Speckle noise is a region with huge
15+
variance between neighboring disparity/depth pixels, and speckle filter tries to filter this region.
16+
17+
.. doxygenstruct:: dai::RawStereoDepthConfig::PostProcessing::SpeckleFilter
18+
:project: depthai-core
19+
:no-link:
20+
:members:
21+
22+
.. tab:: Temporal
23+
24+
**Temporal Filter** is intended to improve the depth data persistency by manipulating per-pixel
25+
values based on previous frames. The filter performs a single pass on the data, adjusting the depth
26+
values while also updating the tracking history. In cases where the pixel data is missing or invalid,
27+
the filter uses a user-defined persistency mode to decide whether the missing value should be
28+
rectified with stored data. Note that due to its reliance on historic data the filter may introduce
29+
visible blurring/smearing artifacts, and therefore is best-suited for static scenes.
30+
31+
.. doxygenstruct:: dai::RawStereoDepthConfig::PostProcessing::TemporalFilter
32+
:project: depthai-core
33+
:no-link:
34+
:members:
35+
36+
.. tab:: Spatial
37+
38+
**Spatial Edge-Preserving Filter** will fill invalid depth pixels with valid neighboring depth pixels.
39+
It performs a series of 1D horizontal and vertical passes or iterations, to enhance the smoothness of
40+
the reconstructed data. It is based on `this research paper <https://www.inf.ufrgs.br/~eslgastal/DomainTransform/>`__.
41+
42+
.. doxygenstruct:: dai::RawStereoDepthConfig::PostProcessing::SpatialFilter
43+
:project: depthai-core
44+
:no-link:
45+
:members:
46+
47+
.. tab:: Threshold
48+
49+
**Threshold Filter** filters out all disparity/depth pixels outside the configured min/max
50+
threshold values.
51+
52+
.. autoclass:: depthai.RawStereoDepthConfig.PostProcessing.ThresholdFilter
53+
:members:
54+
:inherited-members:
55+
:noindex:
56+
57+
.. tab:: Decimation
58+
59+
**Decimation Filter** will sub-samples the depth map, which means it reduces the depth scene complexity and allows
60+
other filters to run faster. Setting :code:`decimationFactor` to 2 will downscale 1280x800 depth map to 640x400.
61+
62+
.. doxygenstruct:: dai::RawStereoDepthConfig::PostProcessing::DecimationFilter
63+
:members:
64+
:project: depthai-core
65+
:no-link:

docs/source/install.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ Kernel Virtual Machine
241241
To access the OAK-D camera in the `Kernel Virtual Machine <https://www.linux-kvm.org/page/Main_Page>`__, there is a need to attach and detach USB
242242
devices on the fly when the host machine detects changes in the USB bus.
243243

244-
OAK-D camera changes the USB device type when it is used by DepthAI API. This happens in backgound when the camera is used natively.
244+
OAK-D camera changes the USB device type when it is used by DepthAI API. This happens in background when the camera is used natively.
245245
But when the camera is used in a virtual environment the situation is different.
246246

247247
On your host machine, use the following code:
@@ -292,7 +292,7 @@ Note that when the device is disconnected from the USB bus, some udev environmen
292292
that is why you need to use :code:`PRODUCT` environmental variable to identify which device has been disconnected.
293293

294294
The virtual machine where DepthAI API application is running should have defined a udev rules that identify the OAK-D camera.
295-
The udev rule is decribed `here <https://docs.luxonis.com/en/latest/pages/faq/#does-depthai-work-on-the-nvidia-jetson-series>`__
295+
The udev rule is described `here <https://docs.luxonis.com/en/latest/pages/faq/#does-depthai-work-on-the-nvidia-jetson-series>`__
296296

297297
Solution provided by `Manuel Segarra-Abad <https://github.com/maseabunikie>`__
298298

docs/source/samples/Script/script_json_communication.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ and when it's noon, it would send a simple message to the Script node which woul
1515

1616
**What it does:**
1717

18-
Host creates a dictionary, serializes it, sends it to the Script node. Script node recieves the Buffer message, deserializes the dictionary,
18+
Host creates a dictionary, serializes it, sends it to the Script node. Script node receives the Buffer message, deserializes the dictionary,
1919
changes values a bit, serializes the dictionary again and sends it to the host, which deserializes the changed dictionary and prints the new values.
2020

2121
Demo
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
Depth Post-Processing
2+
=====================
3+
4+
This example shows how you can run depth post-processing filters on the device itself to reduce noise,
5+
smooth the depth map and overall improve the depth map quality. Post-processing can be added to :ref:`StereoDepth` node.
6+
7+
8+
Demo
9+
####
10+
11+
.. image:: /_static/images/examples/depth_comparison.png
12+
13+
Depth filters
14+
#############
15+
16+
.. include:: /includes/depth-filters.rst
17+
18+
.. rubric:: Similar samples:
19+
20+
- :ref:`Depth Preview`
21+
- :ref:`Stereo Depth from host`
22+
23+
Setup
24+
#####
25+
26+
.. include:: /includes/install_from_pypi.rst
27+
28+
Source code
29+
###########
30+
31+
.. tabs::
32+
33+
.. tab:: Python
34+
35+
Also `available on GitHub <https://github.com/luxonis/depthai-python/blob/main/examples/StereoDepth/depth_post_processing.py>`__
36+
37+
.. literalinclude:: ../../../../examples/StereoDepth/depth_post_processing.py
38+
:language: python
39+
:linenos:
40+
41+
.. tab:: C++
42+
43+
Also `available on GitHub <https://github.com/luxonis/depthai-core/blob/main/examples/StereoDepth/depth_post_processing.cpp>`__
44+
45+
.. literalinclude:: ../../../../depthai-core/examples/StereoDepth/depth_post_processing.cpp
46+
:language: cpp
47+
:linenos:
48+
49+
.. include:: /includes/footer-short.rst

docs/source/tutorials/code_samples.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ are presented with code.
122122
.. rubric:: StereoDepth
123123

124124
- :ref:`Depth Crop Control` - Demonstrates how to control cropping of depth frames from the host
125+
- :ref:`Depth Post-Processing` - Depth post-processing filters
125126
- :ref:`Depth Preview` - Displays colorized stereo disparity
126127
- :ref:`Stereo Depth from host` - Generates stereo depth frame from a set of mono images from the host
127128
- :ref:`Stereo Depth Video` - An extended version of **Depth Preview**

0 commit comments

Comments
 (0)