示例#1
0
    img = img[...,:3]
    img = np.ascontiguousarray(img)

    return img


v1 = Vision('Zombie.png')
v2 = Vision('creeper.png')
v3 = Vision('steeve.png')

loopTime = time()
while (True):

    screenshot = windowCapture()

    points = v1.findObjects(screenshot, 0.5, 'rectangles')
    points = v2.findObjects(screenshot, 0.5, 'rectangles')
    points = v3.findObjects(screenshot, 0.7, 'rectangles')


    print('Fps: {}'. format(1/(time()-loopTime)))
    loopTime = time()

    if cv.waitKey(1) == ord('q'):
        break


cv.destroyAllWindows()
print('Done')