Text this: Algorithm for length estimation based on the vertex chain code