1 #include "opencv2/video/tracking.hpp"
2 #include "opencv2/imgproc.hpp"
3 #include "opencv2/videoio.hpp"
4 #include "opencv2/highgui.hpp"
5
6 #include
7 #include
8 #include
9 #include
10 using namespacestd;11
12
13 using namespacecv;14 void LoadImages(const string &strImagePath, const string &strPathTimes,15 vector &vstrImages, vector &vTimeStamps)16 {17 ifstream fTimes;18 fTimes.open(strPathTimes.c_str());19 vTimeStamps.reserve(5000);20 vstrImages.reserve(5000);21 while(!fTimes.eof())22 {23 strings;24 getline(fTimes,s);25 if(!s.empty())26 {27 stringstream ss;28 ss <>t;32 vTimeStamps.push_back(t/1e9);33
34 }35 }36 }37 static voidhelp()38 {39 //print a welcome message, and the OpenCV version
40 cout << "\nThis is a demo of Lukas-Kanade optical flow lkdemo(),\n