// 2_7.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <cv.h>
#include <cvcam.h>
#include <cxcore.h>
#include <highgui.h>
#pragma comment(lib,"cv.lib")
#pragma comment(lib,"cvcam.lib")
#pragma comment(lib,"cxcore.lib")
#pragma comment(lib,"highgui.lib")
int main(int argc, char* argv[])
{
CvCapture *pCapture = cvCreateCameraCapture(CV_CAP_ANY);
assert(pCapture != NULL);
IplImage *pImage =cvQueryFrame(pCapture);
assert(pImage != NULL);
cvNamedWindow("Show",CV_WINDOW_AUTOSIZE);
while ( (pImage= cvQueryFrame(pCapture))!=NULL )
{
cvShowImage("Show",pImage);
if (27 == cvWaitKey(30))
{
break;
}
}
cvReleaseCapture(&pCapture);
cvDestroyWindow("Show");
return 0;
}