Fix command line argument handling, fixes #6525
authorDozyC <dozyc@users.noreply.github.com>
Wed, 11 May 2016 00:20:59 +0000 (17:20 -0700)
committerDozyC <dozyc@users.noreply.github.com>
Wed, 11 May 2016 00:20:59 +0000 (17:20 -0700)
samples/tapi/hog.cpp

index e361c2b..0529f24 100644 (file)
@@ -76,10 +76,8 @@ int main(int argc, char** argv)
         "{ s scale     | 1.0            | resize the image before detect}"
         "{ o output    |                | specify output path when input is images}";
     CommandLineParser cmd(argc, argv, keys);
-    if (cmd.has("help"))
+    if (cmd.get<bool>("help"))
     {
-        cout << "Usage : hog [options]" << endl;
-        cout << "Available options:" << endl;
         cmd.printMessage();
         return EXIT_SUCCESS;
     }
@@ -117,7 +115,7 @@ App::App(CommandLineParser& cmd)
          << "\t4/r - increase/decrease hit threshold\n"
          << endl;
 
-    make_gray = cmd.has("gray");
+    make_gray = cmd.get<bool>("gray");
     resize_scale = cmd.get<double>("s");
     vdo_source = cmd.get<string>("v");
     img_source = cmd.get<string>("i");