Revert "add new version of CommandLineParser. add empty docs"
This reverts commit 54a202b3d522f19a05993998ab40a40733a0d3b8. Conflicts: modules/core/doc/command_line_parser.rst modules/core/include/opencv2/core/core.hpp modules/core/src/cmdparser.cpp modules/gpu/perf/main.cpp modules/gpu/test/main.cpp modules/ts/src/ts_perf.cpp
This commit is contained in:
parent
52e490ef88
commit
d566c6bc86
@ -1,101 +0,0 @@
|
||||
Command Line Parser
|
||||
===================
|
||||
|
||||
.. highlight:: cpp
|
||||
|
||||
CommandLineParser
|
||||
--------
|
||||
.. ocv:class:: CommandLineParser
|
||||
|
||||
The CommandLineParser class is designed for command line arguments parsing
|
||||
|
||||
|
||||
.. ocv:function:: CommandLineParser::CommandLineParser(int argc, const char * const argv[], const std::string keys)
|
||||
|
||||
:param argc:
|
||||
:param argv:
|
||||
:param keys:
|
||||
|
||||
.. ocv:function:: T CommandLineParser::get<T>(const std::string& name, bool space_delete = true)
|
||||
|
||||
:param name:
|
||||
:param space_delete:
|
||||
|
||||
.. ocv:function:: T CommandLineParser::get<T>(int index, bool space_delete = true)
|
||||
|
||||
:param index:
|
||||
:param space_delete:
|
||||
|
||||
.. ocv:function:: bool CommandLineParser::has(const std::string& name)
|
||||
|
||||
:param name:
|
||||
|
||||
.. ocv:function:: bool CommandLineParser::check()
|
||||
|
||||
|
||||
.. ocv:function:: void CommandLineParser::about(std::string message)
|
||||
|
||||
:param message:
|
||||
|
||||
.. ocv:function:: void CommandLineParser::printMessage()
|
||||
|
||||
.. ocv:function:: void CommandLineParser::printErrors()
|
||||
|
||||
.. ocv:function:: std::string CommandLineParser::getPathToApplication()
|
||||
|
||||
|
||||
The sample below demonstrates how to use CommandLineParser:
|
||||
|
||||
::
|
||||
|
||||
CommandLineParser parser(argc, argv, keys);
|
||||
parser.about("Application name v1.0.0");
|
||||
|
||||
if (parser.has("help"))
|
||||
{
|
||||
parser.printMessage();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int N = parser.get<int>("N");
|
||||
double fps = parser.get<double>("fps");
|
||||
std::string path = parser.get<std::string>("path");
|
||||
|
||||
use_time_stamp = parser.has("timestamp");
|
||||
|
||||
std::string img1 = parser.get<string>(0);
|
||||
std::string img2 = parser.get<string>(1);
|
||||
|
||||
int repeat = parser.get<int>(2);
|
||||
|
||||
if (!parser.check())
|
||||
{
|
||||
parser.printErrors();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Syntax:
|
||||
|
||||
::
|
||||
|
||||
const std::string keys =
|
||||
"{help h usage ? | | print this message }"
|
||||
"{@image1 | | image1 for compare }"
|
||||
"{@image2 | | image2 for compare }"
|
||||
"{@repeat |1 | number }"
|
||||
"{path |. | path to file }"
|
||||
"{fps | -1.0 | fps for output video }"
|
||||
"{N count |100 | count of objects }"
|
||||
"{ts timestamp | | use time stamp }"
|
||||
;
|
||||
|
||||
Use:
|
||||
|
||||
::
|
||||
|
||||
# ./app -N=200 1.png 2.jpg 19 -ts
|
||||
|
||||
# ./app -fps=aaa
|
||||
ERRORS:
|
||||
Exception: can not convert: [aaa] to [double]
|
||||
|
@ -6,7 +6,6 @@ core. The Core Functionality
|
||||
:maxdepth: 2
|
||||
|
||||
basic_structures
|
||||
command_line_parser
|
||||
old_basic_structures
|
||||
dynamic_structures
|
||||
operations_on_arrays
|
||||
|
@ -11,25 +11,25 @@ unsigned int TestBase::iterationsLimitDefault = (unsigned int)(-1);
|
||||
int64 TestBase::_timeadjustment = 0;
|
||||
|
||||
const std::string command_line_keys =
|
||||
"{ perf_max_outliers |8 |percent of allowed outliers}"
|
||||
"{ perf_min_samples |10 |minimal required numer of samples}"
|
||||
"{ perf_force_samples |100 |force set maximum number of samples for all tests}"
|
||||
"{ perf_seed |809564 |seed for random numbers generator}"
|
||||
"{ perf_threads |-1 |the number of worker threads, if parallel execution is enabled}"
|
||||
"{ perf_write_sanity | |allow to create new records for sanity checks}"
|
||||
"{ |perf_max_outliers |8 |percent of allowed outliers}"
|
||||
"{ |perf_min_samples |10 |minimal required numer of samples}"
|
||||
"{ |perf_force_samples |100 |force set maximum number of samples for all tests}"
|
||||
"{ |perf_seed |809564 |seed for random numbers generator}"
|
||||
"{ |perf_threads |-1 |the number of worker threads, if parallel execution is enabled}"
|
||||
"{ |perf_write_sanity | |allow to create new records for sanity checks}"
|
||||
#ifdef ANDROID
|
||||
"{ perf_time_limit |6.0 |default time limit for a single test (in seconds)}"
|
||||
"{ perf_affinity_mask |0 |set affinity mask for the main thread}"
|
||||
"{ perf_log_power_checkpoints | |additional xml logging for power measurement}"
|
||||
"{ |perf_time_limit |6.0 |default time limit for a single test (in seconds)}"
|
||||
"{ |perf_affinity_mask |0 |set affinity mask for the main thread}"
|
||||
"{ |perf_log_power_checkpoints | |additional xml logging for power measurement}"
|
||||
#else
|
||||
"{ perf_time_limit |3.0 |default time limit for a single test (in seconds)}"
|
||||
"{ |perf_time_limit |3.0 |default time limit for a single test (in seconds)}"
|
||||
#endif
|
||||
"{ perf_max_deviation |1.0 |}"
|
||||
"{ help h | |print help info}"
|
||||
"{ |perf_max_deviation |1.0 |}"
|
||||
"{h |help | |print help info}"
|
||||
#ifdef HAVE_CUDA
|
||||
"{ perf_run_cpu |false |run GPU performance tests for analogical CPU functions}"
|
||||
"{ perf_cuda_device |0 |run GPU test suite onto specific CUDA capable device}"
|
||||
"{ perf_cuda_info_only |false |print an information about system and an available CUDA devices and then exit.}"
|
||||
"{ |perf_run_cpu |false |run GPU performance tests for analogical CPU functions}"
|
||||
"{ |perf_cuda_device |0 |run GPU test suite onto specific CUDA capable device}"
|
||||
"{ |perf_cuda_info_only |false |print an information about system and an available CUDA devices and then exit.}"
|
||||
#endif
|
||||
;
|
||||
|
||||
@ -640,10 +640,11 @@ performance_metrics::performance_metrics()
|
||||
|
||||
void TestBase::Init(int argc, const char* const argv[])
|
||||
{
|
||||
cv::CommandLineParser args(argc, argv, command_line_keys);
|
||||
if (args.has("help"))
|
||||
cv::CommandLineParser args(argc, argv, command_line_keys.c_str());
|
||||
if (args.get<bool>("help"))
|
||||
{
|
||||
args.printMessage();
|
||||
args.printParams();
|
||||
printf("\n\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -652,24 +653,24 @@ void TestBase::Init(int argc, const char* const argv[])
|
||||
param_max_outliers = std::min(100., std::max(0., args.get<double>("perf_max_outliers")));
|
||||
param_min_samples = std::max(1u, args.get<unsigned int>("perf_min_samples"));
|
||||
param_max_deviation = std::max(0., args.get<double>("perf_max_deviation"));
|
||||
param_seed = args.get<unsigned long long>("perf_seed");
|
||||
param_seed = args.get<uint64>("perf_seed");
|
||||
param_time_limit = std::max(0., args.get<double>("perf_time_limit"));
|
||||
param_force_samples = args.get<unsigned int>("perf_force_samples");
|
||||
param_write_sanity = args.has("perf_write_sanity");
|
||||
param_write_sanity = args.get<bool>("perf_write_sanity");
|
||||
param_threads = args.get<int>("perf_threads");
|
||||
#ifdef ANDROID
|
||||
param_affinity_mask = args.get<int>("perf_affinity_mask");
|
||||
log_power_checkpoints = args.has("perf_log_power_checkpoints");
|
||||
log_power_checkpoints = args.get<bool>("perf_log_power_checkpoints");
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CUDA
|
||||
|
||||
bool printOnly = args.has("perf_cuda_info_only");
|
||||
bool printOnly = args.get<bool>("perf_cuda_info_only");
|
||||
|
||||
if (printOnly)
|
||||
exit(0);
|
||||
|
||||
param_run_cpu = args.has("perf_run_cpu");
|
||||
param_run_cpu = args.get<bool>("perf_run_cpu");
|
||||
param_cuda_device = std::max(0, std::min(cv::gpu::getCudaEnabledDeviceCount(), args.get<int>("perf_cuda_device")));
|
||||
|
||||
if (param_run_cpu)
|
||||
@ -689,11 +690,11 @@ void TestBase::Init(int argc, const char* const argv[])
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!args.check())
|
||||
{
|
||||
args.printErrors();
|
||||
return;
|
||||
}
|
||||
// if (!args.check())
|
||||
// {
|
||||
// args.printErrors();
|
||||
// return;
|
||||
// }
|
||||
|
||||
timeLimitDefault = param_time_limit == 0.0 ? 1 : (int64)(param_time_limit * cv::getTickFrequency());
|
||||
iterationsLimitDefault = param_force_samples == 0 ? (unsigned)(-1) : param_force_samples;
|
||||
|
@ -72,9 +72,9 @@ static void help()
|
||||
//
|
||||
const char *keys =
|
||||
{
|
||||
"{nf nframes |300 |frames number}"
|
||||
"{c camera |false |use the camera or not}"
|
||||
"{mf movie_file|tree.avi |used movie video file}"
|
||||
"{nf|nframes |300 |frames number}"
|
||||
"{c |camera |false |use the camera or not}"
|
||||
"{mf|movie_file|tree.avi |used movie video file}"
|
||||
};
|
||||
int main(int argc, const char** argv)
|
||||
{
|
||||
@ -82,7 +82,7 @@ int main(int argc, const char** argv)
|
||||
|
||||
CommandLineParser parser(argc, argv, keys);
|
||||
int nframesToLearnBG = parser.get<int>("nf");
|
||||
bool useCamera = parser.has("c");
|
||||
bool useCamera = parser.get<bool>("c");
|
||||
string filename = parser.get<string>("mf");
|
||||
IplImage* rawImage = 0, *yuvImage = 0; //yuvImage is for codebook method
|
||||
IplImage *ImaskCodeBook = 0,*ImaskCodeBookCC = 0;
|
||||
|
@ -18,8 +18,8 @@ static void help()
|
||||
|
||||
const char* keys =
|
||||
{
|
||||
"{c camera | | use camera or not}"
|
||||
"{fn file_name|tree.avi | movie file }"
|
||||
"{c |camera |true | use camera or not}"
|
||||
"{fn|file_name|tree.avi | movie file }"
|
||||
};
|
||||
|
||||
//this is a sample for foreground detection functions
|
||||
@ -28,7 +28,7 @@ int main(int argc, const char** argv)
|
||||
help();
|
||||
|
||||
CommandLineParser parser(argc, argv, keys);
|
||||
bool useCamera = parser.has("camera");
|
||||
bool useCamera = parser.get<bool>("camera");
|
||||
string file = parser.get<string>("file_name");
|
||||
VideoCapture cap;
|
||||
bool update_bg_model = true;
|
||||
@ -37,8 +37,7 @@ int main(int argc, const char** argv)
|
||||
cap.open(0);
|
||||
else
|
||||
cap.open(file.c_str());
|
||||
|
||||
parser.printMessage();
|
||||
parser.printParams();
|
||||
|
||||
if( !cap.isOpened() )
|
||||
{
|
||||
|
@ -53,8 +53,8 @@ static void help()
|
||||
|
||||
const char* keys =
|
||||
{
|
||||
"{@first_image | box.png | the first image}"
|
||||
"{@second_image | box_in_scene.png | the second image}"
|
||||
"{1| |box.png |the first image}"
|
||||
"{2| |box_in_scene.png|the second image}"
|
||||
};
|
||||
|
||||
int main(int argc, const char ** argv)
|
||||
@ -62,8 +62,8 @@ int main(int argc, const char ** argv)
|
||||
|
||||
help();
|
||||
CommandLineParser parser(argc, argv, keys);
|
||||
string im1_name = parser.get<string>(1);
|
||||
string im2_name = parser.get<string>(2);
|
||||
string im1_name = parser.get<string>("1");
|
||||
string im2_name = parser.get<string>("2");
|
||||
|
||||
Mat im1 = imread(im1_name, CV_LOAD_IMAGE_GRAYSCALE);
|
||||
Mat im2 = imread(im2_name, CV_LOAD_IMAGE_GRAYSCALE);
|
||||
@ -72,7 +72,7 @@ int main(int argc, const char ** argv)
|
||||
{
|
||||
cout << "could not open one of the images..." << endl;
|
||||
cout << "the cmd parameters have next current value: " << endl;
|
||||
parser.printMessage();
|
||||
parser.printParams();
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ static void help()
|
||||
|
||||
const char* keys =
|
||||
{
|
||||
"{@camera_number| 0 | camera number}"
|
||||
"{1| | 0 | camera number}"
|
||||
};
|
||||
|
||||
int main( int argc, const char** argv )
|
||||
@ -77,7 +77,7 @@ int main( int argc, const char** argv )
|
||||
float hranges[] = {0,180};
|
||||
const float* phranges = hranges;
|
||||
CommandLineParser parser(argc, argv, keys);
|
||||
int camNum = parser.get<int>(1);
|
||||
int camNum = parser.get<int>("1");
|
||||
|
||||
cap.open(camNum);
|
||||
|
||||
@ -86,7 +86,7 @@ int main( int argc, const char** argv )
|
||||
help();
|
||||
cout << "***Could not initialize capturing...***\n";
|
||||
cout << "Current parameter's value: \n";
|
||||
parser.printMessage();
|
||||
parser.printParams();
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -19,8 +19,8 @@ static void help()
|
||||
|
||||
const char* keys =
|
||||
{
|
||||
"{@logo1 |logo_in_clutter.png |image edge map }"
|
||||
"{@logo2 |logo.png |template edge map}"
|
||||
"{1| |logo_in_clutter.png|image edge map }"
|
||||
"{2| |logo.png |template edge map}"
|
||||
};
|
||||
|
||||
int main( int argc, const char** argv )
|
||||
@ -29,8 +29,8 @@ int main( int argc, const char** argv )
|
||||
help();
|
||||
CommandLineParser parser(argc, argv, keys);
|
||||
|
||||
string image = parser.get<string>(1);
|
||||
string templ = parser.get<string>(2);
|
||||
string image = parser.get<string>("1");
|
||||
string templ = parser.get<string>("2");
|
||||
Mat img = imread(image.c_str(), 0);
|
||||
Mat tpl = imread(templ.c_str(), 0);
|
||||
|
||||
|
@ -45,14 +45,14 @@ static void help()
|
||||
|
||||
const char* keys =
|
||||
{
|
||||
"{@image |stuff.jpg|image for converting to a grayscale}"
|
||||
"{1| |stuff.jpg|image for converting to a grayscale}"
|
||||
};
|
||||
|
||||
int main( int argc, const char** argv )
|
||||
{
|
||||
help();
|
||||
CommandLineParser parser(argc, argv, keys);
|
||||
string inputImage = parser.get<string>(1);
|
||||
string inputImage = parser.get<string>("1");
|
||||
img = imread(inputImage.c_str(), 0);
|
||||
|
||||
if(img.empty())
|
||||
|
@ -62,7 +62,7 @@ static void help()
|
||||
|
||||
const char* keys =
|
||||
{
|
||||
"{@image|baboon.jpg|input image file}"
|
||||
"{1| |baboon.jpg|input image file}"
|
||||
};
|
||||
|
||||
int main( int argc, const char** argv )
|
||||
@ -70,7 +70,7 @@ int main( int argc, const char** argv )
|
||||
help();
|
||||
|
||||
CommandLineParser parser(argc, argv, keys);
|
||||
string inputImage = parser.get<string>(1);
|
||||
string inputImage = parser.get<string>("1");
|
||||
|
||||
// Load the source image. HighGUI use.
|
||||
image = imread( inputImage, 0 );
|
||||
|
@ -17,14 +17,14 @@ static void help()
|
||||
|
||||
const char* keys =
|
||||
{
|
||||
"{@image|lena.jpg|input image file}"
|
||||
"{1| |lena.jpg|input image file}"
|
||||
};
|
||||
|
||||
int main(int argc, const char ** argv)
|
||||
{
|
||||
help();
|
||||
CommandLineParser parser(argc, argv, keys);
|
||||
string filename = parser.get<string>(1);
|
||||
string filename = parser.get<string>("1");
|
||||
|
||||
Mat img = imread(filename.c_str(), CV_LOAD_IMAGE_GRAYSCALE);
|
||||
if( img.empty() )
|
||||
|
@ -104,14 +104,14 @@ static void help()
|
||||
|
||||
const char* keys =
|
||||
{
|
||||
"{@image |stuff.jpg|input image file}"
|
||||
"{1| |stuff.jpg|input image file}"
|
||||
};
|
||||
|
||||
int main( int argc, const char** argv )
|
||||
{
|
||||
help();
|
||||
CommandLineParser parser(argc, argv, keys);
|
||||
string filename = parser.get<string>(1);
|
||||
string filename = parser.get<string>("1");
|
||||
gray = imread(filename.c_str(), 0);
|
||||
if(gray.empty())
|
||||
{
|
||||
|
@ -31,7 +31,7 @@ static void help()
|
||||
|
||||
const char* keys =
|
||||
{
|
||||
"{@image |fruits.jpg|input image name}"
|
||||
"{1| |fruits.jpg|input image name}"
|
||||
};
|
||||
|
||||
int main( int argc, const char** argv )
|
||||
@ -39,7 +39,7 @@ int main( int argc, const char** argv )
|
||||
help();
|
||||
|
||||
CommandLineParser parser(argc, argv, keys);
|
||||
string filename = parser.get<string>(1);
|
||||
string filename = parser.get<string>("1");
|
||||
|
||||
image = imread(filename, 1);
|
||||
if(image.empty())
|
||||
|
@ -3,23 +3,19 @@
|
||||
|
||||
const char* keys =
|
||||
{
|
||||
"{ b build | | print complete build info }"
|
||||
"{ h help | | print this help }"
|
||||
"{ b |build |false | print complete build info }"
|
||||
"{ h |help |false | print this help }"
|
||||
};
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
{
|
||||
cv::CommandLineParser parser(argc, argv, keys);
|
||||
|
||||
if (parser.has("help"))
|
||||
if (parser.get<bool>("help"))
|
||||
{
|
||||
parser.printMessage();
|
||||
parser.printParams();
|
||||
}
|
||||
else if (!parser.check())
|
||||
{
|
||||
parser.printErrors();
|
||||
}
|
||||
else if (parser.has("build"))
|
||||
else if (parser.get<bool>("build"))
|
||||
{
|
||||
std::cout << cv::getBuildInformation() << std::endl;
|
||||
}
|
||||
@ -29,4 +25,4 @@ int main(int argc, const char* argv[])
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
@ -64,19 +64,20 @@ static void openGlDrawCallback(void* userdata)
|
||||
int main(int argc, const char* argv[])
|
||||
{
|
||||
const char* keys =
|
||||
"{ l left | | left image file name }"
|
||||
"{ r right | | right image file name }"
|
||||
"{ i intrinsic | | intrinsic camera parameters file name }"
|
||||
"{ e extrinsic | | extrinsic camera parameters file name }"
|
||||
"{ d ndisp | 256 | number of disparities }"
|
||||
"{ s scale | 1.0 | scale factor for point cloud }"
|
||||
"{ h help | | print help message }";
|
||||
"{ l | left | | left image file name }"
|
||||
"{ r | right | | right image file name }"
|
||||
"{ i | intrinsic | | intrinsic camera parameters file name }"
|
||||
"{ e | extrinsic | | extrinsic camera parameters file name }"
|
||||
"{ d | ndisp | 256 | number of disparities }"
|
||||
"{ s | scale | 1.0 | scale factor for point cloud }"
|
||||
"{ h | help | false | print help message }";
|
||||
|
||||
CommandLineParser cmd(argc, argv, keys);
|
||||
|
||||
if (cmd.has("help"))
|
||||
if (cmd.get<bool>("help"))
|
||||
{
|
||||
cmd.printMessage();
|
||||
cout << "Avaible options:" << endl;
|
||||
cmd.printParams();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -87,18 +88,11 @@ int main(int argc, const char* argv[])
|
||||
int ndisp = cmd.get<int>("ndisp");
|
||||
double scale = cmd.get<double>("scale");
|
||||
|
||||
if (!cmd.check())
|
||||
{
|
||||
cmd.printErrors();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (left.empty() || right.empty())
|
||||
{
|
||||
cout << "Missed input images" << endl;
|
||||
cout << "Avaible options:" << endl;
|
||||
cmd.printMessage();
|
||||
cmd.printParams();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -106,7 +100,7 @@ int main(int argc, const char* argv[])
|
||||
{
|
||||
cout << "Boss camera parameters must be specified" << endl;
|
||||
cout << "Avaible options:" << endl;
|
||||
cmd.printMessage();
|
||||
cmd.printParams();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -281,56 +281,56 @@ int main(int argc, const char **argv)
|
||||
try
|
||||
{
|
||||
const char *keys =
|
||||
"{ @1 | | }"
|
||||
"{ m model | affine | }"
|
||||
"{ lp lin-prog-motion-est | no | }"
|
||||
"{ subset | auto | }"
|
||||
"{ thresh | auto | }"
|
||||
"{ outlier-ratio | 0.5 | }"
|
||||
"{ min-inlier-ratio | 0.1 | }"
|
||||
"{ nkps | 1000 | }"
|
||||
"{ extra-kps | 0 | }"
|
||||
"{ local-outlier-rejection | no | }"
|
||||
"{ sm save-motions | no | }"
|
||||
"{ lm load-motions | no | }"
|
||||
"{ r radius | 15 | }"
|
||||
"{ stdev | auto | }"
|
||||
"{ lps lin-prog-stab | no | }"
|
||||
"{ lps-trim-ratio | auto | }"
|
||||
"{ lps-w1 | 1 | }"
|
||||
"{ lps-w2 | 10 | }"
|
||||
"{ lps-w3 | 100 | }"
|
||||
"{ lps-w4 | 100 | }"
|
||||
"{ deblur | no | }"
|
||||
"{ deblur-sens | 0.1 | }"
|
||||
"{ et est-trim | yes | }"
|
||||
"{ t trim-ratio | 0.1 | }"
|
||||
"{ ic incl-constr | no | }"
|
||||
"{ bm border-mode | replicate | }"
|
||||
"{ mosaic | no | }"
|
||||
"{ ms mosaic-stdev | 10.0 | }"
|
||||
"{ mi motion-inpaint | no | }"
|
||||
"{ mi-dist-thresh | 5.0 | }"
|
||||
"{ ci color-inpaint | no | }"
|
||||
"{ ci-radius | 2 | }"
|
||||
"{ ws wobble-suppress | no | }"
|
||||
"{ ws-period | 30 | }"
|
||||
"{ ws-model | homography | }"
|
||||
"{ ws-subset | auto | }"
|
||||
"{ ws-thresh | auto | }"
|
||||
"{ ws-outlier-ratio | 0.5 | }"
|
||||
"{ ws-min-inlier-ratio | 0.1 | }"
|
||||
"{ ws-nkps | 1000 | }"
|
||||
"{ ws-extra-kps | 0 | }"
|
||||
"{ ws-local-outlier-rejection | no | }"
|
||||
"{ ws-lp | no | }"
|
||||
"{ sm2 save-motions2 | no | }"
|
||||
"{ lm2 load-motions2 | no | }"
|
||||
"{ gpu | no | }"
|
||||
"{ o output | stabilized.avi | }"
|
||||
"{ fps | auto | }"
|
||||
"{ q quiet | | }"
|
||||
"{ h help | | }";
|
||||
"{ 1 | | | | }"
|
||||
"{ m | model | affine | }"
|
||||
"{ lp | lin-prog-motion-est | no | }"
|
||||
"{ | subset | auto | }"
|
||||
"{ | thresh | auto | }"
|
||||
"{ | outlier-ratio | 0.5 | }"
|
||||
"{ | min-inlier-ratio | 0.1 | }"
|
||||
"{ | nkps | 1000 | }"
|
||||
"{ | extra-kps | 0 | }"
|
||||
"{ | local-outlier-rejection | no | }"
|
||||
"{ sm | save-motions | no | }"
|
||||
"{ lm | load-motions | no | }"
|
||||
"{ r | radius | 15 | }"
|
||||
"{ | stdev | auto | }"
|
||||
"{ lps | lin-prog-stab | no | }"
|
||||
"{ | lps-trim-ratio | auto | }"
|
||||
"{ | lps-w1 | 1 | }"
|
||||
"{ | lps-w2 | 10 | }"
|
||||
"{ | lps-w3 | 100 | }"
|
||||
"{ | lps-w4 | 100 | }"
|
||||
"{ | deblur | no | }"
|
||||
"{ | deblur-sens | 0.1 | }"
|
||||
"{ et | est-trim | yes | }"
|
||||
"{ t | trim-ratio | 0.1 | }"
|
||||
"{ ic | incl-constr | no | }"
|
||||
"{ bm | border-mode | replicate | }"
|
||||
"{ | mosaic | no | }"
|
||||
"{ ms | mosaic-stdev | 10.0 | }"
|
||||
"{ mi | motion-inpaint | no | }"
|
||||
"{ | mi-dist-thresh | 5.0 | }"
|
||||
"{ ci | color-inpaint | no | }"
|
||||
"{ | ci-radius | 2 | }"
|
||||
"{ ws | wobble-suppress | no | }"
|
||||
"{ | ws-period | 30 | }"
|
||||
"{ | ws-model | homography | }"
|
||||
"{ | ws-subset | auto | }"
|
||||
"{ | ws-thresh | auto | }"
|
||||
"{ | ws-outlier-ratio | 0.5 | }"
|
||||
"{ | ws-min-inlier-ratio | 0.1 | }"
|
||||
"{ | ws-nkps | 1000 | }"
|
||||
"{ | ws-extra-kps | 0 | }"
|
||||
"{ | ws-local-outlier-rejection | no | }"
|
||||
"{ | ws-lp | no | }"
|
||||
"{ sm2 | save-motions2 | no | }"
|
||||
"{ lm2 | load-motions2 | no | }"
|
||||
"{ gpu | | no }"
|
||||
"{ o | output | stabilized.avi | }"
|
||||
"{ | fps | auto | }"
|
||||
"{ q | quiet | false | }"
|
||||
"{ h | help | false | }";
|
||||
CommandLineParser cmd(argc, argv, keys);
|
||||
|
||||
// parse command arguments
|
||||
|
@ -21,19 +21,20 @@ enum Method
|
||||
int main(int argc, const char** argv)
|
||||
{
|
||||
cv::CommandLineParser cmd(argc, argv,
|
||||
"{ 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 }");
|
||||
"{ 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 }");
|
||||
|
||||
if (cmd.has("help") || !cmd.check())
|
||||
if (cmd.get<bool>("help"))
|
||||
{
|
||||
cmd.printMessage();
|
||||
cmd.printErrors();
|
||||
cout << "Usage : bgfg_segm [options]" << endl;
|
||||
cout << "Avaible options:" << endl;
|
||||
cmd.printParams();
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool useCamera = cmd.has("camera");
|
||||
bool useCamera = cmd.get<bool>("camera");
|
||||
string file = cmd.get<string>("file");
|
||||
string method = cmd.get<string>("method");
|
||||
|
||||
|
@ -25,23 +25,24 @@ int main(int argc, const char* argv[])
|
||||
try
|
||||
{
|
||||
const char* keys =
|
||||
"{ 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 }";
|
||||
"{ 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 }";
|
||||
|
||||
CommandLineParser cmd(argc, argv, keys);
|
||||
|
||||
if (cmd.has("help") || !cmd.check())
|
||||
if (cmd.get<bool>("help"))
|
||||
{
|
||||
cmd.printMessage();
|
||||
cmd.printErrors();
|
||||
cout << "Usage: brox_optical_flow [options]" << endl;
|
||||
cout << "Avaible options:" << endl;
|
||||
cmd.printParams();
|
||||
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 | | print help message }");
|
||||
"{ l | left | | specify left image }"
|
||||
"{ r | right | | specify right image }"
|
||||
"{ h | help | false | print help message }");
|
||||
|
||||
cmd.about("Farneback's optical flow sample.");
|
||||
if (cmd.has("help") || !cmd.check())
|
||||
if (cmd.get<bool>("help"))
|
||||
{
|
||||
cmd.printMessage();
|
||||
cmd.printErrors();
|
||||
cout << "Farneback's optical flow sample.\n\n"
|
||||
<< "Usage: farneback_optical_flow_gpu [arguments]\n\n"
|
||||
<< "Arguments:\n";
|
||||
cmd.printParams();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
string pathL = cmd.get<string>("left");
|
||||
string pathR = cmd.get<string>("right");
|
||||
if (pathL.empty()) cout << "Specify left image path\n";
|
||||
|
@ -165,23 +165,22 @@ int main(int argc, const char* argv[])
|
||||
redirectError(cvErrorCallback);
|
||||
|
||||
const char* keys =
|
||||
"{ 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 }";
|
||||
"{ 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 }";
|
||||
|
||||
CommandLineParser cmd(argc, argv, keys);
|
||||
|
||||
if (cmd.has("help") || !cmd.check())
|
||||
if (cmd.get<bool>("help"))
|
||||
{
|
||||
cmd.printMessage();
|
||||
cmd.printErrors();
|
||||
cout << "Avaible options:" << endl;
|
||||
cmd.printParams();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int device = cmd.get<int>("device");
|
||||
if (device < 0 || device >= num_devices)
|
||||
{
|
||||
@ -199,7 +198,7 @@ int main(int argc, const char* argv[])
|
||||
|
||||
string filter = cmd.get<string>("filter");
|
||||
string workdir = cmd.get<string>("workdir");
|
||||
bool list = cmd.has("list");
|
||||
bool list = cmd.get<bool>("list");
|
||||
int iters = cmd.get<int>("iters");
|
||||
|
||||
if (!filter.empty())
|
||||
|
@ -152,22 +152,23 @@ static void getFlowField(const Mat& u, const Mat& v, Mat& flowField)
|
||||
int main(int argc, const char* argv[])
|
||||
{
|
||||
const char* keys =
|
||||
"{ 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] }";
|
||||
"{ 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] }";
|
||||
|
||||
CommandLineParser cmd(argc, argv, keys);
|
||||
|
||||
if (cmd.has("help") || !cmd.check())
|
||||
if (cmd.get<bool>("help"))
|
||||
{
|
||||
cmd.printMessage();
|
||||
cmd.printErrors();
|
||||
cout << "Usage: pyrlk_optical_flow [options]" << endl;
|
||||
cout << "Avaible options:" << endl;
|
||||
cmd.printParams();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -180,7 +181,7 @@ int main(int argc, const char* argv[])
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool useGray = cmd.has("gray");
|
||||
bool useGray = cmd.get<bool>("gray");
|
||||
int winSize = cmd.get<int>("win_size");
|
||||
int maxLevel = cmd.get<int>("max_level");
|
||||
int iters = cmd.get<int>("iters");
|
||||
|
Loading…
x
Reference in New Issue
Block a user