人脸识别-调用摄像头

源代码:

#include <opencv2/highgui/highgui.hpp>  
#include <opencv2/imgproc/imgproc.hpp>  
#include <opencv2/core/core.hpp>  
using namespace cv;
//调用摄像头
int main()
{
	VideoCapture cap(0);
	Mat frame;
	while (1)
	{
		cap >> frame;
		imshow("调用摄像头", frame);
		waitKey(30);
	}
	return 0;
}

原文地址:https://www.cnblogs.com/kuangqiu/p/7763745.html