0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0
ID: 3612907 • Letter: 0
Question
0 0 0 0 0 0 0 0 0 0
0 0 0 1 1 1 0 0 0 0
0 0 1 1 1 1 1 0 0 0
0 0 0 1 1 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0
In analyzing a binary picture it is often necessary to identifythe edges. Let us define an element of the picture (called apixel) to be an edge pixel if it is a 1 and at least on e of thepixels immediately above, below, left and right is 0. We canthen show the edges by setting each edge pixel to 1 and all otherpixels to 0. After identifying the edges, in the precedingpicture, we obtain
0 0 0 0 0 0 0 0 0 0
0 0 0 1 1 1 0 0 0 0
0 0 1 0 0 0 1 0 0 0
0 0 0 1 1 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0
Some suggestions for doing this assignment: (please state thename of each function and what it does)
1. Use two matrices – onematrix has the present picture, the second matrix stores thepicture showing the edges.
2. Format your output. If thedisplay does not look like a matrix, it will be difficult debuggingyour program.