Wrong index used in Demo Apps for CommandLineParser parser(argc, argv, keys); (Bug #2717)
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
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 Andrey Kamaev about 12 years ago
- Target version set to 3.0
- Assignee changed from Oleg Sklyarov to Ivan Korolev