Adding ability to output shape polygons without issues

Also adds to the execution time, but edge detection is expensive.