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

本页目录

  • 管道第一步
  • 指定 OpenVINO 版本
  • 使用多个设备
  • 如何放置它
  • 参考
Claude CodeCodexCursor
Luxonis 智能体工具包为你常用的编程智能体加载 Luxonis 上下文与技能,更快地基于 OAK 开发应用。
安装工具包
最后更新
管道是节点及其之间链接的集合。 这种流程为用户提供了极大的灵活性,可用于他们的 OAK 设备。当管道对象传递给设备 对象时,管道被序列化为 JSON 并通过 XLink 发送到 OAK 设备。

管道第一步

要启动并运行 DepthAI,您必须创建一个管道,用节点填充它,配置节点并将它们链接在一起。之后,管道 可以加载到设备并启动。
Python
1pipeline = depthai.pipeline()
2
3# 如果需要,指定 OpenVINO 版本
4pipeline.setOpenVINOVersion(depthai.OpenVINO.Version.VERSION_2021_4)
5
6# 创建节点,配置它们并将它们链接在一起
7
8# 将管道上传到设备
9with depthai.Device(pipeline) as device:
10  # 设置输入/输出队列以通过 XLink 配置设备/主机通信...

指定 OpenVINO 版本

当使用未用最新 OpenVINO(DepthAI 支持的)编译的 NN blob 时,您必须指定管道的 OpenVINO 版本。 这背后的原因是 OpenVINO 不在 blob 中提供版本。
Python
1pipeline = depthai.pipeline()
2# 设置正确的版本:
3pipeline.setOpenVINOVersion(depthai.OpenVINO.Version.VERSION_2021_4)

使用多个设备

如果用户有多个 Luxonis 设备,每个设备可以运行不同的管道或相同的管道 (此处演示)。要为每个设备使用不同的管道, 您可以创建多个管道并将所需的管道在初始化时传递给所需的设备。 有关更多信息,请参阅多设备设置。

如何放置它

Python

Python
1pipeline = dai.Pipeline()

C++

C++
1dai::Pipeline pipeline;

参考

class

depthai.Pipeline

method
__init__(self)
Constructs a new pipeline
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
getCalibrationData(self) -> CalibrationHandler: CalibrationHandler
gets the calibration data which is set through pipeline  Returns:     the calibrationHandler with calib data in the pipeline
method
method
method
getDeviceConfig(self) -> Device.Config: Device.Config
Get device configuration needed for this pipeline
method
getGlobalProperties(self) -> GlobalProperties: GlobalProperties
Returns:     Global properties of current pipeline
method
method
getNodeMap(self) -> dict[int, Node]: dict[int, Node]
Get a reference to internal node map
method
getOpenVINOVersion(self) -> OpenVINO.Version: OpenVINO.Version
Get possible OpenVINO version to run this pipeline
method
method
method
remove(self, node: Node)
Removes a node from pipeline
method
serializeToJson(self) -> json: json
Returns whole pipeline represented as JSON
method
method
setCalibrationData(self, calibrationDataHandler: CalibrationHandler)
Sets the calibration in pipeline which overrides the calibration data in eeprom  Parameter ``calibrationDataHandler``:     CalibrationHandler object which is loaded with calibration information.
method
setCameraTuningBlobPath(self, path: Path)
Set a camera IQ (Image Quality) tuning blob, used for all cameras
method
setOpenVINOVersion(self, version: OpenVINO.Version)
Set a specific OpenVINO version to use with this pipeline
method
setSippBufferSize(self, sizeBytes: typing.SupportsInt)
SIPP (Signal Image Processing Pipeline) internal memory pool. SIPP is a framework used to schedule HW filters, e.g. ISP, Warp, Median filter etc. Changing the size of this pool is meant for advanced use cases, pushing the limits of the HW. By default memory is allocated in high speed CMX memory. Setting to 0 will allocate in DDR 256 kilobytes. Units are bytes.
method
setSippDmaBufferSize(self, sizeBytes: typing.SupportsInt)
SIPP (Signal Image Processing Pipeline) internal DMA memory pool. SIPP is a framework used to schedule HW filters, e.g. ISP, Warp, Median filter etc. Changing the size of this pool is meant for advanced use cases, pushing the limits of the HW. Memory is allocated in high speed CMX memory Units are bytes.
method
setXLinkChunkSize(self, sizeBytes: typing.SupportsInt)
Set chunk size for splitting device-sent XLink packets, in bytes. A larger value could increase performance, with 0 disabling chunking. A negative value won't modify the device defaults - configured per protocol, currently 64*1024 for both USB and Ethernet.
method