monkey.py 文件源码

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

项目:AutomatorX 作者: xiaoyaojjian 项目源码 文件源码
def main(serial=None, host=None, port=None):
    d = atx.connect(serial, host=host, port=port)
    while True:
        pilimg = d.screenshot()
        cv2img = imutils.from_pillow(pilimg)
        # cv2img = cv2.imread('tmp.png')
        # cv2.imwrite('tmp.png', cv2img)
        cv2img = cv2.resize(cv2img, fx=0.5, fy=0.5, dsize=(0, 0))
        pt = choose_point(cv2img)
        print 'click:', pt
        if pt:
            x, y = pt
            d.click(2*x, 2*y)
        cv2.waitKey(100)
        # import time
        # time.sleep(0.1)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号