#include<opencv2opencv.hpp> using namespace cv; int main() { //从摄像头读取视频 VideoCapture capture; capture.open(0); //循环显示每一帧 while (1) { Mat frame; capture >> frame; imshow("读取视频", frame); waitKey(30);//延时30毫秒 } return 0; }