Skip to content

Commit 50aa4f8

Browse files
sturkmen72alalek
authored andcommitted
Merge pull request opencv#9686 from sturkmen72:patch-1
Update planar_tracking.cpp (opencv#9686)
1 parent 3f794cd commit 50aa4f8

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

samples/cpp/tutorial_code/features2D/AKAZE_tracking/planar_tracking.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,8 @@ Mat Tracker::process(const Mat frame, Stats& stats)
125125

126126
int main(int argc, char **argv)
127127
{
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-
132128
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();
133130
string input_path = parser.get<string>(0);
134131
string video_name = input_path;
135132

@@ -158,11 +155,16 @@ int main(int argc, char **argv)
158155
example::Tracker orb_tracker(orb, matcher);
159156

160157
Mat frame;
161-
video_in >> frame;
162158
namedWindow(video_name, WINDOW_NORMAL);
163-
cv::resizeWindow(video_name, frame.size());
159+
cout << "\nPress 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+
}
164167

165-
cout << "Please select a bounding box, and press any key to continue." << endl;
166168
vector<Point2f> bb;
167169
cv::Rect uBox = cv::selectROI(video_name, frame);
168170
bb.push_back(cv::Point2f(static_cast<float>(uBox.x), static_cast<float>(uBox.y)));

0 commit comments

Comments
 (0)