AIDP algorithm for polygonal approximation of PGM Images.
Works on images with multiple polygons, 1 pixel wide.