start.py 文件源码

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

项目:Physical-Image-Manipulation-Program 作者: philipptrenz 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号