当前位置:网站首页>如何将OAK相机当做网络摄像头使用?
如何将OAK相机当做网络摄像头使用?
2022-06-29 18:04:00 【OAK中国_官方】
编辑:OAK中国
首发:oakchina.cn
喜欢的话,请多多️
▌前言
Hello,大家好,这里是OAK中国,我是助手君。
这个月有好几个朋友想把OAK当UVC相机用,本期内容就来谈谈怎么用吧!
OAK相机也可以用作网络摄像头。要启用此功能,你可以运行DepthAI演示uvc应用程序或使用UVC功能分支。确保使用USB3线,否则在某些情况下,USB2不工作。
▌使用DepthAI演示脚本
首先,安装DepthAI。
如果使用QT GUI,请在此选择UVC应用程序。

或者,直接从终端运行:
python3 depthai_demo.py --app uvc▌使用UVC特征分支
【教程】如何将OAK-D-Lite作为一个网络摄像头使用?
视频链接:B站-OAK中国
# Skip cloning if you already have depthai-python repo
git clone https://github.com/luxonis/depthai-python.git
cd depthai-python
# Navigate to the custom branch
git checkout gen2_uvc
python3 examples/install_requirements.py
python3 examples/rgb_uvc.py现在,你可以打开你最喜欢的会议应用程序,如Zoom或Slack,然后在网络摄像头选择菜单中选择Luxonis Device: UVC Video Contr。
▌变通办法
目前,上述方法存在一些问题。即使在Linux上,UVC节点目前并不适用于所有应用程序。因为UVC代表USB Video Class,使用UVC管道打开OAK PoE系列的设备是不行的。另一个已知问题是在Windows操作系统上使用UVC管道不起作用,因为UVC描述符。以下是解决方法:
1.Python虚拟相机
一种选择是使用虚拟相机,如pyvirtualcam模块。你需要pip安装包并安装它的依赖项(如链接中所述)。这里有一个演示代码:
import pyvirtualcam
import depthai as dai
# Create pipeline
pipeline = dai.Pipeline()
cam = pipeline.create(dai.node.ColorCamera)
cam.setColorOrder(dai.ColorCameraProperties.ColorOrder.RGB)
cam.setPreviewSize(1280,720)
xout = pipeline.create(dai.node.XLinkOut)
xout.setStreamName("rgb")
cam.preview.link(xout.input)
# Connect to device and start pipeline
with dai.Device(pipeline) as device, pyvirtualcam.Camera(width=1280, height=720, fps=20) as uvc:
qRgb = device.getOutputQueue(name="rgb", maxSize=4, blocking=False)
print("UVC running")
while True:
frame = qRgb.get().getFrame()
uvc.send(frame)2.OBS转发UVC数据流
我们注意到,在一些应用上,比如Discord或Google Meet,Luxonis Device: UVC行不通。一种解决方法是使用OBS代理该流并使用OBS内部的虚拟摄像机。我运行的是Linux,为了使虚拟摄像机工作,我必须安装sudo apt install v4l2loopback-dkms(这也在安装说明中提到)。
(二)如何将OAK相机当做网络摄像头使用?OBS转发UVC数据流
视频链接:B站-OAK中国
这段视频将向你展示如何做到这一点。
3.OBS捕获cv2窗口
另一种解决方案是将视频流数据传输到主机,并捕获cv2.imshowOBS内的窗口:
- 在depthai-python repo内部,运行
python3 examples/ColorCamera/rgb_video.py。这将打开一个显示1080P视频流的新窗口。 - 在OBS中,在源菜单下,单击
+,添加新源。 - 点击Window Capture (Xcomposite)选项,然后选择
video。 - 然后,你可以点击Start Video Camera在OBS内部,使用来自OAK PoE设备的视频作为网络摄像头源。
(三)如何将OAK PoE相机当做网络摄像头使用?
视频链接:B站-OAK中国
▌参考资料
https://docs.oakchina.cn/en/latest/
https://www.oakchina.cn/selection-guide/
OAK中国
| OpenCV AI Kit在中国区的官方代理商和技术服务商
| 追踪AI技术和产品新动态
戳「+关注」获取最新资讯
边栏推荐
- Lodash deep copy usage
- Mysql database daily backup and scheduled cleanup script
- 优雅书写Controller(参数验证+统一异常处理)
- kubekey2.2.1 kubernetes1.23.7离线包制作+harbor部暑并上传镜像
- SD6.25集训总结
- 【网络是怎么连接的】第三章 探索集线器,交换机和路由器
- Precondition end of script headers or end of script output before headers
- MySql存储过程循环的使用分析详解
- 数据分析--时间序列预测
- Adobe Premiere基础-不透明度(蒙版)(十一)
猜你喜欢

小迈科技 X Hologres:高可用的百亿级广告实时数仓建设

Codeworks 5 questions per day (1700 for each) - the next day

Stepping on the pit: json Parse and json stringify

kubekey2.2.1 kubernetes1.23.7离线包制作+harbor部暑并上传镜像

Request header field xxxx is not allowed by Access-Control-Allow-Headers in preflight response问题

Xiaomai technology x hologres: high availability of real-time data warehouse construction of ten billion level advertising

牛客小Bai月赛52 D 环上食虫(尺取+st表)

Configure the local domain name through the hosts file

国内酒店交易DDD应用与实践——理论篇

centos 7.5安装mysql 8.0.27----yum
随机推荐
Workflow module jar package startup error: liquibase – waiting for changelog lock
3H proficient in opencv (V) - perspective transformation
Adobe Premiere Basics - common video effects (cropping, black and white, clip speed, mirroring, lens halo) (XV)
数据分析--时间序列预测
Jar包后台启动并输出日志
When easycvr deploys a server cluster, what is the reason why one is online and the other is offline?
Shell basic syntax -- process control
Anaconda安装并配置jupyter notebook远程
【TcaplusDB知识库】TcaplusDB运维单据介绍
【TcaplusDB知识库】TcaplusDB系统用户组介绍
JWT登录验证
Image feature computation and representation -- content based image retrieval
Adobe Premiere foundation - cool text flash (14)
WBF: new method of NMS post filter frame for detection task?
Stepping on the pit: json Parse and json stringify
Elegant writing controller (parameter verification + unified exception handling)
QQ如何开通在线客服
/usr/bin/ld: warning: **libmysqlclient. so. 20**, needed by //usr/
idea怎么使用?
kubekey2.2.1 kubernetes1.23.7离线包制作+harbor部暑并上传镜像