Algorithms to estimate contours: two applications of analytical tools in differential geometry and topology