I am working on OCR system for Devanagari and trying to extract the basic building components. The basic components may include vertical lines, horizontal lines, curves, closed loops etc. As a segmentation result I want to extract these components. A sample of segmentation is shown in the figure attached here.