#include "stdafx.h"
#include "Opencvhead.h"
#include <iostream>
using namespace std;
using namespace cv;
int _tmain(int argc, _TCHAR* argv[])
{
VideoCapture cap(0);
if(!cap.isOpened())
{
cout<<"Can't open the video cam"<<endl;
return -1;
}
namedWindow("MyVideo",CV_WINDOW_AUTOSIZE);
Mat frame;
char ch;
while(true)
{
cap >> frame;
if(frame.empty())
break;
imshow("MyVideo", frame); //show the frame in "MyVideo" window
ch = waitKey(30);
if( ch == 27)
break;
}
return 0;
}
open camera
最新推荐文章于 2024-06-09 09:58:52 发布