38
510
APPENDIX F. SOURCE CODE LISTINGS
******************************************/
get_image_size(name1, &length, &width);
the_image = allocate_image_array(length, width);
out_image = allocate_image_array(length, width);
create_file_if_needed(name1, name2, out_image);
read_image_array(name1, the_image);
/*********************************
*
*
Manual Threshold operation
*
*********************************/
if(argv[6][0] == ’t’ || argv[6][0] == ’T’){
manual_threshold_segmentation(
the_image, out_image,
hi, low, value, segment,
length, width);
write_image_array(name2, out_image);
} /* ends if t */
/*********************************
*
*
Grow region operation
*
*********************************/
if(argv[6][0] == ’g’ || argv[6][0] == ’G’){
grow(the_image, value,
length, width);
write_image_array(name2, the_image);
} /* ends if g */
/*********************************
*
*
Peak threshold operation
*
*********************************/