Wrong index used in Demo Apps for CommandLineParser parser(argc, argv, keys); (Bug #2717)


Added by Harald Schmidt about 12 years ago. Updated about 12 years ago.


Status:Done Start date:2013-01-18
Priority:Normal Due date:
Assignee:Ivan Korolev % Done:

0%

Category:samples
Target version:3.0
Affected version:branch '2.4' Operating System:
Difficulty: HW Platform:
Pull request:https://github.com/Itseez/opencv/pull/388

Description

The following files from /samples/cpp contain

parser.get<string>(1)

file:///home/harald/git/opencv/samples/cpp/brief_match_test.cpp
file:///home/harald/git/opencv/samples/cpp/chamfer.cpp
file:///home/harald/git/opencv/samples/cpp/demhist.cpp
file:///home/harald/git/opencv/samples/cpp/dft.cpp
file:///home/harald/git/opencv/samples/cpp/distrans.cpp
file:///home/harald/git/opencv/samples/cpp/edge.cpp

Especially demhist.cpp contains:

  CommandLineParser parser(argc, argv, keys);
  inputImage = parser.get<string>(1);

With this index == 1 you cannot load any image.
So I changed it to

  inputImage = parser.get<string>(0);

.... and all works fine !

As a next step I changed samples/cpp/chamfer.cpp
to the following form:

   CommandLineParser parser(argc, argv, keys);
    string image = parser.get<string>(0);
    string templ = parser.get<string>(1);

.... and all works fine !

I used opencv-master.zip from https://github.com/Itseez/opencv.git


Associated revisions

Revision 5e47aa63
Added by Roman Donchenko almost 11 years ago

Merge pull request #2717 from StevenPuttemans:2.4

History

Updated by Kirill Kornyakov about 12 years ago

Looks like a bug. If you could create a pull request with mentioned fixes, it would be great! Otherwise this bug will wait for a better time :)

  • Target version deleted ()

Updated by Vadim Pisarevsky about 12 years ago

  • Assignee deleted (Kirill Kornyakov)

Updated by Oleg Sklyarov about 12 years ago

  • Affected version set to branch '2.4'
  • Description changed from The following files from /samples/cpp contain parser.get<string>(1) fi... to The following files from /samples/cpp contain <pre> parser.get<strin... More
  • Assignee set to Oleg Sklyarov

Updated by Ivan Korolev about 12 years ago

  • Pull request set to https://github.com/Itseez/opencv/pull/388

Updated by Ivan Korolev about 12 years ago

Fix is pushed.

  • Status changed from Open to Done

Updated by Andrey Kamaev about 12 years ago

  • Target version set to 3.0
  • Assignee changed from Oleg Sklyarov to Ivan Korolev

Also available in: Atom PDF