Python
1output = camera_node.requestOutput(
2 size=(640, 480),
3 type=dai.ImgFrame.Type.BGR888p,
4 resize_mode=dai.ImgResizeMode.CROP,
5 fps=15
6)CROP、STRETCH 或 LETTERBOX,当传感器宽高比 (AR) 与请求的宽高比不匹配时,这些模式就会发挥作用。有关更多信息(每种模式的优缺点),请查看 输入帧 AR 不匹配 文档。摄像头多输出 示例展示了如何从 Camera 节点请求多个输出。此示例需要 DepthAI v3 API,请参阅 安装说明。管道
源代码
Python
PythonGitHub
1#!/usr/bin/env python3
2
3import cv2
4import depthai as dai
5
6# Create pipeline
7with dai.Pipeline() as pipeline:
8 # Define source and output
9 cam = pipeline.create(dai.node.Camera).build()
10 videoQueue = cam.requestOutput((640,400)).createOutputQueue()
11
12 # Connect to device and start pipeline
13 pipeline.start()
14 while pipeline.isRunning():
15 videoIn = videoQueue.get()
16 assert isinstance(videoIn, dai.ImgFrame)
17 cv2.imshow("video", videoIn.getCvFrame())
18
19 if cv2.waitKey(1) == ord("q"):
20 break需要帮助?
请访问讨论论坛以获取技术支持或您可能有的任何其他问题。