Do the following:
Meet Waldo.

Waldo, as you may be aware, frequently hides, and we need to find him. Your job is to create a program which will automatically find Waldos in images such as this.

In every image there will be the following kinds of Waldo:
In addition every image will contain 6 herring chunks that contain values near zero, but are not waldos.
Write a program to automatically find as many Waldos as you can in these images. It should return the row and column of the center of the Waldo. For example, the position of the red pixel in this image
![]()
is [2,4].
Your program must read the input image from either "findWaldo.png" or "findWaldo.pgm" (both files will correspond to the same scene). Write the results to a file called "waldo.txt". This file must contain one line for each waldo identified. Each line must contain the first index of the image, a space, and then the second index, followed by a newline. For example:
13 47 78 13 107 33Your numbers need to be within 2 pixels of the center of the waldo for the normal size waldos and 4 pixels for the 2x size waldos. You can output decimal numbers if you'd like. Credit will be awarded for this portion of the assignment as follows.
Here are several sample pictures to test your code on, and an image of Waldo himself. To grade your code we will run it on images generated the same way.
The white pixels in the Waldo image are not considered part of Waldo. That is, they will not generally be white for the exact match Waldos.
The following are useful links for working with pgm images.
Here are two new samples and ground truth results for testing:
New sample 1: [PNG] [PGM] answers
New sample 2: [PNG] [PGM] answers
NOTE: be careful about confusion with the order of the answers. Pixels
are counted from (0,0) at the top left, wheres most other things, such
as the "plot" function in matlab, consider (0,0) to be bottom left
| Useful Links |
PGM specification |
You may also want to use some of the starter code for Lab 2, which contains read and write functions for PGM images.
Remember to create a URL that