cvNamedWindow("test");
CvCapture* capture = cvCreateFileCapture("test.avi");
IplImage* frame;
char c;
while(1)
{
cvGrabFrame(capture);
frame = cvRetrieveFrame(capture);
if(!frame) break;
cvShowImage("test", frame);
c = cvWaitKey(33);
if( c == 27) break;
}
cvReleaseCapture(&capture);
cvDestroyAllWindows();
=================================================================
가장 기본적인 동영상 재생 함수.
추가적으로 영상의 전체 프레임 수를 얻고싶으면
int TotalFrame= (int)cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_COUNT);
위 함수를 이용하여 구할 수 있다.
'Programming > OpenCV' 카테고리의 다른 글
OpenCV 주요함수 (0) | 2013.04.29 |
---|---|
cvHoughLines2 함수를 이용한 직선 검출 (0) | 2013.04.29 |
Haar Face Detection (0) | 2013.04.02 |
[Function] FindContour 덩어리 찾기 (0) | 2013.04.02 |
Duglas Puecker 외곽선 근사화 (0) | 2013.04.02 |