This is a port of Dr. Curtis Wookcock's image segmentation code from IPW to C code using GDAL