1. #include <iostream>
  2. #include <string>
  3. #include <cassert>
  4. using namespace std;
  5.  
  6. #include <cv.h>
  7. #include <cxcore.h>
  8. #include <cvaux.h>
  9. #include <highgui.h>
  10.  
  11. int main()
  12. {
  13. CvCapture *cap = cvCreateCameraCapture( -1 ); // Capture用オブジェクト生成
  14. assert( cap != NULL );
  15.  
  16. string wname( "Capture" );
  17. cvNamedWindow( wname.c_str() ); // Window生成
  18.  
  19. while( cvWaitKey( 1 ) != 0x1b ) { // ESCで終了
  20. cvShowImage( wname.c_str(), cvQueryFrame( cap ) );
  21. }
  22.  
  23. cvDestroyWindow( wname.c_str() ); // Window破棄
  24. cvReleaseCapture( &cap ); // Capture用オブジェクト破棄
  25. }
  26.  

タグ:

c++ opencv
最終更新:2007年06月15日 20:20