opencv 学习------摄像头采集图像
#include "stdafx.h"#include <opencv2/opencv.hpp>using namespace cv;using namespace std;int main(){//从摄像头读入视频VideoCapture capture(0);//循环显示每一帧while (1){Mat frame; //Mat变量,用于存储每一帧的图像capture >&g
·
#include "stdafx.h"
#include <opencv2/opencv.hpp>
using namespace cv;
using namespace std;
int main()
{
//从摄像头读入视频
VideoCapture capture(0);
//循环显示每一帧
while (1)
{
Mat frame; //Mat变量,用于存储每一帧的图像
capture >> frame; //读取当前帧
imshow("读取视频", frame); //显示当前帧
waitKey(30); //延时30ms
}
return 0;
}
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐



所有评论(0)