消息
Messages 条目下。您可以点击它们以了解更多信息。在 Script 节点中创建消息
cam.inputControl)。Python
1script = pipeline.create(dai.node.Script)
2script.setScript("""
3 # 创建一条消息
4 ctrl = CameraControl(1)
5 # 配置消息
6 ctrl.setCaptureStill(True)
7 # 从 Script 节点发送消息
8 node.io['out'].send(ctrl)
9""")在主机上创建消息
Python
1# 创建 XLinkIn 节点并配置它
2xin = pipeline.create(dai.node.XLinkIn)
3xin.setStreamName("frameIn")
4xin.out.link(nn.input) # 将其连接到 NeuralNetwork 的输入
5
6with dai.Device(pipeline) as device:
7 # 创建输入队列,允许您向设备发送消息
8 qIn = device.getInputQueue("frameIn")
9 # 创建 ImgFrame 消息
10 img = dai.ImgFrame()
11 img.setData(frame)
12 img.setWidth(300)
13 img.setHeight(300)
14 qIn.send(img) # 将消息发送到设备