ToF 节点将原始飞行时间传感器数据转换为深度,并公开基本输出和过滤输出。它适用于集成 ToF 传感器的 RVC2 和 RVC4 设备,例如:ToF 深度可以直接与空间节点一起使用,例如 SpatialDetectionNetwork 和 SpatialLocationCalculator。有关与立体声深度质量比较,请参阅 ToF 深度精度。如何放置
Python
Python
1pipeline = dai.Pipeline()
2tof = pipeline.create(dai.node.ToF)输入和输出
rawDepth和phase是仅限 RVC2 的输出。raw和confidence是仅限 RVC4 的输出。
ToF 配置文件
| 配置文件 | 大致范围 | 典型用例 |
|---|---|---|
LOW_RANGE | ~10 厘米到 1.5 米 | 短距离应用,例如料箱拣选 |
MID_RANGE (默认) | ~10 厘米到 5 米 | 通用配置文件 |
HIGH_RANGE | 从 ~3 米及更远 | 长距离感应 |
Python
Python
1pipeline = dai.Pipeline()
2
3tof = pipeline.create(dai.node.ToF)
4tof.build(
5 boardSocket=dai.CameraBoardSocket.AUTO,
6 profile=dai.ToFConfig.Profile.MID_RANGE,
7 fps=FPS,
8)架构和输出
RVC4
ToF 节点在计算深度之前在相位域中执行解码和滤波 在设备上。没有数据传输到主机进行滤波。输出为:
depth(uint16, mm)amplitude(uint8, 对数压缩)intensity(uint8, 对数压缩)confidence(uint8, 对数压缩)raw(打包,传感器原生格式)
输出去畸变 (RVC4)
setOutputUndistortion 对 ToF 深度帧进行去畸变。在启动管道之前在 ToF 节点上启用它:Python
Python
1tof.setOutputUndistortion(True)depth 输出上获得。用法
Python
Python
1pipeline = dai.Pipeline()
2
3tof = pipeline.create(dai.node.ToF).build(
4 boardSocket=dai.CameraBoardSocket.AUTO,
5 profile=dai.ToFConfig.Profile.MID_RANGE,
6)
7
8depth_q = tof.depth.createOutputQueue()
9amplitude_q = tof.amplitude.createOutputQueue()
10intensity_q = tof.intensity.createOutputQueue()
11confidence_q = tof.confidence.createOutputQueue()示例
- ToF Minimal - 显示
depth输出的最小管道 - ToF All Queues - 显示 RVC2 和 RVC4 上的所有主要输出队列
- ToF Align - 将 ToF 深度对齐到单目相机
- ToF PointCloud - 流式传输到 DepthAI Visualizer 的彩色点云
- ToF pointcloud + runtime tuning (oak-examples)
参考
class
dai::node::ToF
variable
variable
Output & rawDepth
Raw depth output from ToF sensor. On RVC2 this is connected to the unfiltered base depth output. On RVC4 this is an unconnected placeholder output.
variable
Output & depth
Filtered depth output
variable
Output & amplitude
Amplitude output
variable
Output & intensity
Intensity output
variable
Output & confidence
Confidence output
variable
Output & phase
Phase output
variable
Output & raw
Raw data coming from the sensor
variable
Input & inputConfig
Runtime ToFConfig input for the ToF base node (decoder on RVC2, IPP on RVC4).RVC4: directly reconfigures the IPP that produces depth. RVC2: reconfigures the decoder that feeds the host ImageFilters. The host-filter stage that actually produces depth is NOT controlled here — to retune the host filters at runtime send an ImageFiltersConfig to imageFiltersInputConfig.
variable
variable
Input * imageFiltersInputConfig
Input config for image filters
variable
variable
ImageFilters * imageFiltersNode
Image filters node
inline function
ToF()function
ToF(const std::shared_ptr< Device > & device)function
~ToF()function
void buildInternal()Function called from within the create function to build the node. This function is useful for initialization, setting up inputs and outputs = stuff that cannot be perform in the constuctor.
function
std::shared_ptr< ToF > build(dai::CameraBoardSocket boardSocket, dai::ImageFiltersPresetMode presetMode, std::optional< float > fps)function
std::shared_ptr< ToF > build(dai::CameraBoardSocket boardSocket, dai::ToFConfig::Profile presetMode, std::optional< float > fps)function
std::shared_ptr< ToF > setOutputUndistortion(bool enable)Enable or disable undistortion for depth and auxiliary outputs.
Parameters
- enable: Whether to undistort the outputs.
Note
Undistortion is supported on RVC4. RVC2 logs a warning and leaves outputs unchanged.
Returns
function
void postBuildStage()需要帮助?
请访问讨论论坛以获取技术支持或您可能有的任何其他问题。

