modified image processing to simplify the detected contours so that each
contour is a collection of several straight lines instead of a pixel-by-
pixel contour.