@@ -125,11 +125,8 @@ Mat Tracker::process(const Mat frame, Stats& stats)
125
125
126
126
int main (int argc, char **argv)
127
127
{
128
- cerr << " Usage: " << endl
129
- << " akaze_track input_path" << endl
130
- << " (input_path can be a camera id, like 0,1,2 or a video filename)" << endl;
131
-
132
128
CommandLineParser parser (argc, argv, " {@input_path |0|input path can be a camera id, like 0,1,2 or a video filename}" );
129
+ parser.printMessage ();
133
130
string input_path = parser.get <string>(0 );
134
131
string video_name = input_path;
135
132
@@ -158,11 +155,16 @@ int main(int argc, char **argv)
158
155
example::Tracker orb_tracker (orb, matcher);
159
156
160
157
Mat frame;
161
- video_in >> frame;
162
158
namedWindow (video_name, WINDOW_NORMAL);
163
- cv::resizeWindow (video_name, frame.size ());
159
+ cout << " \n Press any key to stop the video and select a bounding box" << endl;
160
+
161
+ while ( waitKey (1 ) < 1 )
162
+ {
163
+ video_in >> frame;
164
+ cv::resizeWindow (video_name, frame.size ());
165
+ imshow (video_name, frame);
166
+ }
164
167
165
- cout << " Please select a bounding box, and press any key to continue." << endl;
166
168
vector<Point2f> bb;
167
169
cv::Rect uBox = cv::selectROI (video_name, frame);
168
170
bb.push_back (cv::Point2f (static_cast <float >(uBox.x ), static_cast <float >(uBox.y )));
0 commit comments