Puzzle Image Processing
Sam Bair(Group Leader)
Nick HallidayNathan Malkin
Joe Wang
Scramble Squares
The object of the puzzle is “to arrange the nine pieces into a square so that the graphics on the pieces' edges match perfectly to form a completed design in every direction”.
Scramble Squares® are made by b.dazzle, inc.®
Our Goal
Goal:
• Create program(s) that use 9 pre-scanned image files to produce a solution to the puzzle
• Use the solution to create a visualization of the work accomplished by the project
ResourcesEngine
• MATLAB programming language The MathWorks is the creator of MATLAB and a sponsor of SI
Computers
• The program ran primarily on OSC’s Pentium 4 Cluster
– Four gigabytes of RAM
– Two 2.4 GHz Intel P4 Xeon processors
Structure of the Programs
Our group’s programs:
• Processed image files to determine unique objects
• Matched the images to find a solution to the puzzle
• Created a visualization displaying an animation of the algorithm and the results it produced
Integrating the Programs
ImageProcessing
Main Program
Matching Algorithm
Visualization
OutputTo User
Two Interfaces
Automatic:• Program detects
unique objects and categorizes them
Program allows for 2 ways of “input”
Images
Manual:• User categorizes
the edges
Solve the puzzleImage Processing
Two Interfaces (Contd.)Both input methods use a system of upper/lower
case letters assigned to each unique object
Image Processing• Purpose: to match two edges of two puzzle pieces• “Edge detection” used in comparison
– Black and white pixel matching
Image Processing (Contd.)
– Outputs a matching percentage – 100 is perfectly matching, 0 is no matching at all
• Difficulties: image quality interferes with recognition, preventing accurate results
Matching Algorithm
• 9x4 matrix holds letters assigned to unique objects
• Program checks 1269 combinations of sides and stores the information (matches/doesn’t match) in a 4-dimensional matrix
Matching Algorithm / Visualization
Algorithm:• Picks starting piece and side (e.g. 1,1)• Selects succession of pieces and checks appropriate matches on the go• The possible combinations are tried in turn• Some combinations are skipped as soon it is determined that they
cannot yield a solution
Visualization
• Takes solution file produced by the main program and loads images ..
• Simulates the algorithm used by the main program to show the steps it went through
• Images are moved into the position dictated by the simulation (see above)
• Movement is saved as many image files• All the image files are then combined into
a movie/animation created by a MATLAB program
The Results
Our group solved the puzzle by combining the effort of humans and computers.
While the fully automated program was not completed, an understanding of the concepts its development required was reached.
More time spent on the project would have likely yielded more and better results.
ConclusionCan you solve my puzzle?• Technical limitations prevented our programs
from producing final solutions
If we had more time, we would:• Optimize image processing code for speed and
efficiency• Develop a better image matching algorithm [as
explained in 5/6]• Improve interaction with user• Develop more complex visualizations• MAKE IT WORK!
Our group would like to thank everyone who helped us with our project, including:
• Sam Bair• b.dazzle, inc• The staff of OSC
– Alan Chalker