opencv CommandLineParser - Serbipunk/notes GitHub Wiki

example 1

https://github.com/opencv/opencv/blob/3.4/samples/cpp/tutorial_code/video/optical_flow/optical_flow.cpp

usage:

    const string keys =
            "{ h help |      | print this help message }"
            "{ @image |<none>| path to image file }";
    CommandLineParser parser(argc, argv, keys);

    // print help
    if (parser.has("help"))
    {
        parser.printMessage();
        return 0;
    }

    // get args
    string filename = parser.get<string>("@image");
    if (!parser.check())
    {
        parser.printErrors();
        return 0;
    }
⚠️ **GitHub.com Fallback** ⚠️