参考自github项目 https://github.com/nemanja-m/gaps
先选择一张图片 男神镇楼
把一张图片变成拼图
1 | def create_puzzle(image_path, output_path, piece_size): |
1 | def flatten_image(image, piece_size, indexed=False): |
1 | class Piece(object): |
1 | def assemble_image(pieces, rows, columns): |
参考链接
关于 hstack和vstack函数
https://blog.csdn.net/garfielder007/article/details/51378296
https://blog.csdn.net/csdn15698845876/article/details/73380803