forked from pbaret/stitching
-
Notifications
You must be signed in to change notification settings - Fork 0
/
video.cpp
47 lines (34 loc) · 993 Bytes
/
video.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <stdio.h>
#include <iostream>
#include "opencv2/core/core.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/nonfree/nonfree.hpp"
#include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/imgproc/imgproc.hpp"
using namespace cv;
void readme();
/** @function main */
int main( int argc, char** argv )
{
if( argc != 2 )
{ readme(); return -1; }
string filename = "test/test_winter.mp4";
VideoCapture capture(filename);
capture.set(CV_CAP_PROP_FOURCC, CV_FOURCC('A', 'V', 'C', '1'));
Mat frame;
if( !capture.isOpened() )
throw "Error when reading steam_avi";
namedWindow( "w", 1);
for(int i=0 ; i<100 ;i++ )
{
capture >> frame;
imshow("w", frame);
waitKey(0); // waits to display frame
}
waitKey(0); // key press to close window
return 0;
}
/** @function readme */
void readme()
{ std::cout << " Usage: video < video_file >" << std::endl; }