DepthAI v2 has been superseded by DepthAI v3. You are viewing legacy documentation.

本页目录

  • 管道初始步骤
  • 指定OpenVINO版本
  • 使用多个设备
  • 如何放置
  • 参考

管道

管道是节点及其连接的集合。 这种流程为用户提供了极大的灵活性,可用于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