0

このビデオは、CodeBlocks を使用して OpenCV-2.4.2 でビデオを表示するために作成しました。これまでのところ、ファイルは正常にコンパイルされていますが、ビデオが再生されていないようで、表示と表示ウィンドウが非常に小さいため、最小化、最大化、閉じるボタンしか表示されません。以下は私のコードです。ありがとう。

     using namespace cv;
     using namespace std;

     void info()
     {
         cout << "This program will accept input video with fixed lengths and produce video textures" << endl;
     }

     int main(int argc, char *argv[])
     {
         info();
         if(argc != 2)
         {
            cout << "Please enter more parameters" << endl;
            return -1;

         }

         const string source = argv[1];
         VideoCapture input_vid(source);
         if(! input_vid.isOpened())
         {
           cout << "Error: Could not find input video file" << source << endl;
           return -1;
         }

         const char* PLAY = "Video player";

         namedWindow(PLAY, 0);
         setWindowProperty(PLAY, CV_WND_PROP_AUTOSIZE,CV_WINDOW_AUTOSIZE);

         for(;;)
         {
           Mat frame;
           input_vid >> frame;
         }

          return 0;
    }
4

1 に答える 1

3

フレームをウィンドウにプッシュする必要があります

imshow(PLAY, frame);
于 2013-02-19T12:39:48.493 に答える