Edge Detection / Image Processing
Due: 10-11-94
Those of you who took 420 in the Spring will have seen this
set-up before but the details have changed.
For those of you that didn't this will bring you up
to speed on the CM in a friendly way.
The purpose of this homework is to introduce you to data parallel programming
on the CM-5 and to the tools needed to accomplish program development in
our environment. The actual task required of you is straightforward, but
there are a lot of pieces that have to come together for you to be
successful. In addition to the information in this handout and page,
Here's a page
of helpful hints
for this problem set.
Your program will perform edge detection on an image stored in
a two dimensional data
array and create a second data array with the edges found in the first
array.
You will hand in printout of the critical procedure.
Also, demonstrate your program to Bob during office hours or at the
lab seminar.
Background
You will work with real valued data attached to a two dimensional regular
grid with periodic boundary conditions (opposing edges are also nearest
neighbors). This geometric grid is represented in the data parallel
programming language C* by a "shape," all of whose "positions" can be operated
on in parallel. See the Getting Started
in C* manual and the conx online CM-5
documentation for details.
What your program should do
Your program
will take one parameter the command line:
an1 <name of image file>
Here, an1 is the name of the program, the first argument is the
filename of a file containing image data to be used as input (see here for an example of how to generate such
data).
When it runs, your program will read the file containing the image, convert
the color image data to a single real gray scale value, and then should
do a local neighbor calculation to detect edges in the image.
What to hand in
You should observe the actions of your program using the PRISM debugger and
visualizer. Use the PRISM visualizers to look at the effect of the
your edge detection algorithm on the image.
- Hand in a printout of the file process_image.cs which will
contain the code that you have written and modified.
- Demonstrate your program for Bob during the lab seminar or his
office hours.
What you are given
Fortunately, you do not have to start this project entirely from scratch!
You are given a program consisting of several files. This program handles
the reading of the input image and parameters. It then calls a function
called process_image which you must modify to complete
the homework. The function process_image is defined in its own file
(process_image.cs) and it is the modified version of this file that you
should hand in with the assignment. None of the other files should need
to be modified.
Files and How to Get them
The tar archive is here. If you click on
it, Mosaic will attempt to load the archive to your local disk. The
helpful hints
document contains more detail of this process.
The files can be extracted
using the command
The code you must modify
The actual code you have to change is all contained in the file
process_image.cs. For your edification, here is a highly commented version of that file.
prepared by Bob Carter with thanks to Roscoe Giles