A Technique for the Design and Implementation of an Ocr for Printed Nastalique Text
Total Page:16
File Type:pdf, Size:1020Kb
A TECHNIQUE FOR THE DESIGN AND IMPLEMENTATION OF AN OCR FOR PRINTED NASTALIQUE TEXT By SOHAIL ABDUL SATTAR Thesis submitted for the Degree of Doctor of Philosophy Department of Computer Science and Information Technology N.E.D. University of Engineering & Technology Karachi, Sindh Pakistan July, 2009 A TECHNIQUE FOR THE DESIGN AND IMPLEMENTATION OF AN OCR FOR PRINTED NASTALIQUE TEXT Ph.D. Thesis By SOHAIL ABDUL SATTAR Research supervisor Dr. Shamsul Haque Research co-supervisor Dr. Mahmood Khan Pathan Department of Computer Science and Information Technology N.E.D. University of Engineering & Technology Karachi, Sindh Pakistan July, 2009 ii Statement of Copyright This copy of the thesis has been supplied on condition that anyone who consults, it is understood to recognize that the copyright rests with the University and that no quotations from the thesis and no information derived from it may be published without the permission of the University. © 2009 by NED University of Engineering & Technology iii Certificate Certified that the thesis entitled, “A Technique for the Design and Implementation of an OCR for Printed Nastalique Text” is being submitted by Sohail Abdul Sattar for the award of degree of Doctor of Philosophy in the department of Computer Science and Information Technology, NED University of Engineering and Technology, Karachi, is a record of the candidate’s own original work carried out by him under my supervision and guidance. The work incorporated in this thesis has not been submitted elsewhere for the award of any other degree. Dr. Shamsul Haque Research supervisor Department of Computer Science & Information Technology NED University of Engineering & Technology, Karachi. iv Lovingly dedicated to the following departed souls, my father, Dr. Abdul Ghaffar, my inspiration for achievement, ~ my beloved mother, Zubaida Khatoon, whose prayers stood by me at all times and whose confidence in me willed me to go on, ~ my respected supervisor Dr. Syed Salahuddin Hyder, for introducing me to the challenges in Computer vision and leading me to the path of research. v Acknowledgements All praise and thanks to Almighty Allah (SWT) Who provides opportunities to gain knowledge and opens up ways to make the most daunting tasks possible and achievable. My most humble thanks to, The authorities of the NED University of Engineering and Technology for allowing me to pursue my dream in carrying out this research and for providing me all the facilities throughout the course. Dr. Shamsul Haque, my supervisor whose continuous guidance and support helped me bring this work to completion. Dr. Mahmood Khan Pathan, my co-supervisor, for his supervision from proposal preparation till finalizing of the thesis. Dr. Mubarak Shah, my supervisor at the Computer Vision lab., University of Central Florida, for his generous help and guidance in computer vision and for his invaluable ideas on quality paper writing. Colleagues at the CV lab UCF especially Javed, Arslan and Alexie. My friends in Orlando whose hospitality and love made me feel at home and cared for. My daughter Maryam, who had to struggle with Maths alone during my stay in Orlando. My son Abdullah, who did not forget to brush his teeth, even though I was not there. Many friends, colleagues and companions whose help and contributions have in many ways made my work easier and enjoyable. Last, but not the least I am highly indebted to my wife, Aysha, for the endless hours she spent on proof reading and language corrections in this document and for standing by me whenever I was depressed or felt stressed. vi Abstract This thesis presents a novel segmentation free technique for the design and implementation of an OCR (Optical Character Recognition) system for printed Nastalique text. Specific area of this thesis is document understanding and recognition which is a branch of computer vision and in turn a sub-class of Artificial Intelligence. Optical character recognition is the translation of optically scanned bitmaps of printed or hand written text into digitally editable data files. OCRs developed for many world languages are already under efficient use but none exist for Nastalique – a calligraphic adaptation of the Arabic script, just as Jawi is for Malay. More often, a single script with its basic character shapes is adapted for writing in multiple languages e.g. the Roman script for English, German and French, and the Arabic script for Persian, Sindhi, Urdu, Pashtu and Malay. Urdu has 39 characters against the Arabic 28. Each character then has two to four different shapes according to their position in the word: isolated, initial, medial and final. Many character shapes have multiple instances and are context sensitive – character shapes changing with changes in the antecedent or the precedent character. At times even the third or the fourth character may cause a similar change depicting an n-gram model in a Markov chain. Unlike the Roman script, word and character overlapping in Nastalique, makes optical recognition extremely complex. Compared to Roman script languages’ OCRs very little research work is done on Arabic Naskh OCR. Only a few Arabic Naskh OCR systems are available today and they too are far from perfect, lagging behind in accuracy as compared to Roman script OCR systems. In this perspective Nastalique is even more complicated than Naskh as it has multiple base lines, more overlapping of characters within a ligature and between adjacent ligatures, vertical stacking of characters in a ligature etc. Urdu has still not attracted researchers’ attention for the development of OCR partly due to lack of funds in this area but mainly due to the challenges the Nastalique style offers because of its cursiveness and context-sensitivity. For the same reason published research work in this area is nearly non-existent. vii The proposed system for Nastalique OCR does not require segmentation of a ligature into constituent character shapes. However, it does require segmentation at two levels i.e. first the text image is segmented into lines of text then each of the lines of text is further segmented into ligatures or isolated characters. The next step is a line by line cross-correlation for recognition of characters in the ligatures whereby, character codes are written into a text file in the sequence the characters are found in the ligature. As the recognition process is completed, the character codes in the text file are given to the rendering engine, which displays the recognized text in a text region. The limitation of the proposed Nastalique character recognition system is that it is font dependent: it needs the same font file for recognition which was used to write the text in. The new undertaking has greater challenges as it will aim to overcome the inherent cursiveness and context sensitivity of Nastalique style of writing. For Nastalique OCR, we develop character-based True Type Font files for a few Nastalique words. These words are written using the same character-based TTF font and an image is made of the Nastalique text. The image is then given to our Nastalique OCR. After recognition the rendering is done by using the same TTF font file to display the recognized text. The work is therefore three folds; development of character-based Nastalique True Type Font, Nastalique character recognition and rendering the recognized text using character-based Nastalique True Type Font. Since our character-based segmentation-free Nastalique OCR algorithm needs, as a ground work, a character-based Nastalique Text Processor, we have also proposed a Finite State Nastalique Text Processor Model. Implementation is not yet done so results are not reported. However this model could serve as an impetus for future research in this challenging field. Optical Character Recognition for Roman script languages is almost a solved problem for document images and researchers are now focusing on extraction and recognition of text from video scenes. This new and emerging field in character recognition is called Video OCR and has numerous applications like video annotation, indexing, retrieval, search, digital libraries, and lecture video indexing. The emerging field for character recognition is attracting research on other scripts like Chinese, but to the best of our knowledge, no work is reported as yet, on Video OCR for Arabic script languages like Arabic, Persian and Urdu. viii As an extension of our Nastalique OCR to Video OCR for Arabic script languages, we have also performed experiments on video text identification, localization and extraction for its recognition. We have used MACH (Maximum Average Correlation Height) filter to identify text regions in video frames, these text regions are then localized and extracted for recognition. All research and development work is done using Matlab 7.0. Experiments and results are reported in the thesis. ix Table of Contents Statement of Copyright ......................................................................................................... iii Certificate ............................................................................................................................... iv Acknowledgements ................................................................................................................ vi Abstract .................................................................................................................................. vii List of Tables ........................................................................................................................