DepthAI v2 has been superseded by DepthAI v3. You are viewing legacy documentation.
此页面由 AI 自动翻译。查看英文原版
DepthAI 教程
DepthAI API 参考
最后更新

本页目录

  • 演示
  • 设置
  • 源代码
  • 流水线
Claude CodeCodexCursor
Luxonis 智能体工具包为你常用的编程智能体加载 Luxonis 上下文与技能,更快地基于 OAK 开发应用。
安装工具包

相机流去畸变

最后更新
本示例展示了如何使用 Camera 节点对广角 FOV 相机流进行去畸变。Camera 节点将自动对 still、video 和 preview 流进行去畸变,而 isp 流将保持不变。

演示

设置

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

源代码

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

流水线

需要帮助?

请访问讨论论坛以获取技术支持或您可能有的任何其他问题。