NeuralDepth
NeuralDepth
Supported on:RVC4
NeuralDepth 仅支持安装了 Luxonis OS 1.20.4 或更高版本 的 RVC4 设备。
如何放置它
Python
Python
1pipeline = dai.Pipeline()
2neuralDepth = pipeline.create(dai.node.NeuralDepth)输入和输出
模型大小
| 模型 | 分辨率 | FPS |
|---|---|---|
NEURAL_DEPTH_LARGE | 768x480 | 10.8 |
NEURAL_DEPTH_MEDIUM | 576x360 | 25.5 |
NEURAL_DEPTH_SMALL (默认) | 480x300 | 42.5 |
NEURAL_DEPTH_NANO | 384x240 | 59.7 |
后处理
- 置信度阈值:低于此阈值的像素被视为无效。有效范围为 [0, 255],默认值为 125。
- 边缘阈值:边缘幅度低于此值的像素被视为无效。有效范围为 [0, 255],默认值为 10。
- 时间滤波器:对深度值进行时间平均以减少噪声。该滤波器具有以下参数:
enable:布尔值,用于启用/禁用滤波器(默认值:false)alpha:指数移动平均平 滑因子,范围为 [0, 1]。较低的值提供更多平滑(非常适合静态场景),值为 1.0 时实际上相当于直通(默认值:0.4)delta:视差变化检测的阈值,范围为 [0, 255]。仅过滤掉视差变化(当前帧与上一帧)低于此值的像素,否则该像素的过滤将被禁用(默认值:100)
校正
setRectification(false) 禁用它。用法
Python
Python
1import depthai as dai
2
3pipeline = dai.Pipeline()
4
5# 创建单目摄像头
6monoLeft = pipeline.create(dai.node.Camera).build(dai.CameraBoardSocket.CAM_B)
7monoRight = pipeline.create(dai.node.Camera).build(dai.CameraBoardSocket.CAM_C)
8
9# 创建输出
10leftOutput = monoLeft.requestOutput((640, 400))
11rightOutput = monoRight.requestOutput((640, 400))
12
13# 创建 NeuralDepth 节点
14neuralDepth = pipeline.create(dai.node.NeuralDepth)
15neuralDepth.build(leftOutput, rightOutput, dai.DeviceModelZoo.NEURAL_DEPTH_SMALL)
16
17# 配置后处理
18neuralDepth.initialConfig.setConfidenceThreshold(125)
19neuralDepth.initialConfig.setEdgeThreshold(10)
20
21neuralDepth.initialConfig.postProcessing.temporalFilter.enable = True
22neuralDepth.initialConfig.postProcessing.temporalFilter.delta = 100
23neuralDepth.initialConfig.postProcessing.temporalFilter.alpha = 0.4
24
25# 创建输出队列
26depthQueue = neuralDepth.depth.createOutputQueue()功能示例
- Neural Depth Minimal - 演示基本 NeuralDepth 用法的最小示例,具有视差输出可视化。
- Neural Depth - 演示 NeuralDepth 节点,可运行时配置置信度阈值、边缘阈值和时间过滤。
- Neural Depth RGBD - 将 NeuralDepth 与 RGBD 节点结合使用以生成点云,可通过远程连接查看。
- Neural Depth Align - 演示使用 ImageAlign 节点将 NeuralDepth 输出与 RGB 摄像头对齐。
参考
class
dai::node::NeuralDepth
variable
std::shared_ptr< NeuralDepthConfig > initialConfig
variable
variable
Subnode< MessageDemux > messageDemux
variable
Subnode< Rectification > rectification
variable
Subnode< NeuralNetwork > neuralNetwork
variable
variable
variable
variable
variable
Input inputConfig
Input config to modify parameters in runtime.
variable
variable
Input leftInternal
Input left frame internal, used to extract frame info
variable
Input rightInternal
Input right frame internal, used to extract frame info
variable
variable
variable
variable
function
NeuralDepth()function
NeuralDepth & setRectification(bool enable)Enable or disable rectification (useful for prerectified inputs)
function
std::shared_ptr< NeuralDepth > build(Output & left, Output & right, DeviceModelZoo model)function
void buildInternal()需要帮助?
请前往 Discussion Forum 获取技术支持或提出您可能有的任何其他问题。