## 2 Related Works  
Optical character recognition (OCR) converts pdf files, scanned documents, images containing text and printed and handwritten documents into editable electronic documents. OCR can be implemented for printed character recognition and handwritten character recognition. The latter is further categorized into online and offline recognition systems. In online systems, real-time recognition of characters is performed while the user is writing. Offline recognition is performed on document images or pdfs. Therefore, it is a more complex problem than online recognition. OCR for languages like English and Chinese is available in handheld devices and personal computers [3,4]. In developing OCR for handwritten documents, text line segmentation is a major step and is a challenging problem. Ref. [5] gives an overview of the different methods used for text line extraction, such as projection profiles, smearing methods, Hough transform-based methods and stochastic methods using the Viterbi algorithm. [PERSON] et al. proposed a method to extract text lines by considering the height of the connected components and neighborhood connectivity [6]. In [7], connected components in the image are partitioned into three subsets based on their height. Every connected component in a subset is bounded by an equally sized block. Text lines are extracted by applying a Hough transform to these blocks. Ref. [8] presents text line extraction from handwritten documents using natural learning techniques based on the Hough transform. The Hough transform is applied to the minima points of connected components in a small strip of the image. Minima points are then clustered by applying a moving window algorithm to extract the text lines. [PERSON] et al. [9] performed text line segmentation using a watershed transform for Arabic documents. Text lines were linked by connected component analysis and the watershed transform was applied to detect the text lines. Another approach uses a baseline detected using a projection profile, and then a watershed transform is applied on the extracted path to segment the text lines. Figure 1: Sample of ascender, descender, Chandrakkala, and compound letters with varying gaps depending on handwriting in Malayalam. Deep learning architectures like convolutional neural networks (CNN) and generative adversarial networks (GAN), trained using annotated images, are used to extract the text lines in [10; 11]. [PERSON] et al. [12] proposed an unsupervised deep learning technique for the extraction of text lines. It makes use of the difference in the number of foreground pixels in the text line region and the space between the text lines. Ref. [13] presents a learning free algorithm for text line segmentation. On convolving the input image and second derivative of an anisotropic Gaussian filter, blob lines are detected, which strike through the text lines. Text lines are extracted by assigning connected components to the blob lines detected. Text line extraction from handwritten documents in Indian languages such as Oriya, Bangla and Kannada has been performed by applying a projection profile on the document image [14; 15; 16]. Works on the recognition of handwritten Malayalam characters have mainly focused on classifying isolated letters. [PERSON] et al. [17] proposed a method to recognize the individual characters in Malayalam using the gradient and curvature features of handwritten characters. In [18], handwritten Malayalam character recognition is performed by determining the position and number of horizontal and vertical lines in the skeletonized character set. A chain code histogram from the chain code representation of the boundary of a skeletonized character image is used as a feature vector for character recognition in [19]. Ref. [20] presents the recognition of handwritten Malayalam vowel characters using a Hidden Markov Model tool kit. [PERSON] et al. proposed stacked long short-term memory (LSTM) neural networks for the recognition of Malayalam letters [21].