add new version of CommandLineParser. add empty docs
This commit is contained in:
@@ -21,20 +21,19 @@ enum Method
|
||||
int main(int argc, const char** argv)
|
||||
{
|
||||
cv::CommandLineParser cmd(argc, argv,
|
||||
"{ c | camera | false | use camera }"
|
||||
"{ f | file | 768x576.avi | input video file }"
|
||||
"{ m | method | mog | method (fgd, mog, mog2, vibe, gmg) }"
|
||||
"{ h | help | false | print help message }");
|
||||
"{ c camera | | use camera }"
|
||||
"{ f file | 768x576.avi | input video file }"
|
||||
"{ m method | mog | method (fgd, mog, mog2, vibe, gmg) }"
|
||||
"{ h help | | print help message }");
|
||||
|
||||
if (cmd.get<bool>("help"))
|
||||
if (cmd.has("help") || !cmd.check())
|
||||
{
|
||||
cout << "Usage : bgfg_segm [options]" << endl;
|
||||
cout << "Avaible options:" << endl;
|
||||
cmd.printParams();
|
||||
cmd.printMessage();
|
||||
cmd.printErrors();
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool useCamera = cmd.get<bool>("camera");
|
||||
bool useCamera = cmd.has("camera");
|
||||
string file = cmd.get<string>("file");
|
||||
string method = cmd.get<string>("method");
|
||||
|
||||
|
@@ -25,24 +25,23 @@ int main(int argc, const char* argv[])
|
||||
try
|
||||
{
|
||||
const char* keys =
|
||||
"{ h | help | false | print help message }"
|
||||
"{ l | left | | specify left image }"
|
||||
"{ r | right | | specify right image }"
|
||||
"{ s | scale | 0.8 | set pyramid scale factor }"
|
||||
"{ a | alpha | 0.197 | set alpha }"
|
||||
"{ g | gamma | 50.0 | set gamma }"
|
||||
"{ i | inner | 10 | set number of inner iterations }"
|
||||
"{ o | outer | 77 | set number of outer iterations }"
|
||||
"{ si | solver | 10 | set number of basic solver iterations }"
|
||||
"{ t | time_step | 0.1 | set frame interpolation time step }";
|
||||
"{ h help | | print help message }"
|
||||
"{ l left | | specify left image }"
|
||||
"{ r right | | specify right image }"
|
||||
"{ s scale | 0.8 | set pyramid scale factor }"
|
||||
"{ a alpha | 0.197 | set alpha }"
|
||||
"{ g gamma | 50.0 | set gamma }"
|
||||
"{ i inner | 10 | set number of inner iterations }"
|
||||
"{ o outer | 77 | set number of outer iterations }"
|
||||
"{ si solver | 10 | set number of basic solver iterations }"
|
||||
"{ t time_step | 0.1 | set frame interpolation time step }";
|
||||
|
||||
CommandLineParser cmd(argc, argv, keys);
|
||||
|
||||
if (cmd.get<bool>("help"))
|
||||
if (cmd.has("help") || !cmd.check())
|
||||
{
|
||||
cout << "Usage: brox_optical_flow [options]" << endl;
|
||||
cout << "Avaible options:" << endl;
|
||||
cmd.printParams();
|
||||
cmd.printMessage();
|
||||
cmd.printErrors();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -43,19 +43,19 @@ static void colorizeFlow(const Mat &u, const Mat &v, Mat &dst)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
CommandLineParser cmd(argc, argv,
|
||||
"{ l | left | | specify left image }"
|
||||
"{ r | right | | specify right image }"
|
||||
"{ h | help | false | print help message }");
|
||||
"{ l left | | specify left image }"
|
||||
"{ r right | | specify right image }"
|
||||
"{ h help | | print help message }");
|
||||
|
||||
if (cmd.get<bool>("help"))
|
||||
cmd.about("Farneback's optical flow sample.");
|
||||
if (cmd.has("help") || !cmd.check())
|
||||
{
|
||||
cout << "Farneback's optical flow sample.\n\n"
|
||||
<< "Usage: farneback_optical_flow_gpu [arguments]\n\n"
|
||||
<< "Arguments:\n";
|
||||
cmd.printParams();
|
||||
cmd.printMessage();
|
||||
cmd.printErrors();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
string pathL = cmd.get<string>("left");
|
||||
string pathR = cmd.get<string>("right");
|
||||
if (pathL.empty()) cout << "Specify left image path\n";
|
||||
|
@@ -165,22 +165,23 @@ int main(int argc, const char* argv[])
|
||||
redirectError(cvErrorCallback);
|
||||
|
||||
const char* keys =
|
||||
"{ h | help | false | print help message }"
|
||||
"{ f | filter | | filter for test }"
|
||||
"{ w | workdir | | set working directory }"
|
||||
"{ l | list | false | show all tests }"
|
||||
"{ d | device | 0 | device id }"
|
||||
"{ i | iters | 10 | iteration count }";
|
||||
"{ h help | | print help message }"
|
||||
"{ f filter | | filter for test }"
|
||||
"{ w workdir | | set working directory }"
|
||||
"{ l list | | show all tests }"
|
||||
"{ d device | 0 | device id }"
|
||||
"{ i iters | 10 | iteration count }";
|
||||
|
||||
CommandLineParser cmd(argc, argv, keys);
|
||||
|
||||
if (cmd.get<bool>("help"))
|
||||
if (cmd.has("help") || !cmd.check())
|
||||
{
|
||||
cout << "Avaible options:" << endl;
|
||||
cmd.printParams();
|
||||
cmd.printMessage();
|
||||
cmd.printErrors();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int device = cmd.get<int>("device");
|
||||
if (device < 0 || device >= num_devices)
|
||||
{
|
||||
@@ -198,7 +199,7 @@ int main(int argc, const char* argv[])
|
||||
|
||||
string filter = cmd.get<string>("filter");
|
||||
string workdir = cmd.get<string>("workdir");
|
||||
bool list = cmd.get<bool>("list");
|
||||
bool list = cmd.has("list");
|
||||
int iters = cmd.get<int>("iters");
|
||||
|
||||
if (!filter.empty())
|
||||
|
@@ -152,23 +152,22 @@ 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 }"
|
||||
"{ l | left | | specify left image }"
|
||||
"{ r | right | | specify right image }"
|
||||
"{ gray | gray | false | use grayscale sources [PyrLK Sparse] }"
|
||||
"{ win_size | win_size | 21 | specify windows size [PyrLK] }"
|
||||
"{ max_level | max_level | 3 | specify max level [PyrLK] }"
|
||||
"{ iters | iters | 30 | specify iterations count [PyrLK] }"
|
||||
"{ points | points | 4000 | specify points count [GoodFeatureToTrack] }"
|
||||
"{ min_dist | min_dist | 0 | specify minimal distance between points [GoodFeatureToTrack] }";
|
||||
"{ h help | | print help message }"
|
||||
"{ l left | | specify left image }"
|
||||
"{ r right | | specify right image }"
|
||||
"{ gray | | use grayscale sources [PyrLK Sparse] }"
|
||||
"{ win_size | 21 | specify windows size [PyrLK] }"
|
||||
"{ max_level | 3 | specify max level [PyrLK] }"
|
||||
"{ iters | 30 | specify iterations count [PyrLK] }"
|
||||
"{ points | 4000 | specify points count [GoodFeatureToTrack] }"
|
||||
"{ min_dist | 0 | specify minimal distance between points [GoodFeatureToTrack] }";
|
||||
|
||||
CommandLineParser cmd(argc, argv, keys);
|
||||
|
||||
if (cmd.get<bool>("help"))
|
||||
if (cmd.has("help") || !cmd.check())
|
||||
{
|
||||
cout << "Usage: pyrlk_optical_flow [options]" << endl;
|
||||
cout << "Avaible options:" << endl;
|
||||
cmd.printParams();
|
||||
cmd.printMessage();
|
||||
cmd.printErrors();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -181,7 +180,7 @@ int main(int argc, const char* argv[])
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool useGray = cmd.get<bool>("gray");
|
||||
bool useGray = cmd.has("gray");
|
||||
int winSize = cmd.get<int>("win_size");
|
||||
int maxLevel = cmd.get<int>("max_level");
|
||||
int iters = cmd.get<int>("iters");
|
||||
|
Reference in New Issue
Block a user