opencv调用摄像头采集图像

#include<opencv2/core.hpp>
#include<opencv2/highgui.hpp>
#include<opencv2/imgproc.hpp>
#include<iostream>
using namespace cv;
using namespace std;
int main()
{
    
    
    VideoCapture cap(0);
    for(;;)
    {
    
    
        Mat frame;
        cap.read(frame);
        imshow("视频",frame);
        waitKey(1);
    }
    return 0;
}

猜你喜欢

转载自blog.csdn.net/seniorc/article/details/112210475