From 272ce5938dd739b47185ce1e4b4b4b9cd1531767 Mon Sep 17 00:00:00 2001 From: Gary Bradski Date: Sat, 4 Dec 2010 08:30:00 +0000 Subject: [PATCH] revamped --- samples/cpp/lkdemo.cpp | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/samples/cpp/lkdemo.cpp b/samples/cpp/lkdemo.cpp index 4030a2a7bd..45ba780584 100644 --- a/samples/cpp/lkdemo.cpp +++ b/samples/cpp/lkdemo.cpp @@ -8,6 +8,21 @@ using namespace cv; using namespace std; +void help() +{ + // print a welcome message, and the OpenCV version + cout << "\nThis is a demo of Lukas-Kanade optical flow lkdemo(),\n" + "Using OpenCV version %s\n" << CV_VERSION << "\n" + << endl; + + cout << "\nHot keys: \n" + "\tESC - quit the program\n" + "\tr - auto-initialize tracking\n" + "\tc - delete all the points\n" + "\tn - switch the \"night\" mode on/off\n" + "To add/remove a feature point click it\n" << endl; +} + Point2f pt; bool addRemovePt = false; @@ -41,15 +56,7 @@ int main( int argc, char** argv ) return 0; } - // print a welcome message, and the OpenCV version - cout << "Welcome to lkdemo, using OpenCV version %s\n" << CV_VERSION; - - cout << "\nHot keys: \n" - "\tESC - quit the program\n" - "\tr - auto-initialize tracking\n" - "\tc - delete all the points\n" - "\tn - switch the \"night\" mode on/off\n" - "To add/remove a feature point click it\n"; + help(); namedWindow( "LK Demo", 1 ); setMouseCallback( "LK Demo", onMouse, 0 );