Data acquisition
(This is known as Chroma Key, Blue Screen or Background Color method)
- Find a well-lit room, with the least lighting variation across the room.
- Find a color (hue) that is rarely used in the entire puzzle / picture.
- Get a color paper that has that exactly same color.
- Place as many puzzle pieces on the color paper as it'll fit.
- You can categorize the puzzles into batches and use it as a computer hint later on.
- Make sure the pieces do not overlap or touch each other.
- Do not worry about orientation yet.
- Take picture and download to computer.
- Color calibration may be needed because the Chroma Key background may have upset the built-in color balance of the digital camera.
Acquisition data processing
- Get some computer vision software
- OpenCV, MATLAB, C++, Java, Python Imaging Library, etc.
- Perform connected-component on the chroma key color on the image.
- Ask for the contours of the holes of the connected component, which are the puzzle pieces.
- Fix errors in the detected list.
- Choose the indexing vocabulary (cf. Ira Baxter's post) and measure the pieces.
- If the pieces are rectangular, find the corners first.
- If the pieces are silghtly-off quadrilateral, the side lengths (measured corner to corner) is also a valuable signature.
- Search for "Shape Context" on SO or Google or here.
- Finally, get the color histogram of the piece, so that you can query pieces by color later.
- To make them searchable, put them in a database, so that you can query pieces with any combinations of indexing vocabulary.