컴퓨터공부
OPENCV Story #1 동영상을 출력해보자.
BreadHolic
2010. 12. 22. 21:44
// Visual Studio 2008 , OpenCV 2.1
#include "stdafx.h"
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
int _tmain(int argc, _TCHAR* argv[])
{
CvCapture* capture = NULL;
IplImage * frame = 0;
IplImage * frame_copy = 0;
capture = cvCaptureFromFile("sample.avi");
cvNamedWindow("reuslt", 1);
for(;;)
{
if (!cvGrabFrame(capture))
break;
frame = cvRetrieveFrame(capture);
if (!frame)
break;
cvShowImage("result", frame);
if (cvWaitKey(33) >= 0)
break;
}
cvReleaseImage(&frame_copy);
cvReleaseCapture(&capture);
}