Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix command line argument handling, fixes #6525 #6824

Merged
merged 2 commits into from Jul 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions samples/tapi/bgfg_segm.cpp
Expand Up @@ -17,10 +17,10 @@ using namespace cv;
int main(int argc, const char** argv)
{
CommandLineParser cmd(argc, argv,
"{ c camera | false | use camera }"
"{ c camera | | use camera }"
"{ f file | ../data/768x576.avi | input video file }"
"{ t type | mog2 | method's type (knn, mog2) }"
"{ h help | false | print help message }"
"{ h help | | print help message }"
"{ m cpu_mode | false | press 'm' to switch OpenCL<->CPU}");

if (cmd.has("help"))
Expand Down
2 changes: 1 addition & 1 deletion samples/tapi/clahe.cpp
Expand Up @@ -33,7 +33,7 @@ int main(int argc, char** argv)
"{ i input | | specify input image }"
"{ c camera | 0 | specify camera id }"
"{ o output | clahe_output.jpg | specify output save path}"
"{ h help | false | print help message }";
"{ h help | | print help message }";

cv::CommandLineParser cmd(argc, argv, keys);
if (cmd.has("help"))
Expand Down
6 changes: 2 additions & 4 deletions samples/tapi/hog.cpp
Expand Up @@ -68,18 +68,16 @@ class App
int main(int argc, char** argv)
{
const char* keys =
"{ h help | false | print help message }"
"{ h help | | print help message }"
"{ i input | | specify input image}"
"{ c camera | -1 | enable camera capturing }"
"{ v video | ../data/768x576.avi | use video as input }"
"{ g gray | false | convert image to gray one or not}"
"{ g gray | | convert image to gray one or not}"
"{ 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"))
{
cout << "Usage : hog [options]" << endl;
cout << "Available options:" << endl;
cmd.printMessage();
return EXIT_SUCCESS;
}
Expand Down
2 changes: 1 addition & 1 deletion samples/tapi/pyrlk_optical_flow.cpp
Expand Up @@ -75,7 +75,7 @@ static void drawArrows(UMat& _frame, const vector<Point2f>& prevPts, const vecto
int main(int argc, const char* argv[])
{
const char* keys =
"{ h help | false | print help message }"
"{ h help | | print help message }"
"{ l left | | specify left image }"
"{ r right | | specify right image }"
"{ c camera | 0 | enable camera capturing }"
Expand Down
4 changes: 2 additions & 2 deletions samples/tapi/squares.cpp
Expand Up @@ -143,8 +143,8 @@ int main(int argc, char** argv)
const char* keys =
"{ i input | ../data/pic1.png | specify input image }"
"{ o output | squares_output.jpg | specify output save path}"
"{ h help | false | print help message }"
"{ m cpu_mode | false | run without OpenCL }";
"{ h help | | print help message }"
"{ m cpu_mode | | run without OpenCL }";

CommandLineParser cmd(argc, argv, keys);

Expand Down
4 changes: 2 additions & 2 deletions samples/tapi/tvl1_optical_flow.cpp
Expand Up @@ -83,12 +83,12 @@ static void getFlowField(const Mat& u, const Mat& v, Mat& flowField)
int main(int argc, const char* argv[])
{
const char* keys =
"{ h help | false | print help message }"
"{ h help | | print help message }"
"{ l left | | specify left image }"
"{ r right | | specify right image }"
"{ o output | tvl1_output.jpg | specify output save path }"
"{ c camera | 0 | enable camera capturing }"
"{ m cpu_mode | false | run without OpenCL }"
"{ m cpu_mode | | run without OpenCL }"
"{ v video | | use video as input }";

CommandLineParser cmd(argc, argv, keys);
Expand Down