Skip to content

Commit 3b7ff14

Browse files
committed
Update max distance, max distance formulas (latex)
1 parent 181e84b commit 3b7ff14

File tree

2 files changed

+40
-35
lines changed

2 files changed

+40
-35
lines changed

docs/source/components/nodes/tof.rst

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -33,54 +33,57 @@ Inputs and Outputs
3333
│ ├────────►
3434
inputConfig | | amplitude
3535
───────────►│ ├────────►
36-
│ ToF │ error
36+
│ ToF │ phase
3737
input | ├────────►
3838
───────────►│ │ intensity
3939
│ ├────────►
4040
└───────────┘
4141
4242
43-
4443
**Message types**
4544

4645
- ``inputConfig`` - :ref:`ToFConfig`
4746
- ``input`` - :ref:`ImgFrame`
4847
- ``depth`` - :ref:`ImgFrame` - Decoded depth map
4948
- ``amplitude`` - :ref:`ImgFrame`
50-
- ``intensity`` - :ref:`ImgFrame`
5149
- ``phase`` - :ref:`ImgFrame` Phase image, useful for debugging (FP32)
50+
- ``intensity`` - :ref:`ImgFrame`
5251

5352
ToF Settings
5453
############
5554

56-
In :ref:`ToF depth` example we allow users to quickly configure ToF settings. These are mostly for debugging, and should be enabled:
57-
58-
- FPPN Correction; It's a process that corrects the fixed pattern noise (FPN) of the ToF sensor. It's enabled by default for best performance.
59-
- Wiggle Correction: It's a process that corrects the wiggle effect of the ToF sensor. It's enabled by default for best performance.
60-
- Temperature Correction: It's a process that corrects the temperature effect of the ToF sensor. It's enabled by default for best performance.
55+
In :ref:`ToF depth` example we allow users to quickly configure ToF settings.
6156

62-
And these settings are up to the user:
57+
Here are the most important settings:
6358

6459
* Optical Correction: It's a process that corrects the optical effect. When enabled, the ToF returns depth map (represented by Green Line on graph below) instead of distance, so it matches :ref:`StereoDepth` depth reporting. It does rectification and distance to depth conversion (Z-map).
65-
* Phase Unwrapping - Process that corrects the phase wrapping effect of the ToF sensor. You can set it to [0..5 are optimized]. The higher the number, the longer the ToF range, but it also increases the noise.
60+
* Phase Unwrapping - Process that corrects the phase wrapping effect of the ToF sensor. You can set it to [0..5 are optimized]. The higher the number, the longer the ToF range, but it also increases the noise. Approximate max distance (for exact value, see :ref:`Max distance` below):
6661

67-
* `0` - Disabled, up to ~1.5 meters
68-
* `1` - Up to ~3 meters
69-
* `2` - Up to ~4.5 meters
70-
* `3` - Up to ~6 meters
71-
* `4` - Up to ~7.5 meters
62+
* `0` - Disabled, up to ~1.87 meters
63+
* `1` - Up to ~3.75 meters
64+
* `2` - Up to ~5.62 meters
65+
* `3` - Up to ~7.5 meters
66+
* `4` - Up to ~9.37 meters
7267

7368
* Burst mode: When enabled, ToF node won't reuse frames, as shown on the graph below. It's related to post-processing of the ToF frames, not the actual sensor/projector. It's disabled by default.
7469
* Phase shuffle Temporal filter: Averages shuffled and non-shuffled frames of the same modulation frequency to reduce noise. It's enabled by default. You can disable it to reduce :ref:`ToF motion blur` and system load.
7570

71+
These are mostly for debugging, and should be enabled:
72+
73+
- FPPN Correction; It's a process that corrects the fixed pattern noise (FPN) of the ToF sensor. It's enabled by default for best performance.
74+
- Wiggle Correction: It's a process that corrects the wiggle effect of the ToF sensor. It's enabled by default for best performance.
75+
- Temperature Correction: It's a process that corrects the temperature effect of the ToF sensor. It's enabled by default for best performance.
76+
7677
.. image:: /_static/images/components/tof-optical-correction.png
7778

79+
Here's the time diagram which showcases how ToF decoding gets done based on the settings.
80+
7881
.. image:: /_static/images/components/tof-diagram.png
7982

8083
Phase unwrapping
8184
################
8285

83-
If the time it takes for the light to travel from ToF sensor and back exceeds the period of the emitted wave (1.5m or 1.8m), the resulting measurement will "wrap" back to a lower value. This is called phase wrapping.
86+
If the time it takes for the light to travel from ToF sensor and back exceeds the period of the emitted wave (1.5m or 1.87m), the resulting measurement will "wrap" back to a lower value. This is called phase wrapping.
8487
It's similar to how a clock resets after 12 hours. Phase unwrapping is possible as our ToF has two different modulation frequencies (80Mhz and 100MHz).
8588

8689
Phase unwrapping aims to correct this by allowing the sensor to interpret longer distances without confusion. It uses algorithms to keep track of how many cycles (round trips of the wave) have occurred,
@@ -93,25 +96,27 @@ To reduce motion blur, we recommend these settings:
9396

9497
- Increase camera FPS. It goes up to 160 FPS, which causes frame capture to be the fastest (6.25ms between frames). This will reduce motion blur as ToF combines multiple frames to get the depth. Note that 160FPS will increase system load significantly (see :ref:`Debugging <Debugging DepthAI pipeline>`). Note also that higher FPS -> lower exposure times, which can increase noise.
9598
- Disable phase shuffle temporal filter. This will introduce more noise.
96-
- Disable phase unwrapping. This will reduce max distance to 1.5 meters, so about 1 cubic meter of space will be visible.
99+
- Disable phase unwrapping. This will reduce max distance to 1.87 meters, so about 1 cubic meter of space will be visible.
97100
- Enable burst mode. This is irrelevant if shuffle filter and phase unwrapping are disabled (see diagram above). When enabled, ToF node won't reuse frames (lower FPS).
98101

102+
In the diagram above, the less frames are combined (bottom of the diagram), the less motion blur there is. The more frames are combined (top of the diagram), there's more filtering (better accuracy) but it results in more motion blur.
103+
99104
Max distance
100105
############
101106

102-
Maximum ToF distance depends on the phase unwrapping level and modulation frequency. The formula for calculating the maximum distance is:
107+
Maximum ToF distance depends on the modulation frequency and the phase unwrapping level. If phase unwrapping is enabled,
108+
max distance is the larger of both modulation frequencies (so max distance at 80MHz). Here's the formula:
103109

104110
.. math::
105111
:nowrap:
106112
107113
\begin{align*}
108114
c & = 299792458.0 \quad \text{//! speed of light in m/s} \\
109-
MAX\_80MHZ\_MM & = \frac{c}{80000000 \times 2} \times 1000 \quad \text{//! convert speed of light to mm/160ns} \\
110-
MAX\_MM\_80MHZ & = \text{round}(MAX\_80MHZ\_MM) \quad \text{// round(1873.7) -> 1874} \\
111-
MAX\_DIST\_80MHZ & = (\text{phaseUnwrappingLevel} + 1) \times 1.5 \times 1000 + \frac{\text{phaseUnwrapErrorThreshold}}{2} \quad \text{//! corrected formula in mm for 80 MHz} \\
112-
MAX\_100MHZ\_MM & = \frac{c}{100000000 \times 2} \times 1000 \quad \text{//! convert speed of light to mm/200ns} \\
113-
MAX\_MM\_100MHZ & = \text{round}(MAX\_100MHZ\_MM) \quad \text{// round(1498.9636) -> 1499} \\
114-
MAX\_DIST\_100MHZ & = (\text{phaseUnwrappingLevel} + 1) \times 1.5 \times 1000 + \frac{\text{phaseUnwrapErrorThreshold}}{2} \quad \text{//! corrected formula in mm for 100 MHz} \\
115+
MAX\_80MHZ\_M & = \frac{c}{80000000 \times 2} = 1.873 \, \text{m}
116+
MAX\_100MHZ\_M & = \frac{c}{100000000 \times 2} = 1.498 \, \text{m}
117+
MAX\_DIST\_80MHZ_M & = (\text{phaseUnwrappingLevel} + 1) \times 1.873 + \frac{\text{phaseUnwrapErrorThreshold}}{2}
118+
MAX\_DIST\_100MHZ_M & = (\text{phaseUnwrappingLevel} + 1) \times 1.498 + \frac{\text{phaseUnwrapErrorThreshold}}{2}
119+
MAX\_DIST\_PHASE\_UNWRAPPING\_M & = MAX\_DIST\_80MHZ\_M
115120
\end{align*}
116121
117122
Usage

docs/source/samples/ToF/tof_depth.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ on the ToF sensor.
1717

1818
With keyboard you can configure ToF settings:
1919

20-
- FPPN Correction; Turn on/off with `f`. It's a process that corrects the fixed pattern noise (FPN) of the ToF sensor. Should be enabled.
21-
- Wiggle Correction: Turn on/off with `w`. It's a process that corrects the wiggle effect of the ToF sensor. Should be enabled.
22-
- Temperature Correction: Turn on/off with `t`. It's a process that corrects the temperature effect of the ToF sensor. Should be enabled.
23-
- Optical Correction: Turn on/off with `o`. It's a process that corrects the optical effect (On -> ToF returns distance represented by Green Line), so it matches stereo depth reporting.
24-
- Phase Unwrapping - Process that corrects the phase wrapping effect of the ToF sensor. The higher the number, the longer the ToF range, but it also increases the noise.
25-
- `0` - Disabled, up to ~1.5 meters
26-
- `1` - Up to ~3 meters
27-
- `2` - Up to ~4.5 meters
28-
- `3` - Up to ~6 meters
29-
- `4` - Up to ~7.5 meters
30-
- `5` - Up to ~9 meters (increased noise - not recommended for most applications)
20+
* *FPPN Correction*; Turn on/off with `f`. It's a process that corrects the fixed pattern noise (FPN) of the ToF sensor. Should be enabled.
21+
* *Wiggle Correction*: Turn on/off with `w`. It's a process that corrects the wiggle effect of the ToF sensor. Should be enabled.
22+
* *Temperature Correction*: Turn on/off with `t`. It's a process that corrects the temperature effect of the ToF sensor. Should be enabled.
23+
* *Optical Correction*: Turn on/off with `o`. It's a process that corrects the optical effect (On -> ToF returns distance represented by Green Line), so it matches stereo depth reporting.
24+
* *Phase Unwrapping* - Process that corrects the phase wrapping effect of the ToF sensor. The higher the number, the longer the ToF range, but it also increases the noise.
25+
26+
* `0` - Disabled, up to ~1.87 meters
27+
* `1` - Up to ~3.75 meters
28+
* `2` - Up to ~5.62 meters
29+
* `3` - Up to ~7.5 meters
30+
* `4` - Up to ~9.37 meters
3131

3232
.. image:: /_static/images/components/tof-optical-correction.png
3333

0 commit comments

Comments
 (0)