fixed cmd line parsing in the samples

pull/388/head
Ivan Korolev 12 years ago
parent 7572b4d400
commit 36451319c1
  1. 4
      samples/cpp/brief_match_test.cpp
  2. 2
      samples/cpp/camshiftdemo.cpp
  3. 4
      samples/cpp/chamfer.cpp
  4. 2
      samples/cpp/connected_components.cpp
  5. 2
      samples/cpp/demhist.cpp
  6. 2
      samples/cpp/dft.cpp
  7. 2
      samples/cpp/distrans.cpp
  8. 2
      samples/cpp/edge.cpp
  9. 2
      samples/cpp/videostab.cpp

@ -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>(0);
string im2_name = parser.get<string>(1);
Mat im1 = imread(im1_name, CV_LOAD_IMAGE_GRAYSCALE);
Mat im2 = imread(im2_name, CV_LOAD_IMAGE_GRAYSCALE);

@ -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>(0);
cap.open(camNum);

@ -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>(0);
string templ = parser.get<string>(1);
Mat img = imread(image.c_str(), 0);
Mat tpl = imread(templ.c_str(), 0);

@ -48,7 +48,7 @@ int main( int argc, const char** argv )
{
help();
CommandLineParser parser(argc, argv, keys);
string inputImage = parser.get<string>("@image");
string inputImage = parser.get<string>(0);
img = imread(inputImage.c_str(), 0);
if(img.empty())

@ -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>(0);
// Load the source image. HighGUI use.
image = imread( inputImage, 0 );

@ -24,7 +24,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>(0);
Mat img = imread(filename.c_str(), CV_LOAD_IMAGE_GRAYSCALE);
if( img.empty() )

@ -111,7 +111,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>(0);
gray = imread(filename.c_str(), 0);
if(gray.empty())
{

@ -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>(0);
image = imread(filename, 1);
if(image.empty())

@ -356,7 +356,7 @@ int main(int argc, const char **argv)
// check if source video is specified
string inputPath = arg("1");
string inputPath = arg(0);
if (inputPath.empty())
throw runtime_error("specify video file path");

Loading…
Cancel
Save