isp 输出。图像信号处理器 (ISP) 是摄像头中的关键组件,有助于成像系统达到所需的输出质量。正是 ISP 将图像传感器传来的原始图像转换为可用形式,进而供嵌入式视觉系统用于各种任务。这个示例需要DepthAI v3 API,参见安装说明。流水线
源代码
Python
PythonGitHub
1import cv2
2import depthai as dai
3
4# Create pipeline
5with dai.Pipeline() as pipeline:
6 # Define source and output
7 cam = pipeline.create(dai.node.Camera).build(dai.CameraBoardSocket.CAM_B)
8 videoQueue = cam.requestOutput((800,400), fps=30).createOutputQueue()
9 videoIsp = cam.requestIspOutput(fps=2).createOutputQueue()
10 # Connect to device and start pipeline
11 pipeline.start()
12 videoIn = videoQueue.get()
13 videoInIsp = videoIsp.get()
14 print(
15 "Standard output resolution = "
16 f"{ videoIn.getCvFrame().shape[1]} x { videoIn.getCvFrame().shape[0]}"
17 )
18 print(
19 f"Isp output resolution = "
20 f"{ videoInIsp.getCvFrame().shape[1]} x { videoInIsp.getCvFrame().shape[0]}"
21 )
22 while pipeline.isRunning():
23 videoIn = videoQueue.tryGet()
24 videoInIsp = videoIsp.tryGet() # Returns 640x400
25 if videoIn:
26 cv2.imshow("video", videoIn.getCvFrame())
27 if videoInIsp:
28 cv2.imshow("videoIsp", videoInIsp.getCvFrame())
29
30 if cv2.waitKey(1) == ord("q"):
31 break需要帮助?
请前往 OAKChina 官网 获取技术支持或解答您的任何疑问。