同步
如何放置
Python
Python
1pipeline = dai.Pipeline()
2sync = pipeline.create(dai.node.Sync)输入和输出
消息同步
depthai.node.Sync.setSyncThreshold 和 depthai.node.Sync.setSyncAttempts 方法进行配置。更多信息请参见 参考部分。同步逻辑

使用示例
Python
Python
1pipeline = dai.Pipeline()
2sync = pipeline.create(dai.node.Sync)
3
4# 配置时间戳对齐阈值
5sync.setSyncThreshold(timedelta(milliseconds=50))
6
7# 配置需要同步的输入
8camRgb.video.link(sync.inputs["input1"])
9stereo.depth.link(sync.inputs["input2"])
10
11sync.out.link(xout.input)
12# ...功能示例
参考
class
depthai.node.Sync(depthai.Node)
method
getProcessor(self) -> depthai.ProcessorType: depthai.ProcessorTypeGet on which processor the node should run Returns: Processor type - Leon CSS or Leon MSS
method
getSyncAttempts(self) -> int: intGets the number of sync attempts
method
getSyncThreshold(self) -> datetime.timedelta: datetime.timedeltaGets the maximal interval between messages in the group in milliseconds
method
setProcessor(self, arg0: depthai.ProcessorType)Set on which processor the node should run Parameter ``type``: Processor type - Leon CSS or Leon MSS
method
setSyncAttempts(self, maxDataSize: typing.SupportsInt)Set the number of attempts to get the specified max interval between messages in the group Parameter ``syncAttempts``: Number of attempts to get the specified max interval between messages in the group: - if syncAttempts = 0 then the node sends a message as soon at the group is filled - if syncAttempts > 0 then the node will make syncAttemts attempts to synchronize before sending out a message - if syncAttempts = -1 (default) then the node will only send a message if successfully synchronized
method
setSyncThreshold(self, syncThreshold: datetime.timedelta)Set the maximal interval between messages in the group Parameter ``syncThreshold``: Maximal interval between messages in the group
property
inputs
A map of inputs
property
out
Output message of type MessageGroup
需要帮助?
请前往 OAKChina 官网 获取技术支持或 解答您的任何疑问。