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/placeholder.jpg

Handle Handle

Source

OpenCV

hw2_files/part1/image_part1b.png

Handle Handle

Source

Part 2

Find and mark the borders of all 16 blocks in the grid (draw red rectangles around them). Also, change the color of the selected blocks from gray to blue. Solve this and all subsequent problems using either MATLAB or OpenCV.

hw2_files/part2/image_part2a.png

search_placeholder.jpg

Source

Part 3

Write a program that uses basic morphological operations to identify and crop the 4x4 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 word in the upper-left corner. Then print it on the console in ASCII, e.g.,

POPPY

hw2_files/part8/image_part8a.png

placeholder.jpg

Source

Part 9

This is the same as problem 8, but now print all the words in the entire matrix.

hw2_files/part9/image_part9a.png

placeholder.jpg

Source

Part 10

Print only the selected words (highlighted in gray) in ASCII.

hw2_files/part10/wordle_1_125.png

placeholder.jpg

Source

Extra Credit 1

Print the words that are in the purple category. Keep in mind that the position of the purple row may vary depending on the test image. If there is no purple row then print an error message.

hw2_files/placeholder.jpg

hw2_files/placeholder.jpg

Source

Extra Credit 2

Write a program in any programming language that solves the puzzle for a given image of the puzzle. That is, it takes the results of part 9, but instead of printing the matrix of words it prints four groups of four words that correspond to the categories in the puzzle. You can use any libraries or tools that you might need. Test your code on at least 5 puzzles.

hw2_files/placeholder.jpg

hw2_files/placeholder.jpg

Source