Where’s Waldo?
Where’s Waldo?
Using ImageContents to solve the popular childhood game.
I recently learned about ImageContents, which is new in Mathematica 12. Basically, this function tries to identify entities within an image and returns a dataset with those identities. I thought it might be kind of fun to try it with Where’s Waldo.
We will start with an easy image:
In[]:=
ImageContents
,AcceptanceThreshold0.3
Out[]=
There’s Waldo! He’s the fourth entity the function found. Now, let’s try one a little harder. Since the image is more challenging, I decreased the acceptance threshold. Let’s run ImageContents on this picture:
In[]:=
ImageContents
,AcceptanceThreshold0.01
Out[]=
There’s Waldo again! This time, he is the third entity the function found. Now, let’s try one even harder.
This time I took the Acceptance Threshold as far down as I could before the function stopped increasing the results (capped out at 88 possible entities). Here’s what we get:
This time I took the Acceptance Threshold as far down as I could before the function stopped increasing the results (capped out at 88 possible entities). Here’s what we get:
In[]:=
ImageContents
,AcceptanceThreshold0.0001
Out[]=
Unfortunately, no Waldo detected this time, even after scrutinizing all 88 entries.
I know this notebook isn’t going to necessarily change the game for Mathematica, but I had fun trying out this experiment! I’m looking forward to seeing what this function and the rest of Mathematica 12 will bring to the community.