
I was thinking about splitting the sample image:

into a grid, based on pieces size:

and then to compare each remaining piece to each square, of course rotating the piece in 4 positions. But I'm not quite sure if any existing free "duplicate images finder" would be able to determine that these two images are actually the "same":


So I think I'd need to use a different kind of grid which gets rid of "cavities" and "projections":

How can I obtain such a grid from an image using ImageMagick?
And, once I have it, is it possibile to create several different files from it (one per piece)?
And, finally, does it exist an ImageMagick function to "fuzz compare" two images?
But actually, being able to create such a program would be really cool!
http://www.youtube.com/watch?v=BnGu3t5oNdA
In this video, OpenCV is used rather than ImageMagick; it's also free and opensource... but I can't find any source of the jigsaw solver!
Could imagemagick be used to create such a program?