Supplementary files for this homework are posted on the class web page.

Part 1

Write a program that uses basic morphological operations to identify and mark all horizontal lines in the empty grid image. The result image should contain only the horizontal lines. Then, write another program to detect only the vertical lines. Edit the web template to display your result images and the computer code that was used to generate it for this and all subsequent parts. You must solve part1 using Matlab and OpenCV.

Matlab

hw2_files/part1/image_part1a.png

Handle

Source

OpenCV

hw2_files/part1/image_part1b.png

Handle

Source

Note: change the file name if necessary to link your code

Part 2

Find and mark all small squares in the grid. Change the color of the green squares to blue; and the color of the orange squares to brown. Solve this and all subsequent problems using either MATLAB or OpenCV.

hw2_files/part2/image_part2.png

search_placeholder.jpg

search_placeholder.jpg

Source

Part 3

Write a program that uses basic morphological operations to identify and crop the 6x5 grid in the image shown below. The result image should contain only the pixels inside the grid (similar to the test images for the previous two problems).

hw2_files/part3/image_part3a.png

search_placeholder.jpg

Source

Part 4

Find all 'A' letters within the grid and color them red.

hw2_files/part4/image_part4a.png

placeholder.jpg

Source

Part 5

Find and color all vowels within the grid (A, E, I, O, U, Y). Color each vowel in a different color.

hw2_files/part5/image_part5a.png

placeholder.jpg

Source

Part 6

Find all vowels within the grid and replace each with the same letter but in a different font.

You will have to make your own templates for the new versions of the six vowels, or figure out some other way to print text to an image at the right pixel coordinates. Cutouts of all symbols used in this problem can be found in the letter_cutouts folder.

hw2_files/part6/image_part6a.png

placeholder.jpg

Source

Part 7

Find all letters within the grid. Color each letter in a different random color. Identical letters must have the same color. Cutouts of all 26 letters used in the word search puzzles can be found in the 'letter_cutouts' folder.

hw2_files/part7/image_part7a.png

placeholder.jpg

Source

Part 8

Write a program to detect the guess word in each row of the input image and print it on the screen in all-caps. Don't print anything for the empty rows (if any) at the bottom of the image. The output in this case is not an image, but text in ASCII format that is printed on the screen. For example, for the test image shown below the output should be

CLOUD

BLUNT

ULTRA

hw2_files/part8/image_part8a.png

placeholder.jpg

Source

Part 9

This is the same as problem 8, but now also print two integers after each word that indicate the quality of the guess. The first integer indicates the number of letters in correct positions (green squares). The second integer maps to the correct letters but in wrong positions (orange squares). For example:

CLOUD 1 1

BLUNT 1 2

ULTRA 5 0

hw2_files/part9/image_part9a.png

placeholder.jpg

Source

Part 10

Solve at least two Wordle puzzles by playing the game online (Wordle). Take screenshots of the browser window as you play the game (after each guess). Then, run these images through your program. This is essentially the same as problem 9, but with images that you generated. Make sure to match the scale (or image resolution) in order to use the same letter templates. Note: For this problem, you may have to create your own letter templates by cropping them from the new test images using your favorite image editor.

hw2_files/part10/image_part10a.png

placeholder.jpg

Source

Extra Credit

Take cellphone images of the screen as you collect the screenshots for problem 10. Then, extend your program to work with these cellphone images. Show your results for at least three different images. It is OK if your program does not work perfectly on one of them. Explain the challenges that you encountered and what could be improved if you had more time.

hw2_files/partEC/image_partECa.png

placeholder.jpg

Source