DepthAI v2 has been superseded by DepthAI v3. You are viewing legacy documentation.
此页面由 AI 自动翻译。查看英文原版

本页目录

  • 如何放置
  • 输入和输出
  • 用法
  • 功能示例
  • 参考

XLinkIn

XLinkIn 节点用于通过 XLink 将数据从主机发送到设备。

如何放置

Python

Python
1pipeline = dai.Pipeline()
2xlinkIn = pipeline.create(dai.node.XLinkIn)

C++

C++
1dai::Pipeline pipeline;
2auto xlinkIn = pipeline.create<dai.node.XLinkIn>();

输入和输出

用法

Python

Python
1pipeline = dai.Pipeline()
2xIn = pipeline.create(dai.node.XLinkIn)
3xIn.setStreamName("camControl")
4
5# 提前创建 ColorCamera
6xIn.out.link(cam.inputControl)
7
8with dai.Device(pipeline) as device:
9  device.startPipeline()
10  qCamControl = device.getInputQueue("camControl")
11
12  # 发送消息给 ColorCamera 以捕获静态图像
13  ctrl = dai.CameraControl()
14  ctrl.setCaptureStill(True)
15  qCamControl.send(ctrl)

C++

C++
1dai::Pipeline pipeline;
2auto xIn = pipeline.create<dai::node::XLinkIn>();
3xIn->setStreamName("camControl");
4
5// 提前创建 ColorCamera
6xIn->out.link(cam->inputControl);
7
8// 连接到设备
9dai::Device device(pipeline);
10device.startPipeline();
11
12auto qCamControl = device.getInputQueue("camControl");
13
14// 发送消息给 ColorCamera 以捕获静态图像
15dai::CameraControl ctrl;
16ctrl.setCaptureStill(true);
17qCamControl->send(ctrl)

功能示例

参考

class

depthai.node.XLinkIn(depthai.Node)

method
getMaxDataSize(self) -> int: int
Get maximum messages size in bytes
method
getNumFrames(self) -> int: int
Get number of frames in pool
method
method
setMaxDataSize(self, maxDataSize: typing.SupportsInt)
Set maximum message size it can receive  Parameter ``maxDataSize``:     Maximum size in bytes
method
setNumFrames(self, numFrames: typing.SupportsInt)
Set number of frames in pool for sending messages forward  Parameter ``numFrames``:     Maximum number of frames in pool
method
setStreamName(self, streamName: str)
Specifies XLink stream name to use.  The name should not start with double underscores '__', as those are reserved for internal use.  Parameter ``name``:     Stream name
property
out
Outputs message of same type as send from host.

需要帮助?

请前往 Discussion Forum 获取技术支持或提出您可能有的任何其他问题。