Automatic Solution of Jigsaw Puzzles