46
430
APPENDIX F. SOURCE CODE LISTINGS
/**************************************************
*
*
detect_edges(...
*
*
This function detects edges in an area of one
*
image and sends the result to another image
*
on disk. It reads the input image from disk,
*
calls a convolution function, and then writes
*
the result out to disk. If needed, it
*
allocates space on disk for the output image.
*
***************************************************/
detect_edges(the_image, out_image,
detect_type, threshold, high,
rows, cols, bits_per_pixel)
int
detect_type, high, threshold;
long
rows, cols, bits_per_pixel;
short **the_image, **out_image;
{
perform_convolution(the_image, out_image,
detect_type, threshold,
rows, cols,
bits_per_pixel,
high);
fix_edges(out_image, 1, rows, cols);
} /* ends detect_edges */
/**********************************************************
*
*
perform_convolution(...
*
*
This function performs convolution between the input
*
image and 8 3x3 masks. The result is placed in