def _move_mouse(): # We need to move not always to the same spot # as otherwise it's not spotted as a move. mousemove( randint(200, 300), randint(200, 300), )
def buildVertPanorama(step=375, delay=10): time.sleep(delay) with mss.mss() as capture: monitor = capture.monitors[1] imgArray = [numpy.array(capture.grab(monitor))] for _ in range(20): mousemove(movex=step, movey=0, delay=0) imgArray.append(numpy.array(capture.grab(monitor))) # stitcher = cv2.createStitcher(False) # result = stitcher.stitch(imgArray) # cv2.imshow('Verticle Stitch test', result) # if cv2.waitKey(25) & 0xFF == ord('q'): # cv2.destroyAllWindows() orig = imgArray[0] for i in imgArray: print("MSE: ", compare_mse(orig, i)) print("ssim: ", compare_ssim(orig, i, multichannel=True)) print("psnr: ", compare_psnr(orig, i)) # cv2.imshow('Verticle Stitch test', i) # cv2.waitKey(0) # cv2.destroyAllWindows() return imgArray #def mean_square_error()
def _move_mouse(): # We need to move not always to the same spot # as otherwise it's not spotted as a move. mousemove( randint(200,300), randint(200,300), )
def _fourod_pauseplay(): if not utils.is_running("Safari"): return width, height = utils.screen_size() mouseclick(30, height-50) sleep(1) mousemove(300,100)