MyWikkaSite : myopencvsample

HomePage :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register
1. avi 영상에서 영상가져오기
cvCamPlayavi는 cvcam.h에 의존적임. opencv1.0까지만 구현되어 있으며.. 차후 버전에서는 제외됨.
따라서 File기반으로 변경해서 영상 캡춰함
난 영상이 반반 쪼개져서 나오는데 연화는 정상으로 나온다고 하는군..
  1. int main( int argc, char** argv )
  2. {
  3.     IplImage  *frame;
  4.     int       key=NULL;
  5.    
  6.     /* load the AVI file */
  7.     CvCapture *capture = cvCreateFileCapture("shade02.avi");
  8.    
  9.     /* always check */
  10.     if( !capture ) return 1;   
  11.    
  12.     /* get fps, needed to set the delay */
  13.     int fps = ( int )cvGetCaptureProperty( capture, CV_CAP_PROP_FPS );
  14.    
  15.     /* display video */
  16.     cvNamedWindow( "video", CV_WINDOW_AUTOSIZE );
  17.    
  18.     while( key != 'q' ) {
  19.         /* get a frame */
  20.         frame = cvQueryFrame( capture );
  21.         
  22.         /* always check */
  23.         if( !frame ) break;
  24.    
  25.         /* display frame */
  26.         cvShowImage( "video", frame );
  27.         
  28.         /* quit if user press 'q' */
  29.         key = cvWaitKey( 1000 / fps );
  30.     }
  31.    
  32.     /* free memory */
  33.     cvReleaseCapture( &capture );
  34.     cvDestroyWindow( "video" );
  35.  
  36.     return 0;
  37. }

There are no comments on this page. [Add comment]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.2
Page was generated in 0.0148 seconds