Where’s Waldo Solver

For the final project in my Computer Vision class (ECE 5554), I decided that the children’s book Where’s Waldo needed to be solved. For good. All those countless hours spent searching for the red and white striped man could be best spent elsewhere. You know, like solving mazes in Highlights.

After some research, I decided that I could construct a Hidden Markov Model based on the 2-dimensional Discrete Cosine Transform (2D DCT) of our friend, Waldo. Using the model, we could scan through a much larger image, looking for sections that closely match the model of Waldo. If the match is close enough (i.e. over a threshold), then highlight that section blue. We can play with the threshold to make the identification better or worse. With the test images, we saw a 70% positive detection of Waldo. Just think, with a few more algorithm and speed optimizations, manually solving for that elusive figure will be a thing of the past!

You can find the report and MATLAB code below. The code is based on the HMM Toolbox.

Related

Posts navigation

4 comments on “Where’s Waldo Solver”

hey bro.. my name is ryan from indonesia, i wanna ask you about program “finding waldo” with HMM method, coz i have a final task about HMM..
This is my story :
I wanna ask you how to change the objek in program “finding waldo” coz my task just want to change the objek (waldo) to find the “illagal logging” in image taken from google earth ..
i know we should change the parameters to find it ,for example to find waldo we have to use parameters like: hat, face and t-shirt and of course there is a sample picture of waldo as a clue to find waldo (pic size 20×40).

i wanna change the objek (waldo) to image illegal logging taken from google earth , so this programme will be finding illegal logging not finding waldo anymore.. can you please help me? i really need your help :)

Hi Ryan! Thanks for taking a look at the project. How familiar are you with HMMs? The important thing is that there must be some kind of change over the sub-image (the illegal logging in your case) that remains constant. In the example of Waldo, Waldo could almost always be seen with the red hat, beige face, and red/white shirt – in that order from top to bottom. Are there at least 2-3 “features” that you can use in the sub-image that always appear in a particular order? If not, you might want to look at another method (such as Eigenface).

If you’ve downloaded the code, take a look at the train_image_mhmm.m file. You can change the training image (images/sub/waldo-cal-01-lq.jpg to the image of your choice) and adjust the numbers in “% Define user parameters” and “% Define regions from picture (states)” sections to best match the picture. This is a LOT of trial and error to produce a good HMM fit. The training script produces a 3D chart that shows the 3 color channels (RGB) sampled over the image (apologies that the graphs are not well labeled. This program was thrown together for school). As you can see, the amount of red, blue, and green change over the sections of the sampled image. Because the RGB curves always have that same basic shape over most Waldos (hat, face, shirt), we can train an HMM to those curves.

For now, play with those parameters and consider how you would fit an HMM to your sub-image. I hope that gives you a good start. Please let me know if you have any more questions!

Thank’s for the opinion that you gave to me, i’ll try as good as i can do, but i just wanna know how to create trial and error files?? cause you say “This is a LOT of trial and error to produce a good HMM fit. ” . In my case (Illegal Lgging) i really need them, so i wanna know how to create it?

There are no files that you can use for trial and error. What I mean is that you need to find an example of your image (illegal logging in this case) and use the train_image_mhmm.m script on the image to train an HMM. Then, adjust the parameters in train_image_mhmm.m and run it again. Does the HMM fit the image better? If you can’t get a good fit with 3 HMM states, you probably need to try a different number of states (2, 4, 5, etc.). Hope that helps!