Now we can prune this adjacency matrix to identify just those pieces that have smooth color transitions in their adjacent configuration. This information can be used to build an adjacency matrix indicating which pieces fit together. Next, I would build information about the shape of each of the four edges of a puzzle piece. These would have exactly two edges that have flat contours (see contour map below). So what kind of information will the program will be supplied - let's assume that each puzzle piece is an small rectangular image with transparency information used to identify the portion of the puzzle piece that represent non-rectangular edges.įrom this, it is relatively easy to identify the four corner pieces (in a typical jigsaw). The overall size and number of pieces provide the general dimensions of the puzzle.The orientation information of each piece (where flat and corner edges may lie).The color information of each of the pieces (adjacent pieces will generally have smooth transitions).The shape information of each of the pieces (how their edges appear).There are four key pieces of information that you can use individually and together as clues to solving a jigsaw puzzle: Here's my thoughts on an approach to writing a program to solve such a puzzle. Solving problems like this can be deceptively complicated, especially if no constraints are placed on the size and complexity of the puzzle.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |