流水线
源代码
Python
PythonGitHub
1#!/usr/bin/env python3
2"""Minimal ToF script showing the main output stream.
3
4Displays depth.
5For more streams, see tof_all_queues.py.
6
7Press 'q' to quit.
8"""
9
10import cv2
11import depthai as dai
12
13FPS = 30.0
14
15
16def main():
17 pipeline = dai.Pipeline()
18
19 minDepth = 100.0
20 maxDepth = 7000.0
21
22 profile = dai.ToFConfig.Profile.MID_RANGE
23
24 tof = pipeline.create(dai.node.ToF).build(
25 boardSocket=dai.CameraBoardSocket.AUTO,
26 profile=profile,
27 fps=FPS,
28 )
29
30 depthOutputQueue = tof.depth.createOutputQueue()
31
32 with pipeline as p:
33 p.start()
34 while p.isRunning():
35 depth = depthOutputQueue.get()
36 cv2.imshow("depth", dai.utility.colorizeDepthFrame(depth, minDepth, maxDepth, useLog=True).getCvFrame())
37
38 if cv2.waitKey(1) == ord("q"):
39 break
40
41
42if __name__ == "__main__":
43 main()需要帮助?
请访问讨论论坛以获取技术支持或您可能有的任何其他问题。