# HCI/CprE/ComS 575: Homework #2

First, Last Name
< netid@iastate.edu>

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

Source

### OpenCV

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.

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).

Source

## Part 4

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

Source

## Part 5

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

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.

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.

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

Source

## Part 9

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

Source

## Part 10

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

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.

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.

Source