opencv_annotation refuses to work, complaining about image folder not existing, even though it does exist

Created on 12 Nov 2016  路  3Comments  路  Source: opencv/opencv

System information (version)
  • OpenCV => 3.1.0-dev (8333ea41)
  • Operating System / Platform => Ubuntu 16.04 LTS
  • Compiler => GCC 5.4.0
Detailed description

opencv_annotation outputs the following error message and quits:

The image folder given does not exist. Please check again!

...even though it's been passed an absolute path to an existing directory with images as its --images argument.

Steps to reproduce

I used the following command:

$ opencv_annotation --images /home/taras/Projects/OpenCV/resources/images/goban_empty/ --annotations /home/taras/Projects/OpenCV/resources/data/goban_empty_annotations.txt

The folder, specified for --images argument, does exist. I tried removing the trailing slash from the path - this had no effect. I also tried paths to other existing folders, such as /home - still same result, the same error message is printed.

question (invalid tracker)

Most helpful comment

cv::CommandlineParser uses args in the --key=value form (you're missing the =), so, unless you use it like:

$ opencv_annotation --images=/home/taras/Projects/OpenCV/resources/images/goban_empty/ --annotations=/home/taras/Projects/OpenCV/resources/data/goban_empty_annotations.txt

, it will just _ignore_ any path you give it.

All 3 comments

cv::CommandlineParser uses args in the --key=value form (you're missing the =), so, unless you use it like:

$ opencv_annotation --images=/home/taras/Projects/OpenCV/resources/images/goban_empty/ --annotations=/home/taras/Projects/OpenCV/resources/data/goban_empty_annotations.txt

, it will just _ignore_ any path you give it.

@berak Thank you! Yes, indeed it works with =. My mistake.

Please re-open this issue. I stumbled upon the exact same issue of not using the = for the parameter. Its fine for me the = is needed but in my opinion not using the = must yield some kind of error. Calling

$ opencv_annotation -i /home/user/images/ -a /home/user/annotations.txt

(without =) results in neither --images nor --annotations being set, correct? The problem is there currently is no kind of error message as https://github.com/opencv/opencv/blob/master/apps/annotation/opencv_annotation.cpp#L238 does not seem to be triggered, there simply is this output on the commandline with no window opening:

* mark rectangles with the left mouse button,
* press 'c' to accept a selection,
* press 'd' to delete the latest selection,
* press 'n' to proceed with next image,
* press 'esc' to stop.
Was this page helpful?
0 / 5 - 0 ratings

Related issues

sturkmen72 picture sturkmen72  路  3Comments

charlesxwang picture charlesxwang  路  3Comments

orange-jacky picture orange-jacky  路  3Comments

dpo picture dpo  路  3Comments

praneethsusarla picture praneethsusarla  路  3Comments