This package contains a linear programming-based solver for jigsaw puzzle problems. The solver is based on linear programming and is implemented from the paper by Yu et al. (2015). The current implementation only provides the 'free' strategy and can only solve Type I problems (i.e. problems where the orientation of the pieces is known).
To subdivide any square image into a number of blocks (sixteen by default) and shuffle them, use:
shuffle-image input.png shuffled.png [-n number of pieces] [-r random seed]
To reconstruct the shuffled image with the LP-based algorithm, use:
solve-jigsaw-lp shuffled.png reconstructed.png [-n number of pieces] [-r random seed] [-m max. number of simplex iterations]
scikit-image
may complain about unknown locales.
To resolve this issue, please make sure to have a valid locale set, e.g. in
a Bash shell enter:
$ export LC_ALL=en_US.UTF-8; export LANG=en_US
- Yu, R., Russell, C., & Agapito, L. (2015). Solving Jigsaw Puzzles with Linear Programming. arXiv preprint arXiv:1511.04472.