Text this: Heuristic algorithm to generate modified Freeman Chain Code from thinned binary image