1. avi 영상에서 영상가져오기
cvCamPlayavi는 cvcam.h에 의존적임. opencv1.0까지만 구현되어 있으며.. 차후 버전에서는 제외됨.
따라서 File기반으로 변경해서 영상 캡춰함
난 영상이 반반 쪼개져서 나오는데 연화는 정상으로 나온다고 하는군..
int main( int argc, char** argv )
{
IplImage *frame;
int key=NULL;
/* load the AVI file */
CvCapture *capture = cvCreateFileCapture("shade02.avi");
/* always check */
if( !capture ) return 1;
/* get fps, needed to set the delay */
int fps = ( int )cvGetCaptureProperty( capture, CV_CAP_PROP_FPS );
/* display video */
cvNamedWindow( "video", CV_WINDOW_AUTOSIZE );
while( key != 'q' ) {
/* get a frame */
frame = cvQueryFrame( capture );
/* always check */
if( !frame ) break;
/* display frame */
cvShowImage( "video", frame );
/* quit if user press 'q' */
key = cvWaitKey( 1000 / fps );
}
/* free memory */
cvReleaseCapture( &capture );
cvDestroyWindow( "video" );
return 0;
}
There are no comments on this page. [Add comment]