utils.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:vision 作者: SouthEugeneRoboticsTeam 项目源码 文件源码
def get_args():
    default_config = []

    if '-cf' not in sys.argv and '--config' not in sys.argv:
        default_config = [os.getenv('VISION_CONFIG', os.path.join(os.path.dirname(__file__), '../config/config.ini'))]

    parser = configargparse.ArgParser(default_config_files=default_config, auto_env_var_prefix='VISION_')

    parser.add_argument("-i", "--image", help="path to image")
    parser.add_argument("-s", "--sources", type=list, default=[0, 1], help="video sources (default=[0,1])")
    parser.add_argument("-d", "--display", action="store_true", help="display results of processing in a new window")
    parser.add_argument("-ip", "--roborio-ip", help="the ip address of the roboRIO")
    parser.add_argument("-ma", "--min-area", type=int, help="minimum area for blobs")
    parser.add_argument("-mx", "--max-area", type=int, help="maximum area for blobs")
    parser.add_argument("-lt", "--lower-color", action="append", nargs="+", type=int, help="lower color threshold for BGR values")
    parser.add_argument("-ut", "--upper-color", action="append", nargs="+", type=int, help="upper color threshold for BGR values")
    parser.add_argument("-v", "--verbose", action="store_true", help="for debugging, prints useful values")

    return vars(parser.parse_args())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号