opencv / opencv

Open Source Computer Vision Library
https://opencv.org
Apache License 2.0
76.84k stars 55.66k forks source link

OpenCV Error: Bad argument (can not convert: [true] to [int]) in from_str, command_line_parser.cpp, line 98 ERRORS: Parameter 'd': can not convert: [true] to [int] #10715

Closed moonsummer closed 6 years ago

moonsummer commented 6 years ago

System information (version)

==================

./tracker Basic marker detection for drone localization Usage: tracker [params]

-c
    Camera intrinsic parameters. Needed for marker pose
--ci (value:0)
    Camera id if input doesnt come from video (-v)
--cp
    Camera position and rotation file. Default is camra at origin pointing up, y oppoite of N, x opposite of E
-d
    dictionary: DICT_4X4_50=0, DICT_4X4_100=1, DICT_4X4_250=2 DICT_4X4_1000=3, DICT_5X5_50=4, DICT_5X5_100=5, DICT_5X5_250=6, DICT_5X5_1000=7, DICT_6X6_50=8, DICT_6X6_100=9, DICT_6X6_250=10, DICT_6X6_1000=11, DICT_7X7_50=12,DICT_7X7_100=13, DICT_7X7_250=14, DICT_7X7_1000=15, DICT_ARUCO_ORIGINAL = 16
--db (value:57600)
    Baudrate for Mavlink device
--dp
    File of marker detector parameters
--dv (value:/dev/ttyUSB0)
    Device for Mavlink
-r
    show rejected candidates too

./tracker -v /dev/video0 -d DICT_4X4_100=1 --db 57600 --dv /dev/ttyS0

OpenCV Error: Bad argument (can not convert: [true] to [int]) in from_str, file /home/farsight/opencv/opencv-3.2.0/modules/core/src/command_line_parser.cpp, line 98

ERRORS: Parameter 'd': can not convert: [true] to [int]

======================== The programe url https://github.com/skrogh/droneTracker

berak commented 6 years ago

since this is using cv::CommandLineParser, you have to call your program like:

./tracker --ci=0 -d=1 --db=57600 --dv=/dev/ttyS0

(you're missing the = between argument name and value, also the DICT is an enum)

moonsummer commented 6 years ago

Thank you very much.Now the project run successfuly. @berak