PUZZLE SOLVER

A project assignment in the course on Image Analysis. Given a picture of an unsolved jigzaw puzzle, do it. Implemented in MATLAB together with Andreas Agvard.

Document
Puzzle solver (in Swedish, pdf)

original

Image 1: Picture of an unsolved jigsaw puzzle. The pieces are laid on a rectangular paper to make the next step easier.

rectified
Image 2: We start by using the Canny edge detector to find edges. The result is then Radon transformed and then the inverse transform is applied to the four brightest pixels. The result is the four sharpest lines in the original image, which corresponds to the edges of the paper. Once again, the four brightest pixels are found, these are the corners of the paper which are used to rectify the image.

morphological operations
Image 3: The background is removed and the pieces are labeled.

skin areas
Image 4: Every single piece is individually rectified.

skin areas
Image 5: The knobs and holes that are found. The area, width and height/depth of these are compared to find matching pieces.

skin areas
Image 6: The solved jigsaw puzzle.