DepthAI v2 has been superseded by DepthAI v3. You are viewing legacy documentation.
DepthAI 教程
DepthAI API 参考

本页目录

  • Demo
  • Setup
  • Source code
  • Pipeline

相机流去畸变

本示例展示了如何使用Camera节点来去畸变大视场相机流。Camera节点将自动对stillvideopreview流进行去畸变,而isp流将保持不变。

Demo

Setup

请运行安装脚本以下载所有必需的依赖项。请注意,此脚本必须在 git 上下文中运行,因此您需要先下载 depthai-python 仓库,然后运行该脚本。
Command Line
1git clone https://github.com/luxonis/depthai-python.git
2cd depthai-python/examples
3python3 install_requirements.py
更多信息,请参考安装指南

Source code

Python

Python
GitHub
1#!/usr/bin/env python3
2
3import depthai as dai
4import cv2
5
6pipeline = dai.Pipeline()
7
8# Define sources and outputs
9camRgb: dai.node.Camera = pipeline.create(dai.node.Camera)
10
11#Properties
12camRgb.setBoardSocket(dai.CameraBoardSocket.CAM_A)
13camRgb.setSize((1280, 800))
14
15# Linking
16videoOut = pipeline.create(dai.node.XLinkOut)
17videoOut.setStreamName("video")
18camRgb.video.link(videoOut.input)
19
20ispOut = pipeline.create(dai.node.XLinkOut)
21ispOut.setStreamName("isp")
22camRgb.isp.link(ispOut.input)
23
24with dai.Device(pipeline) as device:
25    video = device.getOutputQueue(name="video", maxSize=1, blocking=False)
26    isp = device.getOutputQueue(name="isp", maxSize=1, blocking=False)
27
28    while True:
29        if video.has():
30            cv2.imshow("video", video.get().getCvFrame())
31        if isp.has():
32            cv2.imshow("isp", isp.get().getCvFrame())
33        if cv2.waitKey(1) == ord('q'):
34            break

C++

WIP

Pipeline

需要帮助?

请前往 OAKChina 官网 获取技术支持或解答您的任何疑问。