Commit 6c4aae98 authored by DozyC's avatar DozyC

tapi examples - Removing defaults from all command line switches accessed with has()

parent 3db19c04
...@@ -17,10 +17,10 @@ using namespace cv; ...@@ -17,10 +17,10 @@ using namespace cv;
int main(int argc, const char** argv) int main(int argc, const char** argv)
{ {
CommandLineParser cmd(argc, argv, CommandLineParser cmd(argc, argv,
"{ c camera | false | use camera }" "{ c camera | | use camera }"
"{ f file | ../data/768x576.avi | input video file }" "{ f file | ../data/768x576.avi | input video file }"
"{ t type | mog2 | method's type (knn, mog2) }" "{ 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}"); "{ m cpu_mode | false | press 'm' to switch OpenCL<->CPU}");
if (cmd.has("help")) if (cmd.has("help"))
......
...@@ -33,7 +33,7 @@ int main(int argc, char** argv) ...@@ -33,7 +33,7 @@ int main(int argc, char** argv)
"{ i input | | specify input image }" "{ i input | | specify input image }"
"{ c camera | 0 | specify camera id }" "{ c camera | 0 | specify camera id }"
"{ o output | clahe_output.jpg | specify output save path}" "{ 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); cv::CommandLineParser cmd(argc, argv, keys);
if (cmd.has("help")) if (cmd.has("help"))
......
...@@ -68,15 +68,15 @@ private: ...@@ -68,15 +68,15 @@ private:
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
const char* keys = const char* keys =
"{ h help | false | print help message }" "{ h help | | print help message }"
"{ i input | | specify input image}" "{ i input | | specify input image}"
"{ c camera | -1 | enable camera capturing }" "{ c camera | -1 | enable camera capturing }"
"{ v video | ../data/768x576.avi | use video as input }" "{ 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}" "{ s scale | 1.0 | resize the image before detect}"
"{ o output | | specify output path when input is images}"; "{ o output | | specify output path when input is images}";
CommandLineParser cmd(argc, argv, keys); CommandLineParser cmd(argc, argv, keys);
if (cmd.get<bool>("help")) if (cmd.has("help"))
{ {
cmd.printMessage(); cmd.printMessage();
return EXIT_SUCCESS; return EXIT_SUCCESS;
...@@ -115,7 +115,7 @@ App::App(CommandLineParser& cmd) ...@@ -115,7 +115,7 @@ App::App(CommandLineParser& cmd)
<< "\t4/r - increase/decrease hit threshold\n" << "\t4/r - increase/decrease hit threshold\n"
<< endl; << endl;
make_gray = cmd.get<bool>("gray"); make_gray = cmd.has("gray");
resize_scale = cmd.get<double>("s"); resize_scale = cmd.get<double>("s");
vdo_source = cmd.get<string>("v"); vdo_source = cmd.get<string>("v");
img_source = cmd.get<string>("i"); img_source = cmd.get<string>("i");
......
...@@ -75,7 +75,7 @@ static void drawArrows(UMat& _frame, const vector<Point2f>& prevPts, const vecto ...@@ -75,7 +75,7 @@ static void drawArrows(UMat& _frame, const vector<Point2f>& prevPts, const vecto
int main(int argc, const char* argv[]) int main(int argc, const char* argv[])
{ {
const char* keys = const char* keys =
"{ h help | false | print help message }" "{ h help | | print help message }"
"{ l left | | specify left image }" "{ l left | | specify left image }"
"{ r right | | specify right image }" "{ r right | | specify right image }"
"{ c camera | 0 | enable camera capturing }" "{ c camera | 0 | enable camera capturing }"
......
...@@ -143,8 +143,8 @@ int main(int argc, char** argv) ...@@ -143,8 +143,8 @@ int main(int argc, char** argv)
const char* keys = const char* keys =
"{ i input | ../data/pic1.png | specify input image }" "{ i input | ../data/pic1.png | specify input image }"
"{ o output | squares_output.jpg | specify output save path}" "{ o output | squares_output.jpg | specify output save path}"
"{ h help | false | print help message }" "{ h help | | print help message }"
"{ m cpu_mode | false | run without OpenCL }"; "{ m cpu_mode | | run without OpenCL }";
CommandLineParser cmd(argc, argv, keys); CommandLineParser cmd(argc, argv, keys);
......
...@@ -83,12 +83,12 @@ static void getFlowField(const Mat& u, const Mat& v, Mat& flowField) ...@@ -83,12 +83,12 @@ static void getFlowField(const Mat& u, const Mat& v, Mat& flowField)
int main(int argc, const char* argv[]) int main(int argc, const char* argv[])
{ {
const char* keys = const char* keys =
"{ h help | false | print help message }" "{ h help | | print help message }"
"{ l left | | specify left image }" "{ l left | | specify left image }"
"{ r right | | specify right image }" "{ r right | | specify right image }"
"{ o output | tvl1_output.jpg | specify output save path }" "{ o output | tvl1_output.jpg | specify output save path }"
"{ c camera | 0 | enable camera capturing }" "{ 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 }"; "{ v video | | use video as input }";
CommandLineParser cmd(argc, argv, keys); CommandLineParser cmd(argc, argv, keys);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment