#include "stdafx.h"
#include <opencv2\opencv.hpp>
#include <iostream>
#include <string>
using namespace cv;
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
cvNamedWindow("我的攝像頭", CV_WINDOW_AUTOSIZE);
//captue = cvCaptureFromCAM(0);
VideoCapture captue(0);//創建一個攝像頭對象並且指定攝像頭編號,只有一個寫0就可以
//captue = cvCreateCameraCapture(0);
Mat frame;
while (1)
{
captue >> frame;
imshow("我的攝像頭", frame);
waitKey(30);
}
return 0;
}
