blog

How to always find Waldo — With help from Steve Jobs

Someone asked on Stackoverflow, a sort of collaborative Q&A wiki for programmers, if there was a way to find the most famous time-traveling, red and white shirt wearing backpacker using Mathematica which is a popular software that is used by a wide range of amateurs and professionals such as product designers, architects, and financial analysts. It is used to “not only to solve complex math problems but also to create and analyze computer models. It can predict how varying the ingredients in a shampoo will alter its flow through different-size bottle openings, for example, or how the pounding of ocean waves will affect a breakwater.” And now thanks to a resourceful and super smart community that responded to the Waldo question, we can add “finding Waldo” to Mathematica’s long list of applications. Conceptually, the solution seemed pretty obvious to me. First you filter out all the non-red colors by using:

waldo = Import["http://www.findwaldo.com/fankit/graphics/IntlManOfLiterature/Scenes/DepartmentStore.jpg"];
red = Fold[ImageSubtract, #[[1]], Rest[#]] &@ColorSeparate[waldo];

OBVIOUSLY. And then you “use Binarize to pick out the pixels in the image with a sufficiently high correlation and draw white circle around them to emphasize them using Dilation.” DUH. As the New York Times pointed out, the development of this algorithm “will have serious implications for United States surveillance operations if terrorists ever start wearing stripy sweaters and red stocking caps.” The US government officials in WALDO: THE MOVIE might need this software if they’re to find Waldo, a former secret agent gone rogue. The mock trailer looks pretty amazing:

Random Mathematica trivia (you know, in case this comes up at a bar someday and you want to impress that hottie MIT student): “The name of the program “Mathematica” was suggested to Stephen Wolfram by Apple co-founder Steve Jobs although Stephen Wolfram had thought about it earlier and rejected it.” The program was initially called “Omega” and then “PolyMath” which Jobs thought were all terrible.