Mercurial Hosting > traffic-intelligence
comparison c/feature-based-tracking.cpp @ 681:acce61a1edc8 dev
merged bug fix with stable
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Fri, 05 Jun 2015 02:25:50 +0200 |
parents | 576d9ea4b41a |
children | 70a3cdf0dbb3 |
comparison
equal
deleted
inserted
replaced
680:da1352b89d02 | 681:acce61a1edc8 |
---|---|
19 #include <iostream> | 19 #include <iostream> |
20 #include <vector> | 20 #include <vector> |
21 #include <ctime> | 21 #include <ctime> |
22 #include <cmath> | 22 #include <cmath> |
23 #include <memory> | 23 #include <memory> |
24 #include <limits> | |
24 | 25 |
25 using namespace std; | 26 using namespace std; |
26 using namespace cv; | 27 using namespace cv; |
27 | 28 |
28 void drawMatchesRelative(const vector<KeyPoint>& train, const vector<KeyPoint>& query, std::vector<cv::DMatch>& matches, Mat& img) { | 29 void drawMatchesRelative(const vector<KeyPoint>& train, const vector<KeyPoint>& query, std::vector<cv::DMatch>& matches, Mat& img) { |
99 exit(0); | 100 exit(0); |
100 } | 101 } |
101 | 102 |
102 Size videoSize = Size(capture.get(CV_CAP_PROP_FRAME_WIDTH), capture.get(CV_CAP_PROP_FRAME_HEIGHT)); | 103 Size videoSize = Size(capture.get(CV_CAP_PROP_FRAME_WIDTH), capture.get(CV_CAP_PROP_FRAME_HEIGHT)); |
103 unsigned int nFrames = capture.get(CV_CAP_PROP_FRAME_COUNT); | 104 unsigned int nFrames = capture.get(CV_CAP_PROP_FRAME_COUNT); |
105 if (nFrames <= 0) { | |
106 cout << "Guessing that the number of frames could not be read: " << nFrames << endl; | |
107 nFrames = numeric_limits<int>::max(); | |
108 cout << "Setting arbitrarily high number for testing: " << nFrames << endl; | |
109 } | |
110 | |
104 cout << "Video " << params.videoFilename << | 111 cout << "Video " << params.videoFilename << |
105 ": width=" << videoSize.width << | 112 ": width=" << videoSize.width << |
106 ", height=" << videoSize.height << | 113 ", height=" << videoSize.height << |
107 ", nframes=" << nFrames << endl; | 114 ", nframes=" << nFrames << endl; |
108 | 115 |