c++ - 如何使用 opencv 的 VideoCapture 连接 Gopro cam?
问题描述
Visual Studio 和 opencv 使用的是 2019 和 4.4.0 版本
GoPRO HERO 7 BLACK 使用 USB-C 连接到 PC。
我尝试使用 VideoCapture() 打开摄像头,但它没有打开。
下面是正在使用的代码。
#include <opencv2\opencv.hpp>
#include <opencv2\highgui.hpp>
#include <opencv2\core.hpp>
#include <opencv2\imgproc.h>>
using namespace cv;
using namespace std;
int main(void) {
VideoCpature webcam_01(0);
if(!webcam_01.isOpened()) {
cout << "Cam opened error" << endl;
return -1; }
while(1) {
Mat frame;
webcam_01.read(frame);
if(frame.empty()) {
cout << "frame empty" << endl;
break;
}
imshow("img", frame);
}
return 0;
}
解决方案
推荐阅读
- aws-lambda - Lambda 授权方不尊重资源
- spring-cloud-feign - openfeign 和 feign 的区别
- python - Pandas:如何使用其他数据框的列替换数据框中的值
- arduino - 如何在同一代码中使用基于 Web 的代码和真实按钮?
- vb.net - DataGridView 到 Word 列标题未显示
- bixby - bixby 如何读取不显示的文本?
- java - 将字符串转换为 ParseObject
- spring - Spring Boot:静态内容正确提供 CSS 但不提供 JS
- twig - 在 Craft 3 中使用 {% requireLogin %} 时如何设置自定义重定向 URL?
- php - 为什么我在尝试发送电子邮件以使用 phpmailer 激活新用户帐户时收到此错误