def ui():
"""
warp the image according to the current tile locations. The whole image processing is done here.
"""
global warped_surface
counter = 0
while capture:
if not screen_is_locked_manually:
start = time.time()
temp = pygame.transform.rotate(screen.copy(), 90)
img = numpy.copy(pygame.surfarray.pixels3d(temp))
circle_coords = cv.detect_colored_circles(img, radius_range, hsv_color_ranges, counter=counter, debug=False)
if circle_coords is not None:
warped_array = cv.warp(overlay, circle_coords)
path = 'doc/3_warped_array_'+str(counter)+'.png'
scipy.misc.imsave(path, warped_array)
warped_surface = pygame.transform.flip(pygame.image.load(path), True, False)
warped_surface.set_alpha(150)
else:
print('put the tiles back, man!')
counter += 1
start.py 文件源码
python
阅读 31
收藏 0
点赞 0
评论 0
评论列表
文章目录