RS.py 文件源码

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

项目:osrmacro 作者: jjvilm 项目源码 文件源码
def is_button_selected(button_name):
    """Returns true if button is selected, else False"""
    x1, y1, x2, y2 = press_button(button_name, 'coords')
    button_img = Screenshot.shoot(x1,y1,x2,y2, 'hsv')
    lower_red = np.array([0,179,0])
    upper_red = np.array([4,193,255])

    mask = cv2.inRange(button_img, lower_red, upper_red)

    for colors in mask:
        for value in colors:
            if value == 255:
                #print('{} is selected'.format(button_name))
                return 1
    #print('{} is NOT selected'.format(button_name))
    return 0
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号