"Applied Science, Faculty of"@en . "Electrical and Computer Engineering, Department of"@en . "DSpace"@en . "UBCV"@en . "Wong, Ing Hoo"@en . "2010-05-28T11:57:01Z"@en . "1985"@en . "Master of Applied Science - MASc"@en . "University of British Columbia"@en . "This thesis presents the design of a recognizer for unconstrained handprinted alphanumeric characters. The design is based on a thinning process that is capable of producing thinned images with well defined features that are considered essential for character image description and recognition. By choosing the topological points of the thinned ('line') character image as these desired features, the thinning process achieves not only a high degree of data reduction but also transforms a binary image into a discrete form of line drawing that can be represented by graphs. As a result powerful graphical analysis techniques can be applied to analyze and classify the image.\r\nThe image classification is performed in two stages. Firstly, a technique for identifying the topological points in the thinned image is developed. These topological points represent the global features of the image and because of their invariance to elastic deformations, they are used for image preclassification. Preclassification results in a substantial reduction in the entropy of the input image. The subsequent process can concentrate only on the differentiation of images that are topologically equivalent. In the preclassifier simple logic operations localized to the immediate neighbourhood of each pixel are used. These operations are also highly independent and easy to implement using VLSI. A graphical technique for image extraction and representation called the chain coded digraph representation is introduced. The technique uses global features such as nodes and the Freeman's chain codes for digital curves as branches. The chain coded digraph contains all the information that is present in the thinned image. This avoids using the image feature extraction approach for image description and data reduction (a difficult process to optimize) without sacrificing speed or complexity.\r\nAfter preclassification, a second stage of the recognition process analyses the chain coded digraph using the concept of attributed relational graph (ARG). ARG representation of the image can be obtained readily through simple transformations or rewriting rules from the chain coded digraph. The ARG representation of an image describes the shape primitives in the image and their relationships. Final classification of the input image can be made by comparing its ARG with the ARGs of known characters. The final classification involves only the comparison of ARGs of a predetermined topology. This information is crucial to the design of a matching algorithm called the reference guided inexact matching procedure, designed for high speed matching of character image ARGs. This graph matching procedure is shown to be much faster than other conventional graph matching procedures. The designed recognizer is implemented in Pascal on the PDP11/23 and VAX 11/750 computer. Test using Munson's data shows a high recognition rate of 91.46%. However, the recognizer is designed with the aim of an eventual implementation using VLSI and also as a basic recognizer for further research in reading machines. Therefore its full potential is yet to be realized. Nevertheless, the experiments with Munson's data illustrates the effectiveness of the design approach and the advantages it offers as a basic system for future research."@en . "https://circle.library.ubc.ca/rest/handle/2429/25135?expand=metadata"@en . "DESIGN OF A REALTIME HIGH SPEED RECOGNIZER FOR UNCONSTRAINED HANDPRINTED ALPHANUMERIC CHARACTERS By ING HOO WONG B.E . E l e c . (Hons.), U n i v e r s i t y of Melbourne A u s t r a l i a , 1980 A THESIS SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF APPLIED SCIENCE ^ i n THE FACULTY OF GRADUATE STUDIES Department of E l e c t r i c a l E n g i n e e r i n g We a c c e p t t h i s t h e s i s as c o n f o r m i n g t o the r e q u i r e d s t a n d a r d THE UNIVERSITY OF BRITISH COLUMBIA Fe b r u a r y 1985 \u00C2\u00A9 Ing Hoo Wong In p r e s e n t i n g t h i s t h e s i s i n p a r t i a l f u l f i l m e n t of the r e q u i r e m e n t s f o r an advanced degree a t the The U n i v e r s i t y of B r i t i s h C o l u m b i a , I agree t h a t the L i b r a r y s h a l l make i t f r e e l y a v a i l a b l e f o r r e f e r e n c e and s t u d y . I f u r t h e r agree t h a t p e r m i s s i o n f o r e x t e n s i v e c o p y i n g of t h i s t h e s i s f o r s c h o l a r l y p u r p o s e s may be g r a n t e d by the Head of my Department or by h i s or her r e p r e s e n t a t i v e s . I t i s unde r s t o o d t h a t c o p y i n g or p u b l i c a t i o n of t h i s t h e s i s f o r f i n a n c i a l g a i n s h a l l not be a l l o w e d w i t h o u t my w r i t t e n permi s s i o n . ELECTRICAL ENGINEERING The U n i v e r s i t y of B r i t i s h Columbia 2075 Wesbrook P l a c e Vancouver, Canada V6T 1W5 Date: F e b r u a r y 1985 i i A b s t r a c t . T h i s t h e s i s p r e s e n t s the d e s i g n of a r e c o g n i z e r f o r u n c o n s t r a i n e d h a n d p r i n t e d a l p h a n u m e r i c c h a r a c t e r s . The d e s i g n i s based on a t h i n n i n g p r o c e s s t h a t i s c a p a b l e of p r o d u c i n g t h i n n e d images w i t h w e l l d e f i n e d f e a t u r e s t h a t a r e c o n s i d e r e d e s s e n t i a l f o r c h a r a c t e r image d e s c r i p t i o n and r e c o g n i t i o n . By c h o o s i n g the t o p o l o g i c a l p o i n t s of the t h i n n e d ( ' l i n e ' ) c h a r a c t e r image as these d e s i r e d f e a t u r e s , the t h i n n i n g p r o c e s s a c h i e v e s not o n l y a h i g h degree of d a t a r e d u c t i o n but a l s o t r a n s f o r m s a b i n a r y image i n t o a d i s c r e t e form of l i n e d r awing t h a t can be r e p r e s e n t e d by g raphs. As a r e s u l t p o w e r f u l g r a p h i c a l a n a l y s i s t e c h n i q u e s can be a p p l i e d t o a n a l y z e and c l a s s i f y the image. The image c l a s s i f i c a t i o n i s performed i n two s t a g e s . F i r s t l y , a t e c h n i q u e f o r i d e n t i f y i n g the t o p o l o g i c a l p o i n t s i n the t h i n n e d image i s d e v e l o p e d . These t o p o l o g i c a l p o i n t s r e p r e s e n t the g l o b a l f e a t u r e s of t h e image and because of t h e i r i n v a r i a n c e t o e l a s t i c d e f o r m a t i o n s , they a r e used f o r image p r e c l a s s i f i c a t i o n . P r e c l a s s i f i c a t i o n r e s u l t s i n a s u b s t a n t i a l r e d u c t i o n i n the e n t r o p y of the i n p u t image. The subsequent p r o c e s s can c o n c e n t r a t e o n l y on the d i f f e r e n t i a t i o n of images t h a t a r e t o p o l o g i c a l l y e q u i v a l e n t . I n the p r e c l a s s i f i e r s i m p l e l o g i c o p e r a t i o n s l o c a l i z e d t o the immediate neighbourhood of each p i x e l a r e used. These o p e r a t i o n s a r e a l s o h i g h l y independent and easy t o implement u s i n g V L S I . A g r a p h i c a l t e c h n i q u e f o r image e x t r a c t i o n and r e p r e s e n t a t i o n c a l l e d the c h a i n coded d i g r a p h r e p r e s e n t a t i o n i s i n t r o d u c e d . The t e c h n i q u e uses g l o b a l f e a t u r e s such as nodes and the Freeman's c h a i n codes f o r d i g i t a l c u r v e s as branches. The c h a i n coded d i g r a p h c o n t a i n s a l l the i n f o r m a t i o n t h a t i s p r e s e n t i n the t h i n n e d image. T h i s a v o i d s u s i n g the image f e a t u r e e x t r a c t i o n approach f o r image d e s c r i p t i o n and da t a r e d u c t i o n (a d i f f i c u l t p r o c e s s t o o p t i m i z e ) w i t h o u t s a c r i f y i n g speed or c o m p l e x i t y . A f t e r p r e c l a s s i f i c a t i o n , a second stage of the r e c o g n i t i o n p r o c e s s a n a l y s e s t h e c h a i n coded d i g r a p h u s i n g the concept of a t t r i b u t e d r e l a t i o n a l graph (ARG). ARG r e p r e s e n t a t i o n of the image can be o b t a i n e d r e a d i l y t h r o u g h s i m p l e t r a n s f o r m a t i o n s or r e w r i t i n g r u l e s from the c h a i n coded d i g r a p h . The ARG r e p r e s e n t a t i o n of an image d e s c r i b e s the shape p r i m i t i v e s i n the image and t h e i r r e l a t i o n s h i p s . F i n a l c l a s s i f i c a t i o n of the i n p u t image can be made by comparing i t s ARG w i t h the ARGs of known c h a r a c t e r s . The f i n a l c l a s s i f i c a t i o n i n v o l v e s o n l y the comparison of ARGs of a p r e d e t e r m i n e d t o p o l o g y . T h i s i n f o r m a t i o n i s c r u c i a l t o the d e s i g n of a matching a l g o r i t h m c a l l e d the r e f e r e n c e g u i d e d i n e x a c t matching p r o c e d u r e , d e s i g n e d f o r h i g h speed matching of c h a r a c t e r image ARGs. T h i s graph matching p r o c e d u r e i s shown t o be much f a s t e r than o t h e r c o n v e n t i o n a l graph matching p r o c e d u r e s . The d e s i g n e d r e c o g n i z e r i s implemented i n P a s c a l on the PDP11/23 and VAX 11/750 computer. Test u s i n g Munson's da t a shows a h i g h r e c o g n i t i o n r a t e of 91.46%. However, the r e c o g n i z e r i s d e s i g n e d w i t h the aim of an e v e n t u a l i m p l e m e n t a t i o n u s i n g VLSI and a l s o as a b a s i c r e c o g n i z e r f o r f u r t h e r r e s e a r c h i n r e a d i n g machines. T h e r e f o r e i t s f u l l p o t e n t i a l i s y e t t o be r e a l i z e d . N e v e r t h e l e s s , the e x p e r i m e n t s w i t h Munson's d a t a i l l u s t r a t e s the e f f e c t i v e n e s s of the d e s i g n approach and the advantages i t o f f e r s as a b a s i c system f o r f u t u r e r e s e a r c h . T a b l e of c o n t e n t s . Page A b s t r a c t . . i i T a ble of c o n t e n t s v L i s t of f i g u r e s v i i L i s t of t a b l e s i x Acknowledgements x I. INTRODUCTION 1 1. B a s i c c h a r a c t e r r e c o g n i t i o n p r o c e s s 3 2. Problem d e f i n i t i o n - A statement of o b j e c t i v e s . ..7 3. Data base 10 I I . FINAL PREPROCESSING AND DATA REDUCTION 11 1 . I n t r o d u c t i o n 11 2. B a s i c d i s c r e t e geometry and d e f i n i t i o n s 13 2.1 B a s i c d e f i n i t i o n s 13 2.2 S p e c i f i c a t i o n s f o r t h i n n e d images 14 3. Design r u l e s f o r the m o d i f i e d t h i n n i n g a l g o r i t h m 16 3.1 D e f i n i t i o n s f o r the t h i n n i n g a l g o r i t h m 16 3.2 Implementation of t h i n n i n g a l g o r i t h m and t e s t r e s u l t s 24 4. D i s c u s s i o n 27 I I I . IMAGE EXTRACTION, REPRESENTATION AND PRECLASSIF I CATION 32 1. I n t r o d u c t i o n 32 2. Image d e f i n i t i o n 35 2.1 B a s i c c o n c e p t s - d i s c r e t e c u r v e geometry and graph 35 2.2 G l o b a l f e a t u r e d e t e c t i o n and e x t r a c t i o n 39 3. Image e x t r a c t i o n 46 3.1 Data s t r u c t u r e . 46 3.2 Image e x t r a c t i o n and s p u r i o u s branch p r u n i n g p rocedure 47 v i page 4. Image p r e c l a s s i f i c a t i o n 51 4.1 Input e n t r o p y r e d u c t i o n due t o p r e c l a s s i f i c a t i o n 52 5. D i s c u s s i o n 54 IV. FINAL IMAGE CLASSIFICATION 61 1 . I n t r o d u c t i o n 61 2. A t t r i b u t e d r e l a t i o n a l graphs - An i n t r o d u c t i o n . ..63 2.1 B a s i c d e f i n i t i o n and t e r m i n o l o g y 63 2.2 ARG d e f o r m a t i o n models 66 2.3 D e f o r m a t i o n d i s t a n c e measures f o r ARG 68 '3. T r a n s f o r m a t i o n of c h a i n coded d i g r a p h t o ARG 71 3.1 R e w r i t i n g of node p r i m i t i v e s 72 3.2 R e w r i t i n g of branch p r i m i t i v e s 73 3.2.1 Length a t t r i b u t e d e f i n i t i o n and e x t r a c t i o n 75 3.2.2 C u r v a t u r e a t t r i b u t e d e f i n i t i o n and e x t r a c t i o n 76 3.3.3 D e f i n i t i o n and e x t r a c t i o n of 0 1 and 82. . . 7 9 4. ARG matching 86 4.1 Concept of r e f e r e n c e guided matching 86 4.2 D i s t a n c e m a t r i x and r e f e r e n c e g u i d e d i n e x a c t matching p r o c e d u r e 89 4.2.1 C o m p u t a t i o n a l c o m p l e x i t y 93 5. F i n a l r e c o g n i z e r i m p l e m e n t a t i o n and performance. .95 5.1 F i n a l r e c o g n i z e r i m p l e m e n t a t i o n 95 5.2 Performance w i t h Munson's data 98 V . CONCLUSION AND FUTURE DEVELOPMENTS 105 R e f e r e n c e s . 109 v i i L i s t of f i g u r e s . F i g u r e page 1.1 B l o c k diagram of a t y p i c a l o p t i c a l r e c o g n i t i o n p r o c e s s 3 1.2 B l o c k diagram of f i n a l r e c o g n i z e r 9 2.1 P i x e l s P1 - P8 are l o c a l n e i g h b o u r s of a p i x e l P 13 2.2 L o c a l neighbourhood of a m u l t i p l e p i x e l P 17 2.3 L o c a l neighbourhood of a t e n t a t i v e l y m u l t i p l e p i x e l P 17 2.4 L o c a l neighbourhood of t e n t a t i v e l y m u l t i p l e p i x e l s t h a t a r e removable 18 2.5 Test image 19 2.6a Test image t h i n n i n g w i t h o r i g i n a l P a v l i d i s a l g o r i t h m 20 2.6b Test image t h i n n i n g w i t h m o d i f i e d a l g o r i t h m 21 2.7 Sample b i n a r y c h a r a c t e r s from Munson's d a t a 29 2.8a Sample b i n a r y c h a r a c t e r s t h i n n e d w i t h o r i g i n a l P a v l i d i s a l g o r i t h m 30 2.8b Sample b i n a r y c h a r a c t e r s t h i n n e d w i t h m o d i f i e d a l g o r i t h m 31 3.1 Examples of j u n c t i o n s w i t h r a d i a l i t y g r e a t e r than f o u r 36 3.2 L o c a l neighbourhood of an i l l e g a l J3 p i x e l P 41 3.3 L o c a l neighbourhood of a J3 p i x e l h a v i n g f i v e n e i g h b o u r s 41 3.4 L o c a l neighbourhood of an i l l e g a l J4 p i x e l P 42 3.5 C r i t i c a l p o i n t s of c h a r a c t e r images from Munson's d a t a and t h e i r 'analogue e q u i v a l e n t ' 45 i i x page 3.6 Images w i t h i d e n t i c a l g l o b a l f e a t u r e s t h a t a re ar e t o p o l o g i c a l l y i n e q u i v a l e n t 55 3.7 R e p r e s e n t a t i o n of c h a r a t e r 'A' b e f o r e p r u n i n g (a) and a f t e r p r u n i n g (b) 58 4.1 ARG d e s c r i p t i o n of c h a r a c t e r 'R' 65 4.2 D i f f e r e n t forms of a s i n g l e c h a r a c t e r h a v i n g the same t o p o l o g y 96 4.3 B l o c k diagram showing the f i n a l i m p l e m e n t a t i o n of the r e c o g n i z e r and i t s p o t e n t i a l f u t u r e developments 102 i x L i s t o f t a b l e s . T a ble page I . A t y p i c a l node d a t a t a b l e f o r c h a i n coded d i g a r p h r e p r e s e n t a t i o n of t h i n n e d a l p h a n u m e r i c c h a r a c t e r s . ..56 I I . Group c l a s s i f i c a t i o n of sample c h a r a c t e r s from Munson's d a t a 57 I I I . E q u i v a l e n c e between c h a i n coded d i g r a p h and ARG NDTs 72 IV. T a b l e showing the number of t o p o l o g i e s f o r each image i n a g i v e n p r e c l a s s i f i e d group and the d i c t i o n a r y s i z e of each group 101 V. T a b l e of r e c o g n i t i o n r a t e s f o r d i f f e r e n t c h a r a c t e r s . .101 X Acknowledgements. I would l i k e t o thank P r o f . M. P. Beddoes whose guidance and f i n a n c i a l s u p port i n the form of Research A s s i s t a n t s h i p has made t h i s t h e s i s p o s s i b l e , and t o P r o f . R. W. Donaldson f o r the use of Munson's d a t a . CHAPTER I INTRODUCTION. Machine r e c o g n i t i o n of h a n d p r i n t e d c h a r a c t e r s i s an ar e a of r e s e a r c h t h a t has been a c t i v e l y pursued by many r e s e a r c h e r s i n the f i e l d of p a t t e r n r e c o g n i t i o n and computer v i s i o n . The r e s u l t s of t h e s e a c t i v i t i e s a r e p r e s e n t e d i n the numerous r e p o r t s and p u b l i c a t i o n s on the s u b j e c t d a t i n g back t o over two decades. A study of t h i s e x t e n s i v e l i t e r a t u r e as w e l l as a summary of the problems, t e c h n i q u e s and performance of r e c o g n i z e r s f o r Roman l e t t e r s i s p r e s e n t e d by Suen et al. i n [ 1 ] . I n the p a s t , r e s e a r c h has been c o n c e n t r a t e d on both o n - l i n e and o f f - l i n e t e c h n i q u e s f o r c h a r a c t e r r e c o g n i t i o n . I n o n - l i n e c h a r a c t e r r e c o g n i t i o n , d a t a i n p u t t o the r e c o g n i z e r o c c u r s as i t i s g e n e r a t e d , such as w r i t i n g w i t h a l i g h t pen or on a d i g i t i z i n g t a b l e t . O n - l i n e r e c o g n i t i o n has l i m i t e d use and advantage because the r e c o g n i t i o n can be done under the s u p e r v i s i o n of the w r i t e r . I n p r e s e n t day r e s e a r c h , the main e f f o r t has been c o n c e n t r a t e d on o f f - l i n e c h a r a c t e r r e c o g n i t i o n which i s re g a r d e d as a more d i f f i c u l t problem. In o f f - l i n e r e c o g n i t i o n t h e o b j e c t i v e i s t o r e c o g n i z e c h a r a c t e r images such as p r i n t e d t e x t or w r i t t e n m a t e r i a l . As p r i n t , s c r i p t and paper remains the dominant media where i n f o r m a t i o n i s s t o r e d , the e f f i c i e n c y of e l e c t r o n i c d a t a p r o c e s s i n g can be improved by a more e f f i c i e n t i n t e r f a c e between the p r i n t or w r i t t e n m a t e r i a l and the d i g i t a l computer. T h e r e f o r e t h e advantages of a d i r e c t d a t a i n p u t i n t o computers v i a automated machine r e c o g n i t i o n p r o v i d e a s t r o n g m o t i v a t i o n and c h a l l e n g e t o r e s e a r c h e r s i n p a t t e r n r e c o g n i t i o n . Another important a p p l i c a t i o n of o f f - l i n e c h a r a c t e r r e c o g n i t i o n i s the development of a r e a d i n g a i d f o r the b l i n d . The advances made i n the m i c r o p r o c e s s o r t e c h n o l o g y , speech s y n t h e s i s and the i n c r e a s e d p o r t a b i l i t y of m i c r o p r o c e s s o r based machines have made the r e a l i z a t i o n of a p o r t a b l e r e a d i n g machine both t e c h n i c a l l y and e c o n o m i c a l l y a t t r a c t i v e . P r e s e n t l y the r e c o g n i t i o n of p r i n t e d and w r i t t e n m a t e r i a l has been r e s t r i c t e d t o the r e c o g n i t i o n of i n d i v i d u a l c h a r a c t e r s , e x c e p t f o r a meagre few [ 3 4 ] , t h a t have i n v e s t i g a t e d the p o s s i b i l i t y of word r e c o g n i t i o n . The main a c t i v i t i e s i n c h a r a c t e r r e c o g n i t i o n have now been d i v i d e d i n t o two main streams, a l p h a n u m e r i c c h a r a c t e r and Chinese or Japanese c h a r a c t e r r e c o g n i t i o n . A l t h o u g h i n t e r e s t i n g r e s u l t s have been r e p o r t e d i n the r e s e a r c h on the l a t t e r by M o r i et al. [ 5 ] , the work p r e s e n t e d i n t h i s r e s e a r c h p r o j e c t c o n c e r n s o n l y o f f - l i n e r e c o g n i t i o n of u n c o n s t r a i n e d h a n d p r i n t e d c h a r a c t e r s . A b r i e f summary of the b a s i c p r o c e d u r e s t h a t a r e i n v o l v e d i n a complete o p t i c a l c h a r a c t e r r e c o g n i z e r w i l l be g i v e n i n the f o l l o w i n g s e c t i o n as an i n t r o d u c t i o n t o the s u b j e c t as w e l l as t o p r o v i d e the f o u n d a t i o n f o r a f o r m a l d e s c r i p t i o n of the o b j e c t i v e s of t h i s r e s e a r c h . 1. B a s i c c h a r a c t e r r e c o g n i t i o n p r o c e s s . A l l t he v a r i o u s t e c h n i q u e s of computer c h a r a c t e r r e c o g n i t i o n can be viewed as c o m p r i s i n g of the f o l l o w i n g p r o c e s s e s ; image c a p t u r e and d i g i t i z a t i o n , c h a r a c t e r s e g m e n t a t i o n , p r e p r o c e s s i n g , image e x t r a c t i o n and r e c o g n i t i o n . These p r o c e s s e s a r e shown i n the b l o c k diagram of a t y p i c a l o p t i c a l c h a r a c t e r r e c o g n i z e r i n f i g u r e 1.1. D i g i t a l Computer Input Image Image Capture and D i g i t i z a t i o n Preprocessing Image or Feature Extract ion Recogni t ion Output - Character ident i t y . F i g . 1.1 B l o c k diagram of a t y p i c a l o p t i c a l c h a r a c t e r r e c o g n i t i o n p r o c e s s . The p r e s e n t t e c h n o l o g y t h a t i s a v a i l a b l e f o r use i n image c a p t u r e such as t h e charge d c o u p l e d d e v i c e s or h i g h r e s o l u t i o n TV cameras can p r o v i d e a h i g h q u a l i t y d i g i t i z e d image f o r computer p r o c e s s i n g . These images a r e o f t e n a c q u i r e d w i t h m u l t i l e v e l i n t e n s i t i e s . S i n c e c h a r a c t e r r e c o g n i t i o n i n v o l v e s b a s i c a l l y a b i n a r y image, s t a t e of the a r t d a t a a c q u i s i t i o n and d i g i t i z a t i o n i s u s u a l l y adequate. The main problem l i e s i n the subsequent p r o c e s s i n g of the image. C h a r a c t e r segmentation i s a d i f f i c u l t problem and few r e s e a r c h r e s u l t s a r e a v a i l a b l e . In most c a s e s f o r c e d s e gmentation [ 3 6 ] , based on a h e u r i s t i c a pproach i s used w i t h the p r o c e s s a p p l i e d r e c u r s i v e l y u n t i l a s u c c e s s f u l i d e n t i f i c a t i o n can be made. U n l e s s an h i g h l y e f f i c i e n t r e c o g n i z e r c a p a b l e of g u i d i n g t h i s r e c u r s i v e segmentation p r o c e s s i s a v a i l a b l e , segmentation u s i n g t h i s t e c h n i q u e w i l l remain a p a i n f u l l y slow p r o c e s s . T h i s dependence on the r e c o g n i t i o n p r o c e s s s u g g e s t s t h a t s e g m e n t a t i o n cannot be a c c o m p l i s h e d on a mere image p r o c e s s i n g l e v e l , i t must t a k e i n t o account the semantic c o n t e n t of the image. T h e r e f o r e one may be b e t t e r equipped t o s o l v e the problem i f the r e q u i r e m e n t s and t e c h n i q u e s of the subsequent r e c o g n i t i o n p r o c e s s has been b e t t e r e s t a b l i s h e d and u n d e r s t o o d . P r e p r o c e s s i n g i s an i m p o r t a n t s t e p towards s u c c e s s f u l r e c o g n i t i o n . The p r e p r o c e s s i n g r e q u i r e m e n t s of an image v a r i e s from one d e s i g n t o a n o t h e r as i t i s o f t e n d i c t a t e d by the r e c o g n i t i o n t e c h n i q u e used. For example, t e c h n i q u e s t h a t use image c o n t o u r s f o r shape d e s c r i p t i o n and i d e n t i f i c a t i o n r e q u i r e the image t o have w e l l d e f i n e d edges. W h i l e those t h a t r e l y on t h i n n i n g w i l l be s e n s i t i v e t o ' p i n - h o l e s ' i n the b i n a r y image which w i l l l e a d t o the t h i n n e d image h a v i n g s p u r i o u s c l o s e d l o o p s . A p a r t from t h e s e s p e c i a l i z e d f u n c t i o n s , p r e p r o c e s s o r s a r e g e n e r a l l y r e q u i r e d f o r p e r f o r m i n g b a s i c image enchancement f u n c t i o n s such as n o i s e f i l t e r i n g , s c a l i n g and image n o r m a l i z a t i o n . Image or f e a t u r e e x t r a c t i o n and r e c o g n i t i o n forms t h e c e n t r a l i s s u e s t h a t have been r e s e a r c h e d over the y e a r s . The numerous t e c h n i q u e s t h a t have been a p p l i e d t o r e c o g n i z e h a n d p r i n t e d and p r i n t e d a l p h a n u m e r i c c h a r a c t e r s i n d i c a t e t h e d i f f i c u l t y of the problem. T h e o r e t i c a l l y , c l a s s i f i c a t i o n can be made by e x t r a c t i n g d i s t i n g u i s h i n g f e a t u r e s from an i n p u t image and comparing these f e a t u r e s w i t h t h o s e of a known c l a s s of images. In p r a c t i c e t h i s i s a f o r m i d a b l e problem because h a n d p r i n t e d c h a r a c t e r s o f t e n c o n t a i n a wide range of d e f o r m a t i o n s . B e s i d e s , the performance of any r e c o g n i z e r w i l l u l t i m a t e l y be compared t o the human v i s u a l r e c o g n i t i o n system, the most e f f i c i e n t known. In the t h e o r e t i c a l approach t h e c h o i c e of f e a t u r e s a re o f t e n o p t i m i z e d s t a t i s t i c a l l y , t h e s e may not n e c e s s a r i l y be the same as the optimum f e a t u r e s o b t a i n e d from p s y c h o l o g i c a l c o n s i d e r a t i o n s , nor does t h e t h e o r e t i c a l r e c o g n i t i o n p r o c e d u r e t a k e s i n t o account t h e methodology i n v o l v e d i n the human r e c o g n i t i o n p r o c e s s . The p r e s e n t methods of image r e c o g n i t i o n a r e d e r i v e d from two main t h e o r i e s , the s t a t i s t i c a l or d e c i s i o n t h e o r e t i c [ 2 4 ] , and the s y n t a c t i c or l i n g u i s t i c [ 1 7 ] , [ 2 2 ] , a p p r o a c h . The s t a t i s t i c a l a p proach c o n s i s t s of a p a r a m e t r i c approach w h i c h i s based on the m o d e l l i n g of the b a s i c p r o c e s s t h a t g e n e r a t e s the i n p u t images and a p p l y i n g the l a r g e number of p r o b a b i l i t y a n a l y s i s t e c h n i q u e s t o c l a s s i f y an i n p u t ; and a n o n - p a r a m e t r i c approach t h a t c o n c e n t r a t e s on e x t r a c t i n g m u t u a l l y e x c l u s i v e f e a t u r e v e c t o r s from t h e image and r e l i e s on d i s c r i m i n a n t a n a l y s i s of t h e s e f e a t u r e v e c t o r s f o r c l a s s i f i c a t i o n . B o th methods have a c h i e v e d l i m i t e d s u c c e s s when a p p l i e d t o c h a r a c t e r r e c o g n i t i o n because the c h a r a c t e r g e n e r a t i o n p r o c e s s i n a t e x t cannot be a d e q u a t e l y m o d e l l e d and d i s c r i m i n a n t a n a l y s i s o f t e n r e q u i r e s the p r o c e s s i n g of v e c t o r m a t r i c e s of h i g h d i m e n s i o n a l i t y . The s y n t a c t i c approach t o p a t t e r n r e c o g n i t i o n i s d e r i v e d from the n a t u r a l languages t h a t a r e used i n the f i e l d of a r t i f i c i a l i n t e l l i g e n c e [ 3 0 ] , t o e n a b l e computers t o be engaged i n commonsense r e a s o n i n g and u n d e r s t a n d i n g language [ 2 5 ] . I n the s y n t a c t i c approach an image i s d e s c r i b e u s i n g a p i c t u r e d e s c r i p t i o n language (PDL) g e n e r a t e d by a p p l y i n g a s p e c i f i e d s e t of g r a m m a t i c a l r u l e s on a s e t of p r i m i t i v e symbols. R e c o g n i t i o n i s a c h i e v e d by p a r s i n g the r e s u l t i n g PDL g e n e r a t e d from an i n p u t t o d e t e c t the p r e s e n c e of s t r u c t u r e s i n t he PDL t h a t would r e s u l t i n i t s c l a s s i f i c a t i o n . T h i s approach r e s u l t s i n a r i c h e r d e s c r i p t i o n of a p a t t e r n because i t i s based on p a t t e r n p r i m i t i v e s ( t h e b a s i c i d e n t i f i a b l e u n i t i n t he image) i n s t e a d of j u s t some s c a l a r o r p r o b a b i l i t y measures. In s p i t e of i t s h i g h e r d e s c r i p t i v e c a p a b i l i t y , the s y n t a c t i c t e c h n i q u e has two main drawbacks. F i r s t l y , t he i n f e r e n c e of the grammar t h a t i s r e q u i r e d i n g e n e r a t i n g the PDL f o r c h a r a c t e r s images i s a d i f f i c u l t p r o c e s s . T h i s problem i s c o n v o l u t e d by the f a c t t h a t u n c o n s t r a i n e d h a n d p r i n t e d c h a r a c t e r s e x h i b i t c o n s i d e r a b l e v a r i a t i o n s i n shapes due t o d i f f e r e n t w r i t i n g s t y l e s as w e l l as d i s t o r t i o n s . T h e r e f o r e a number of g r a m m a t i c a l r u l e s may be r e q u i r e d f o r a s i n g l e c h a r a c t e r . T h i s p r e s e n t s a c o n s i d e r a b l e i n c r e a s e i n the c o m p u t a t i o n a l r e q u i r e m e n t s as the p a r s i n g a l g o r i t h m s f o r the PDLs a r e o f t e n complex o p e r a t i o n s . S e c o n d l y , the s y n t a c t i c approach t o r e c o g n i t i o n a l o n e l a c k s the c a p a b i l i t y of i n c o r p o r a t i n g c o n t e x t u a l i n f o r m a t i o n i n t o t h e r e c o g n i t i o n p r o c e s s . C o n t e x t u a l i n f o r m a t i o n a r e more r e a d i l y d e s c r i b e d by the use of s t a t i s t i c s as the p r o b a b i l i t y of o c c u r r e n c e of a p a r t i c u l a r c h a r a c t e r c o n d i t i o n e d upon the o b s e r v a t i o n of some o t h e r p r e c e d i n g c h a r a c t e r ( s ) . As a r e s u l t a t t e m p t s have been made t o combine both the s y n t a c t i c and s t a t i s t i c a l methods f o r p a t t e r n r e c o g n i t i o n [ 1 9 ] , 2. Problem d e f i n i t i o n - A statement of o b j e c t i v e s . From the o v e r v i e w of the methods t h a t a r e a v a i l a b l e f o r the d e s i g n of a c h a r a c t e r r e c o g n i z e r and the numerous number of t e c h n i q u e s t h a t have been a p p l i e d t o s o l v i n g the e q u a l l y numerous number of problems a s s o c i a t e d w i t h i t , one may ask i f the g o a l s of an automated c h a r a c t e r r e c o g n i t i o n machine have been r e a c h e d . O b v i o u s l y n o t , f o r t h e f o l l o w i n g r e a s o n s : P r e s e n t c h a r a c t e r r e c o g n i z e r s have been d e v e l o p e d m a i n l y f o r s p e c i a l i z e d u s e s , such as r e a d i n g from a s p e c i a l c h a r a c t e r s e t or p r i n t f o n t . R e s e a r c h on h a n d p r i n t e d c h a r a c t e r r e c o g n i t i o n has been m a i n l y i n v e s t i g a t i v e i n n a t u r e , c o n c e n t r a t i n g on working out t h e fundamental approaches t o t h e s o l u t i o n . R e c o g n i t i o n p r o c e d u r e s and the a s s o c i a t e d image p r o c e s s i n g r e q u i r e m e n t s used t o da t e a r e c o m p u t a t i o n a l l y i n t e n s i v e and u n a t t r a c t i v e f o r r e a l t i m e a p p l i c a t i o n s . C u r r e n t c h a r a c t e r r e c o g n i z e r s do not po s s e s s c o n t e x t u a l p r o c e s s i n g c a p a b i l i t i e s . In machine c h a r a c t e r r e c o g n i t i o n , an i n p u t may be u n i d e n t i f i a b l e because i t has an ambiguous shape. A human reader can u n c o n s c i o u s l y r e s o l v e t h i s a m b i g u i t y by r e f e r e n c e t o h i s g e n e r a l knowledge about the s p e l l i n g of a word or the se m a n t i c s of the c o n t e x t . An e f f i c i e n t c h a r a c t e r r e c o g n i z e r may be r e q u i r e d t o posses s t h i s c a p a b i l i t y i n o r d e r t o be an a c c e p t a b l e replacement f o r the human r e a d e r . The o b j e c t i v e of t h i s r e s e a r c h p r o j e c t i s t o d e s i g n a c h a r a c t e r r e c o g n i z e r f o r u n c o n s t r a i n e d h a n d p r i n t e d a l p h a n u m e r i c c h a r a c t e r s ( r e f e r r e d t o from here onwards s i m p l y as c h a r a c t e r r e c o g n i z e r ) t h a t w i l l p r o v i d e a s a t i s f a c t o r y performance w i t h r e s p e c t t o the f i r s t t h r e e c o n c e r n s g i v e n above. The d e s i g n i s aimed a t p r o d u c i n g a h i g h l y e f f i c i e n t t e c h n i q u e f o r the c o n t e x t f r e e r e c o g n i t i o n of u n c o n s t r a i n e d h a n d p r i n t e d c h a r a c t e r s t h a t i s s u i t a b l e f o r i m p l e m e n t a t i o n i n r e a l t i m e . Such a r e c o g n i z e r w i l l p r o v i d e the i m p o r t a n t knowledge i n r e c o g n i t i o n t e c h n i q u e s and can be used as a b a s i c r e c o g n i z e r f o r f u t u r e r e s e a r c h i n t o the problem of se g m e n t a t i o n , c o n t e x t u a l t e x t p r o c e s s i n g , p s y c h o l o g i c a l c o n s i d e r a t i o n s i n c h a r a c t e r r e c o g n i t i o n and the VLSI i m p l e m e n t a t i o n of a c h a r a c t e r r e c o g n i z e r i n p o r t a b l e u n i t s as an a i d f o r t h e b l i n d . As a f a i r l y s o p h i s t i c a t e d p r e p r o c e s s o r f o r the d i g i t i z e d image has been d e s i g n e d by Lunscher [ 3 3 ] , i n h i s M.A.Sc. r e s e a r c h p r o j e c t , the p r e s e n t d e s i g n w i l l t a k e as i t s i n p u t a b i n a r i z e d image of an i s o l a t e d c h a r a c t e r . I t w i l l emphasizes t e c h n i q u e s t h a t w i l l r e s u l t i n a l g o r i t h m s t h a t a r e f a s t and easy t o implement. S p e c i a l c o n s i d e r a t i o n s a r e g i v e n t o dec r e a s e d a t a m a n i p u l a t i o n and i n c r e a s e c o m p u t a t i o n a l speed. The f i n a l d e s i g n c o m p r i s e s of t h r e e main s t a g e s as shown i below. B1 nary Input Image F inal Preprocess ing (Image Thinning) Single class group Global Feature Detect, Image Extraction and Preclass 1 f i c a t i o n ARG Image Representat(on and Matching 1 >-2 >-Output - Character i d e n t i t y * U n i d e n t i f i a b l e character F i g . 1.2 B l o c k d i a g r a m of t h e f i n a l r e c o g n i z e r . Data r e d u c t i o n i s a c h i e v e d i n the f i r s t s t a g e by u s i n g a new t h i n n i n g a l g o r i t h m s p e c i a l l y a d a p t e d f o r t h i n n i n g a l p h a n u m e r i c c h a r a c t e r s . D e s i g n of t h i s t h i n n i n g a l g o r i t h m i s p r e s e n t e d i n d e t a i l i n c h a p t e r I I . The second s t a g e performs a f a s t p r e c l a s s i f i c a t i o n of the i n p u t image based on i t s t o p o l o g y . I t w i l l l a t e r be shown t h a t t h i s r e s u l t s i n a s u b s t a n t i a l r e d u c t i o n i n t h e e n t r o p y of t h e i n p u t image and i s a c r u c i a l s t e p towards h i g h speed r e c o g n i t i o n . D e s i g n of t h i s image e x t r a c t i o n , r e p r e s e n t a t i o n and p r e c l a s s i f i c a t i o n p r o c e d u r e s w i l l be g i v e n i n c h a p t e r I I I . Chapter IV d e s c r i b e s a c h a r a c t e r d e s c r i p t i o n t e c h n i q u e u s i n g a t t r i b u t e d r e l a t i o n a l graphs (ARGs). The t e c h n i q u e i s based on s i m p l e l o c a l f e a t u r e e x t r a c t i o n p r o c e d u r e s t h a t can be implemented v e r y e f f i c i e n t l y . F i n a l c l a s s i f i c a t i o n i s a c c o m p l i s h e d by matching t h i s ARG r e p r e s e n t a t i o n of a p r e c l a s s i f i e d image w i t h the ARGs of r e f e r e n c e images. A new graph m a t c h i n g p r o c e d u r e i s a l s o d e s i g n e d f o r t h i s purpose w i t h s u p e r i o r c o m p u t a t i o n a l c o m p l e x i t y compared t o c o n v e n t i o n a l graph matching schemes. 3. Data base. Munson's m u l t i - c o d e r a l p h a n u m e r i c c h a r a c t e r images [ 3 ] , a r e used f o r t e s t i n g and v e r i f y i n g the a l g o r i t h m s d e s i g n e d i n t h i s r e s e a r c h p r o j e c t . The d a t a c o n s i s t s of 24x24 b i n a r y images from 49 c o d e r s of c h a r a c t e r s from th e F o r t r a n I I language. Except f o r the s l a s h t o the l e t t e r Z and the c r o s s b a r s f o r the l e t t e r I , the images s i m u l a t e s u n c o n s t r a i n e d h a n d p r i n t e d a l p h a n u m e r i c c h a r a c t e r s . A random 1500 c h a r a c t e r s e t of images was s e l e c t e d f o r t e s t i n g the r e s u l t i n g r e c o g n i z e r . The o n l y c o n d i t i o n was t h a t the images w i t h p i n - h o l e s were e x c l u d e d . T h i s i s due t o the assumption t h a t t h e p r e p r o c e s s o r such as one d e s i g n e d by Lunscher w i l l remove p i n - h o l e n o i s e s . 11 CHAPTER I I FINAL PREPROCESSING AND DATA REDUCTION. 1 . I n t r o d u c t i o n . The use of t h i n n i n g f o r the purpose of d a t a r e d u c t i o n as w e l l as image t r a n s f o r m a t i o n of a b i n a r y c h a r a c t e r image i n t o one t h a t i s b e t t e r s u i t e d f o r more r i g o r o u s a n a l y s i s by d i g i t a l computers w i l l be p r e s e n t e d i n t h i s c h a p t e r . Such t r a n s f o r m a t i o n s a r e p a r t i c u l a r l y w e l l s u i t e d f o r images t h a t were meant t o be t h i n or l i n e d rawings i n the f i r s t p l a c e because i f t h i n n i n g r e s u l t s i n the r e t e n t i o n of the e s s e n t i a l c h a r a c t e r i s t i c s of t h e image then the o r i g i n a l image would have been reduced t o a form t h a t would l e n d i t s e l f more r e a d i l y t o g r a p h i c a l a n a l y s i s . An e a r l y e f f o r t t o o b t a i n the t h i n n e d or s k e l e t a l forms of a b i n a r y image was based on the median a x i s t r a n s f o r m a t i o n (MAT) [ 3 7 ] , which was d e s i g n e d f o r o b t a i n i n g t h e median a x i s or s k e l e t o n of an o b j e c t d e f i n e d on the c o n t i n u o u s or E u c l i d i a n p l a n e . More s u c c e s s f u l c l a s s i c a l t h i n n i n g a l g o r i t h m s o p e r a t e on t h e i n d i v i d u a l p i c t u r e e l e m e n t s , p i x e l s , and examine t h e i r r e l a t i o n s w i t h the r e s t of the p i x e l s and t h e i r complements i n t h e b i n a r y image w i t h r e s p e c t t o a c e r t a i n c o n n e c t i v i t y c r i t e r i a . The c o n n e c t i v i t y c r i t e r i a i s the s i n g l e most i m p o r t a n t and n e c e s s a r y c o n d i t i o n t h a t has t o be s a t i s f e d i f the t o p o l o g i c a l p r o p e r t i e s of an image a r e t o be p r e s e r v e d i n t h e t h i n n i n g p r o c e s s . T h i n n i n g a l g o r i t h m s have e v o l v e d around 12 d i f f e r e n t d e f i n i t i o n s of the c o n n e c t i v i t y c o n d i t i o n , the most p o p u l a r of which has been R o s e n f e l d ' s 4- and 8 - c o n n e c t i v i t y [ 3 8 ] , [ 3 9 ] , [ 4 0 ] . V a r i o u s s u c c e s s f u l t h i n n i n g a l g o r i t h m have been d e s i g n e d around t h i s concept of c o n n e c t i v i t y , a number of which have been w e l l summarized by S t e n t i f o r d [41] and Tamura [ 4 2 ] . These a l g o r i t h m s have been p r e d o m i n a n t l y p a r a l l e l a l g o r i t h m s i n t h a t t h e y r e q u i r e a s e q u e n t i a l e x a m i n a t i o n of a l l t he p i x e l s i n the image a t each i t e r a t i o n of the t h i n n i n g p r o c e s s . F u r thermore the p r o c e s s e s a r e d i r e c t i o n dependent [ 3 8 ] , t h a t i s each i t e r a t i o n w i l l r e q u i r e the a l g o r i t h m t o c o n s i d e r o n l y p i x e l s i n some s p e c i f i c l o c a t i o n ( s ) of the image such as t h e p i x e l s t h a t a r e t o the n o r t h , s o u t h , e a s t or west of the image i n o r d e r t o o b t a i n a s y m m e t r i c a l l y t h i n n e d s k e l e t o n . A l l t h e s e r e q u i r e m e n t s c o u p l e d w i t h the o f t e n n o i s y r e s u l t a n t t h i n n e d images made these c l a s s i c a l t h i n n i n g a l g o r i t h m s t o o slow f o r most r e a l t i m e a p p l i c a t i o n s . In t h i s c h a p t e r a new t h i n n i n g a l g o r i t h m f o r alphanumeric c h a r a c t e r s w i l l be d e s i g n e d . T h i s new a l g o r i t h m i s i n s p i r e d by the a l g o r i t h m of P a v l i d i s [ 4 3 ] , and w i l l i n c l u d e a d d i t i o n a l p r o c e s s i n g t o p r e s e r v e image c o n n e c t i v i t y and shape. a d d r e s s t h e problem of c r o s s o v e r s i n t h e d i g i t i z e d b i n a r y p a t t e r n . t r i m , on the f l y , redundant p i x e l s . The above m a t t e r s a r e c o n s i d e r e d t o be of prime importance i n c h a r a c t e r r e c o g n i t i o n . S e c t i o n 2 p r e s e n t s the b a s i c d e f i n i t i o n s fundamental t o t h e t h i n n i n g p r o c e s s and p r o v i d e s 13 the s p e c i f i c a t i o n s t h a t w i l l be c o n s i d e r e d e s s e n t i a l f o r a t h i n n i n g a l g o r i t h m f o r c h a r a c t e r r e c o g n i t i o n . S e c t i o n 3 g i v e s d e t a i l s of the t h i n n i n g a l g o r i t h m and d i s c u s s some of i t s c h a r a c t e r i s i t c s and the r e s u l t s of i t s a p p l i c a t i o n on some al p h a n u m e r i c c h a r a c t e r s . 2. B a s i c d i s c r e t e geometry and d e f i n i t i o n s . 2.1 B a s i c d e f i n i t i o n s . D e fn: 2.1.1 The local neighbourhood of the p i x e l P i s d e f i n e d as the 8 ne i g h b o u r s of the c e n t r a l l y l o c a t e d p i x e l P i n a 3x3 p i x e l window as shown i n f i g u r e 2.1. P4 P3 P2 P5 P PI P6 P7 P8 F i g . 2.1 P i x e l s P1-P8 a r e the l o c a l s n e i g h b o u r s of P. Defn: 2.1.2 . P i x e l s P1,P3,P5 and P7 a r e c a l l e d t he direct neighbours of P. D e f n : 2.1.3 P i x e l s P2,P4,P6 and P8 a r e c a l l e d the indirect neighbours of P. 14 Defn: 2.1.4 A sequence of p i x e l s S, c o n s i s t i n g of p i x e l s p n...p N i s J-connect ed i f p and p a r e l o c a l n e i g h b o u r s of and D-connect ed i f P j l _ 1 and 1 a r e d i r e c t n e i g h b o u r s of p k f o r 1 < k \u00C2\u00A3 N-1. Defn: 2.1.5 The Is r e p r e s e n t i n g the o b j e c t body i n a b i n a r y image a r e I-c o n n e c t e d w h i l e i t s background r e p r e s e n t e d by 0s a r e D-connected. T h i s i m p l i e s t h a t the 7's i n c l u d e the o b j e c t b o u n d a r i e s w h i l e t h e 0's r e p r e s e n t i n g the background do n o t . T h i s d e f i n i t i o n f o r b i n a r y images s a t i s f i e s t he J o r d a n ' s c u r v e theorem f o r d i g i t a l c u r v e s [ 4 0 ] , which s t a t e s t h a t the complement of a s i m p l e c l o s e d c u r v e C has e x a c t l y two components, one i n s i d e C and one o u t s i d e , and C i s the common boundary between t h e s e two components. T h e r e f o r e , u n l e s s o t h e r w i s e s p e c i f i e d , the above d e f i n i t i o n of c o n n e c t i v i t y w i l l be assumed when r e f e r r i n g t o b i n a r y images i n the r e s t of t h i s t h e s i s . 2.2 S p e c i f i c a t i o n s f o r t h i n n e d images. I t has been assumed i n the p r e v i o u s c h a p t e r t h a t the i n p u t image i s a b i n a r y image of an i s o l a t e d a l p h a n u m e r i c c h a r a c t e r , whose g a u s s i a n type n o i s e has been f i l t e r e d by a p r e p r o c e s s i n g s t a g e and the b i n a r y image a c c u r a t e l y r e p r e s e n t s the 2 - d i m e n s i o n a l image i n t e n d e d by t h e w r i t e r . The t h i n n i n g a l g o r i t h m must reduce t h i s i n p u t i t s s k e l e t a l or t h i n n e d form h a v i n g t h e c h a r a c t e r i s t i c s : image t o f o l l o w i n g 1. The c o n n e c t i v i t y of the d i g i t a l image must be p r e s e r v e d . 2. A r c s or branches of t h e t h i n n e d images must be of s i n g l e p i x e l t h i c k n e s s except a t the l o c a l neighbourhood of an i n t e r s e c t i o n of two or more bra n c h e s . 3. The a n g u l a r c h a r a c t e r i s t i c s of t h e image, s p e c i f i c a l l y a t or near p o i n t s of i n t e r s e c t i o n s must be c o n s i s t e n t w i t h the o r i g i n a l image. For example a concave a r c h opening eastward must t h i n t o a concave l i n e opening e a s t w a r d and not a meandering or f o r k e d l i n e opening e a s t w a r d . 4. The r e s u l t a n t t h i n n e d images must not c o n t a i n any f a l s e b r a n c h e s . That i s , a b r a n c h e x i s t s i n t h e - t h i n n e d image o n l y i f the i n p u t image shows the p h y s i c a l e x i s t e n c e of such a f e a t u r e . T h i s i s d e s i r a b l e so as not t o add f a l s e t o p o l o g i c a l i n f o r m a t i o n t o the image due t o n o i s y t h i n n i n g p r o c e d u r e s . 5. The t h i n n i n g p r o c e s s must be f a s t . I t must be s u i t a b l e f o r s e q u e n t i a l p r o c e s s i n g i n r e a l t i m e as the image i s a c q u i r e d or s u i t a b l e f o r i m p l e m e n t a t i o n i n a m u l t i p r o c e s s o r e n v i r o m e n t . P a v l i d i s a l g o r i t h m p r o v i d e s s o l u t i o n s t o the c h a r a c t e r i s t i c s 2, 4 and 5. But i t f a i l s i n t h e f o l l o w i n g r e s p e c t s : The a l g o r i t h m does not p r e s e r v e c o n n e c t i v i t y i n a l l 1 6 p o s s i b l e c a s e s . I d e a l r i g h t a n g l e s a r e not t h i n n e d c o n s i s t e n t l y i n t h a t the r e s u l t i n g a n g l e s i n the t h i n n e d image depend on the or d e r the p i x e l s a r e scanned. No n o i s e branch t r i m m i n g p r o c e d u r e s have been suggested nor were t h e r e any a n a l y s i s on the ty p e s of i n t e r s e c t i o n s t h a t w i l l r e s u l t from the t h i n n i n g p r o c e s s . These problems w i l l be r e c t i f i e d i n the new or m o d i f i e d t h i n n i n g a l g o r i t h m t h a t i s g i v e n i n the f o l l o w i n g s e c t i o n s . 3. D e s i gn r u l e s f o r the m o d i f i e d t h i n n i n g a l g o r i t h m . 3.1 D e f i n i t i o n s f o r t he t h i n n i n g a l g o r i t h m . The f o l l o w i n g d e f i n i t i o n s p r o v i d e the b a s i c r u l e s f o r the t h i n n i n g p r o c e s s . Defn: 3.1.1 The contour p i x e l s of an image i s the s e t of / p i x e l s t h a t have a t l e a s t ONE d i r e c t neighbour which i s a 0. Contour p i x e l s a r e l a b e l e d 2 as they a r e found. Defn: 3.1.2 A c o n t o u r p i x e l i s multiple i f i t s a t i s f i e s any ONE of the two f o l l o w i n g c o n d i t i o n s : (a) . I t has a t most ONE non-zero n e i g h b o u r . (b) . I t s l o c a l neighbourhood conforms t o e i t h e r ONE of the t h r e e masks shown i n f i g u r e s 2 . 2 ( i - i i i ) o r thos e o b t a i n e d from them by m u l t i p l e s of 90\u00C2\u00B0 r o t a t i o n s . M u l t i p l e p i x e l s a r e l a b e l e d 3 as they a r e found and a r e 17 NOT removable. ( i ) . A A A 0 P 0 where a t l e a s t ONE of A B B B and ONE of B i s nonzero. ( i i ) . A A A A P 0 A 0 B ( i i i ) . where a t l e a s t ONE of A and B i s non-zero. where A i s non-zero and a t l e a s t ONE of C i s z e r o F i g . 2.2 L o c a l neighbourhood of a m u l t i p l e p i x e l P D e f n : 3.1.3 A c o n t o u r p i x e l i s tentatively multiple i f i t s a t i s f i e s any ONE o f the f o l l o w i n g c o n d i t i o n s : (a) . I t has no n e i g h b o u r s l a b e l e d /. (b) . I t s neighbourhood conforms t o t h e mask shown i n f i g u r e 2.3 or t h o s e o b t a i n e d from them by m u l t i p l e s of 90\u00C2\u00B0 r o t a t i o n s . T e n t a t i v e l y m u l t i p l e p i x e l s a r e l a b e l e d 4 as they a r e found. where a t l e a s t ONE of A , B and C must be non- z e r o and D >= 2. I f both C's ar e non-zero then A and B can be a n y t h i n g . A A C 0 P D B B C F i g . 2.3 L o c a l n e ighbourhood of a t e n t a t i v e l y m u l t i p l e p i x e l P . 18 Defn: 3.1.4 A t e n t a t i v e l y m u l t i p l e p i x e l i s removable i f i t s a t i s f i e s ONE of the f o l l o w i n g t h r e e c o n d i t i o n s : (a) . I t s 5-neighbour ( P 5 ) i s z e r o and i t s 1-neighbour ( P I ) i s m u l t i p l e or t e n t a t i v e l y m u l t i p l e . (b) . I t s 3-neighbour (P3) i s z e r o and i t s 6-neighbour (P6) i s m u l t i p l e or t e n t a t i v e l y m u l t i p l e and i t does \u00E2\u0080\u00A2 not have a neighbour l a b e l e d removable by c o n d i t i o n ( a ) . (c) . I t s l o c a l neighbourhood conforms t o any ONE of the masks shown i n f i g u r e s 2 . 4 ( i \u00E2\u0080\u0094 i i i ) o r t h o s e o b t a i n e d from them by m u l t i p l e s of 90 \u00C2\u00B0 r o t a t i o n s . T e n t a t i v e l y m u l t i p l e p i x e l s a r e l a b e l e d 5 as they a r e found. 0 B 0 B P 0 0 0 0 X 0 0 B P 0 A 0 0 A 0 0 B P 0 X 0 0 ( i ) ( i i ) ( i i i ) F i g . 2.4 L o c a l neighbourhood of t e n t a t i v e l y m u l t i p l e p i x e l s t h a t a r e r e m o v a b l e 1 . W i t h B = 3 or 4, A >0 and i s not l a b e l e d removable by c o n d i t i o n s (a) or ( b ) . X i s don't c a r e . 1 T h i s t e n t a t i v e l y m u l t i p l e p i x e l s c o r r e s p o n d s t o t h e type 2 e x t r a p i x e l s t o be c l a s s i f i e d i n the l a t e r p a r t of t h i s s e c t i o n . 19 The mask ( i i ) i n f i g u r e 2.2 d i f f e r s from the P a v l i d i s ' d e f i n i t i o n s i n t h a t the p i x e l B i s d e f i n e d t o be B>0 i n s t e a d of B=2. T h i s i s n e c e s s a r y t o p r e s e r v e c o n n e c t i v i t y i f s e q u e n t i a l i m p l e m e n t a t i o n i s used, t h a t i s the p i x e l s a re scanned from l e f t t o r i g h t , t o p t o bottom. T h i s i s obvi o u s because i f B i s s i t u a t e d a t the t o p r i g h t hand c o r n e r of the l o c a l neighbourhood of P and has been l a b e l e d m u l t i p l e then P w i l l have t o be m u l t i p l e t o p r e s e r v e c o n n e c t i v i t y . Mask ( i i i ) of f i g u r e 2.2 i s a d d i t i o n a l t o the masks of the o r i g i n a l a l g o r i t h m . The mask i s i n c l u d e d t o improve the c o r n e r c h a r a c t e r i s t i c s of an i d e a l T - j u n c t i o n as s t i p u l a t e d i n the s p e c i f i c a t i o n s . These p o i n t s can b e s t be i l l u s t r a t e d by the s e q u e n t i a l i m p l e m e n t a t i o n of the o r i g i n a l and m o d i f i e d a l g o r i t h m t o the t e s t image of f i g u r e 2.5, the o u t p u t s a t the end of each i t e r a t i o n of the a l g o r i t h m s a r e shown i n f i g u r e s 2.6a and 2.6b. 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 . 1 1 1 ! i i i i 1 1 1 1 . 1 1 1 1 1 1 1 1 1 1 1 . 1 1 1 . 1 1 1 1 1 1 1 1 . 1 1 . 1 1 1 1 1 1 1 1 . 1 1 1 . 1 1 1 1 1 1 1 1 . 1 1 1 . 1 1 1 1 1 1 1 1 . 1 1 1 1 . 1 1 1 1 1 1 1 1 . 1 1 1 . 1 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 1 1 1 1 . 1 1 1 1 1 . 1 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 ' 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 . F i g . 2.5 T e s t image. 20 0 0 c 0 0 0 0 0 0 c 0 r 0 c 0 0 c c o C 0 0 0 0 0 0 0 0 0 0 0 0 0 ? 0 0 0 0 c 0 0 ? c c c 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 c 0 0 0 0 0 0 0 0 0 0 0 0 0 0 c c 0 0 0 0 0 0 0 c c 0 c 0 0 0 r. c 2 2 2 2 2 2 2 7 J 2 2 2 2 2 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 c 0 0 0 0 0 0 0 0 c c c 0 0 o c 0 2 1 1 1 1 i 1 1 1 1 1 1 1 2 0 0 0 0 0 r> 0 0 2 2 5 3 3 3 3 3 3 3 3 3 s 2 2 c 0 0 0 0 0 c 0 2 , , 1 2 2 2 2 2 ^ 2 2 1 1 1 2 0 0 0 0 0 0 c 0 2 1 4 0 0 0 c 0 0 0 0 0 4 1 2 0 0 c 0 r\ 0 G 0 2 2 0 0 0 0 0 0 0 0 0 2 1 i 2 0 0 0 0 0 0 0 0 5 4 0 0 0 0 0 0 0 0 0 0 0 5 4 0 c 0 0 0 0 e c 2 1 \ 2 0 2 2 2 0 0 0 0 0 2 1 1 2 C 0 0 0 0 0 0 0 5 4 0 0 0 0 0 0 0 c 0 0 0 s d 0 0 0 0 0 0 r, 2 1 2 0 2 1 1 2 0 0 0 0 2 1 1 2 0 0 0 0 0 0 0 0 5 4 0 0 0 3 3 0 0 0 0 0 0 s 4 0 0 0 0 0 0 0 0 2 t 2 0 2 2 2 3 0 c 0 0 2 1 1 2 0 0 0 0 0 0 0 0 5 4 0 c 0 0 0 3 0 0 0 0 0 5 4 0 c c 0 0 0 0 0 2 1 1 2 0 0 C 0 0 s 4 5 0 2 1 1 1 S 4 5 0 0 0 c 0 5 4 0 0 0 0 0 0 0 s 0 0 0 2 t 5 0 5 0 0 0 c 0 2 1 2 0 0 0 0 0 s 4 4 0 2 1 1 1 4 4 4 0 0 0 0 0 5 4 0 0 0 0 0 0 0 3 4 c 0 2 1 A 3 4 4 0 0 0 0 2 2 0 0 2 4 3 4 c 0 0 2 1 1 2 o o o o 0 0 0 0 5 4 0 0 0 0 3 3 s 0 0 0 0 5 4 0 0 0 0 0 0 0 0 2 t 1 2 0 2 1 2 0 4 0 0 0 2 1 1 2 0 0 0 0 0 0 0 0 5 4 0 0 0 3 0 0 4 0 0 0 0 5 4 0 c 0 0 0 0 0 0 2 1 2 0 2 1 2 0 0 0 0 0 2 1 t 2 0 0 0 0 0 0 0 0 5 4 0 0 0 3 0 0 0 0 0 0 0 5 4 0 0 0 0 0 0 0 0 2 2 0 2 1 2 0 0 0 0 0 2 1 i 2 0 0 0 0 0 0 0 0 5 4 0 0 0 3 0 0 0 0 0 0 0 5 4 0 0 0 0 0 0 0 0 2 1 2 0 2 1 1 2 2 2 2 0 2 1 1 2 0 0 0 0 0 0 0 0 s 4 0 0 0 5 4 0 0 0 0 0 0 4 c 0 c 0 0 0 0 0 2 1 2 0 2 1 1 i 1 1 2 0 2 t 1 2 0 0 0 0 0 0 0 0 5 4 0 0 0 5 4 3 3 3 0 0 0 5 a 0 0 0 0 0 0 0 c 2 1 t 2 0 2 2 2 2 2 2 2 0 2 1 1 2 0 0 0 0 o 0 0 0 s 4 0 0 0 0 0 0 0 0 0 0 0 5 4 0 0 0 c c 0 0 0 2 t 2 0 0 0 0 0 0 0 0 0 2 1 I 2 0 0 0 0 0 0 0 0 5 4 0 c 0 0 c c 0 0 \u00C2\u00A3 0 0 5 4 0 0 c 0 0 0 0 c 2 1 2 0 0 0 0 0 0 0 0 2 1 1 1 2 0 0 0 0 0 0 c 0 5 4 0 0 0 0 0 0 0 0 0 0 2 1 2 0 c 0 0 0 0 c c 2 1 2 2 2 2 0 2 2 2 1 i 1 i 2 0 0 0 0 0 0 0 0 2 1 s 0 0 0 c 0 0 0 0 5 1 1 2 c 0 0 0 0 0 0 c 2 1 1 1 1 1 2 0 2 1 1 1 1 t 1 2 o o o o 0 0 0 0 2 2 4 3 3 3 0 0 0 3 3 4 2 2 2 0 0 0 0 c 0 0 0 2 2 2 2 2 2 2 2 0 2 2 2 2 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C c 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 c 0 0 0 0 0 0 0 0 o o o o 0 0 0 0 0 0 0 0 0 0 0 c 0 0 0 0 0 0 C c c 0 0 0 (a) 1st i terat1on (b) 2nd 1terat ion 0 c c 0 0 0 o c ^ 0 0 0 0 c 0 C 0 0 0 o o o o 0 0 0 c 0 c 0 0 0 c 0 0 0 0 0 c c 0 c 0 C 0 ? 0 0 0 0 0 c c c c 0 0 0 0 0 0 0 0 0 c o o o o 0 0 0 0 0 0 0 3 3 3 3 3 3 3 3 3 0 \u00C2\u00A3 0 0 0 C 0 0 1 1 1 1 1 1 1 1 1 0 0 0 0 c 5 3 0 0 0 0 0 0 0 0 0 3 3 0 0 o o o 1 1 1 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 c 0 3 0 o o o o 1 1 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 3 0 o o o o 1 1 0 0 0 0 0 3 0 0 0 3 3 0 0 0 0 0 0 0 3 0 o o o o 1 1 1 0 0 0 0 0 3 0 0 0 0 0 3 0 0 0 0 0 0 3 0 o o o o 1 1 1 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 3 0 o o o o 1 1 0 0 0 0 0 3 0 0 0 0 0 0 0 3 3 0 0 0 S 3 3 3 3 0 * 1 1 1 1 1 0 0 0 0 0 3 0 0 0 0 3 3 0 0 0 0 0 0 3 0 o o o o 1 1 1 0 0 0 0 0 3 0 0 0 3 0 0 3 0 0 0 0 0 3 0 o o o o 1 y 0 0 0 0 0 3 0 0 0 3 0 0 0 0 0 0 0 0 3 0 o o o o 1 1 0 0 0 0 0 3 0 0 0 3 0 0 0 0 0 0 0 0 3 0 o o o o 1 1 1 0 0 0 0 0 3 0 0 0 0 3 0 0 0 0 0 0 0 3 0 o o o o 1 1 ( 1 0 0 0 0 0 3 0 0 0 0 5 3 3 3 0 0 0 0 3 0 o o o o 1 1 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 c 1 1 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 3 0 o o o o 1 1 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 3 0 0 o o o o 1 1 0 0 0 0 0 3 0 0 0 c 0 0 0 0 0 0 3 4 0 0 o o o o 1 1 1 0 0 0 0 0 0 3 3 3 3 0 0 0 3 3 3 0 0 0 0 o o o o 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 o o o o 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 o o o o (c) 3rd i t e r a t i o n . (d) Final Image. F i g . 2.6a Test image t h i n n i n g w i t h o r i g i n a l P a v l i d i s a l g o r i t h m . Remark: The image i n each of t h e i t e r a t i o n s i n f i g u r e s 2.6(a) and (b) c o r r e s p o n d s t o the image a f t e r the t e s t s f o r c o n d i t i o n s i n d e f n . 3.1.4. T h i s c o r r e s p o n d s t o the end of s t e p 5 i n a l g o r i t h m A 1 . 6uiuuxq^ patjtpoui a m 6uxsn 6UT.UUTU.} a6eun ^saj, q9*2 *&TJ a 6 e w i t e u i j ( p ) i i i i i i i . i i 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 l 1 l l 0 0 0 0 0 0 0 0 c c c 0 0 0 c c c c 0 0 0 0 0 0 I 0 0 0 0 0 0 s c 0 0 0 0 0 0 0 0 0 0 c 0 0 0 0 0 \" i 0 0 0 0 0 0 c 0 0 0 0 0 0 0 0 0 0 0 c 0 0 0 0 0 I 0 0 0 0 0 e 0 0 0 0 0 0 0 0 0 0 0 0 c 0 0 c 0 0 0 0 0 0 0 c 0 0 0 0 0 0 0 0 0 0 0 0 c 0 0 0 0 0 1 0 0 0 0 0 c 0 0 0 0 e c c 9 0 0 0 0 c 0 0 0 0 0 I 0 0 0 0 0 c 0 0 0 0 0 0 0 r s 0 0 0 c 0 0 0 0 0 1 1 0 0 0 0 0 c 0 0 0 0 0 0 0 0 c 0 0 0 c 0 0 0 0 0 i i 0 0 0 0 0 c 0 0 0 0 0 0 0 0 c 0 0 0 c 0 0 0 0 0 I i 0 0 0 0 0 c 0 0 0 0 0 0 0 0 c 0 0 0 c 0 0 0 0 0 i 0 0 0 0 0 c 0 0 0 0 0 c e c 0 0 0 0 e 0 0 0 0 0 1 0 c c c t c 0 0 0 \u00E2\u0082\u00AC c 0 0 0 0 0 0 0 c 0 0 0 0 0 i 0 0 0 0 0 c 0 0 0 0 0 c 0 0 0 0 0 0 c 0 0 0 0 0 I 0 0 0 0 0 c 0 0 0 0 0 0 c 0 0 0 0 0 c 0 0 0 0 0 I k 0 0 0 0 0 c 0 0 0 0 0 0 0 c c 0 0 0 c 0 0 0 0 0 I 0 0 0 c 0 c 0 0 0 0 0 0 0 0 0 0 0 0 c 0 0 0 0 0 I 0 0 0 0 0 c 0 0 0 0 0 0 0 0 0 0 0 0 E 0 0 0 0 0 I 0 0 0 0 0 0 c s 0 0 0 0 0 0 0 0 0 V s 0 0 0 0 0 > 1 1 0 0 0 0 0 0 0 r c c e c c c c c c 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 z 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 c 0 0 0 0 0 0 0 0 0 0 u o t i B j e i i p u j ( q ) U O I } S l ( e ) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 z c z z z z z 0 e t : z z z : z 0 0 0 0 0 0 0 z \ i I I t I z 0 z I i I V \ z 0 0 0 0 0 0 0 z i I 1 z c c 0 z I z z I I 1 z 0 0 0 0 0 0 0 z i I c 0 0 0 0 0 0 0 0 z I I z 0 0 0 0 0 0 0 z t t z 0 0 0 0 0 0 0 0 0 z I i z 0 0 0 0 0 0 0 z t 1 z 0 z t z z z z z 0 z I 1 z 0 0 0 0 0 0 0 z i I z 0 z t t t \ z 0 z 1 z 0 0 0 0 0 0 0 z i z 0 z z z z t t z 0 z 1 I z 0 0 0 0 0 0 0 z i i z 0 0 0 0 0 z I z 0 z t I z 0 0 0 0 0 0 0 z x 1 z 0 0 0 0 0 z \ z 0 z k I z 0 0 0 0 0 0 0 z i i z 0 0 0 s 0 z z 0 z k t z 0 0 0 0 0 0 0 z i L z 0 0 0 \u00C2\u00BB c e z 0 0 z 1 z 0 0 0 0 \u00C2\u00BB * \u00C2\u00BB t * I z 0 \u00C2\u00BB \u00C2\u00BB 9 0 0 0 0 0 z ^ i z 0 0 0 0 9 \u00C2\u00BB s I i z 0 s \u00C2\u00BB c 0 0 0 0 0 z 1 1 z 0 0 0 0 0 0 0 z V z 0 0 0 0 c z z z 0 z I I z 0 0 0 0 0 0 0 z t 4 z 0 0 0 0 z t z 0 z I t z 0 0 0 0 0 0 0 z t i z 0 0 0 0 0 z z z 0 z i I z 0 0 0 0 0 0 0 z i z 0 0 0 0 0 0 0 0 0 z I I z 0 0 0 0 0 0 0 z i I 1 : z z z \u00C2\u00A3 c c z z t 1 I z 0 0 0 0 0 0 0 z I I 1 i I I I V i I t L 1 z 0 0 0 0 0 0 0 z z z z z z z c z z z z : z z z z 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 22 I t i s c l e a r t h a t the c o n n e c t i v i t y of the c e n t r a l p i e c e of t h e t e s t image i s p r e s e r v e d by the m o d i f i e d a l g o r i t h m but not t h e o r i g i n a l a l g o r i t h m f o r the reason g i v e n above. A l e s s a p p a r e n t d i f f e r e n c e between the two r e s u l t i n g t h i n n e d images a r e the t o p r i g h t hand c o r n e r and the T - j u n c t i o n on the r i g h t edge of the image. F i r s t l y the t o p r i g h t hand c o r n e r e x i b i t s a smoother r o l l - a r o u n d c h a r a c t e r i s t i c w i t h the m o d i f i e d a l g o r i t h m and a l s o the T - j u n c t i o n i s b e t t e r p r e s e r v e d . T h i s i s c o n s i d e r e d d e s i r a b l e f o r the purpose of c h a r a c t e r d e s c r i p t i o n because i f t o p o l o g i c a l p o i n t s such as j u n c t i o n s as w e l l as c e r t a i n n o n - t o p o l o g i c a l p o i n t s such as the c o r n e r s a r e t o be used t o p r o v i d e a g l o b a l d e s c r i p t i o n of the image then t h e s e p o i n t s must be w e l l d e f i n e d and e a s i l y d e t e c t a b l e . T h i s i s a c h i e v e d t h r o u g h the a d d i t i o n of mask ( i i i ) i n f i g u r e 2.2. Note t h a t a l t h o u g h the mask improves the i n t e r p r e t a b i l i t y of c o r n e r s and j u n c t i o n s , r e s u l t i n g i d e a l r i g h t a n g l e c o r n e r s a r e o n l y w e l l behaved but not a b s o l u t e l y c o n s i s t e n t . T h i s can be seen by t h e number of p i x e l s r e q u i r e d t o t u r n the d i f f e r e n t r i g h t a n g l e c o r n e r s i n the f i n a l image. S o l u t i o n t o t h i s w i l l r e q u i r e s e l e c t i v e t h i n n i n g from d i f f e r e n t d i r e c t i o n s w hich i s s l o w . B e s i d e s , t h i s dependence on s c a n n i n g o r d e r i s due t o the d e f i n i t i o n 3.1.4(a) and (b) d e s i g n e d t o reduce branches of t h i c k n e s s 2 t o s i n g l e p i x e l t h i c k , by removing one of t h e two t e n t a t i v e l y m u l t i p l e p i x e l s . T h i s i s i l l u s t r a t e d by the two v e r t i c a l s i d e s of t h e t e s t image i n f i g u r e 2.6b. D i f f e r i n g s e l e c t i o n s of which p i x e l t o remove g i v e r i s e t o i d e a l r i g h t a n g l e c o r n e r s d i f f e r i n g by a t most one p i x e l . I f t h i s c o r n e r c h a r a c t e r i s t i c i s n o n - e s s e n t i a l the mask need not be used. The second d i f f e r e n c e between the two a l g o r i t h m s l i e s i n the t y p e s of e x t r a p i x e l s t h a t are not r e q u i r e d f o r c o n n e c t i v i t y but a r e p r e s e r v e d by the a l g o r i t h m s . We can c l a s s i f y t h e s e p i x e l s i n t o two t y p e s : Type 1. E x t r a p i x e l s o c c u r i n g i n p l a c e s where a p h y s i c a l j u n c t i o n j u n c t i o n e x i s t s , e.g. 0 1 0 1 1 1 0 0 0 Type 2. E x t r a p i x e l s o c c u r i n g i n p l a c e s o t h e r than where a p h y s i c a l j u n c t i o n e x i s t s , e.g. 0 0 1 0 OR 0 0 1 0 0 0 0 1 0 0 0 1 1 0 0 1 1 0 0 0 1 0 0 1 0 0 0 0 1 0 0 0 These e x t r a p i x e l s c o u l d be removed by p o s t - t r i m m i n g r o u t i n e s . However, depending on r e q u i r e m e n t s not a l l t h e s e e x t r a p i x e l s a r e u n d e s i r a b l e . In t h i s case e x t r a p i x e l s of t y p e one i s the d i r e c t consequence of the mask i n f i g u r e 2 . 2 ( i i i ) . T h e r e f o r e o n l y e x t r a p i x e l s of t ype 2 need t o be removed. Comparing p i x e l P ( r e p r e s e n t i n g t y p e 2 e x t r a p i x e l ) i n t h e masks i n f i g u r e 2.4 and those of f i g u r e 2.2 24 f o r m u l t i p l e p i x e l s , i t i s o b v i o u s t h a t type 2 e x t r a p i x e l s can never q u a l i f y as m u l t i p l e p i x e l s . T h e r e f o r e t hey a r e p r e s e r v e d o n l y as p o s s i b l e t e n t a t i v e l y m u l t i p l e p i x e l s . As such they can be removed on the f l y by e x amining o n l y t h o s e t e n t a t i v e l y m u l t i p l e p i x e l s t h a t a r e not c o n s i d e r e d removable by c o n d i t i o n s (a) and (b) i n d e f i n i t i o n 3.1.4. T h i s i s done t h r o u g h the i n t r o d u c t i o n of c o n d i t i o n (c) i n the same d e f i n i t i o n . T h i s method p r e s e n t s a c o n s i d e r a b l e amount of time s a v i n g s compared t o u s i n g a p o s t - t r i m m i n g p r o c e d u r e . S i n c e the c o n d i t i o n s i n d e f i n i t i o n 3.1.4 has t o be checked i n the o r d e r ( a ) , (b) and ( c ) , (see A l o g r i t h m A1) c o n d i t i o n 3.1.4(c) i s checked o n l y i f a t e n t a t i v e l y m u l t i p l e p i x e l does not s a t i s f y c o n d i t i o n s 3.1.4(a) or ( b ) . 3.2 I m p l e m e n t a t i o n of t h i n n i n g a l g o r i t h m and t e s t r e s u l t s . The t h i n n i n g a l g o r i t h m was implemented i n P a s c a l on the PDP11/23 minicomputer system. The p r o c e d u r e i n v o l v e s s c a n n i n g the image s e q u e n t i a l l y s t a r t i n g from the t o p l e f t c o r n e r of t h e image and l a b e l s the p i x e l s a c c o r d i n g t o the a l g o r i t h m g i v e n below. 25 A l g o r i t h m A l . 1. For each 1 p i x e l do t e s t f o r c o n t o u r p i x e l as i n d e f n . 3.1.1; l a b e l c o n t o u r p i x e l s 2; 2. For each 2 p i x e l do i f p i x e l s s a t i s f i e s c o n d i t i o n 3.1.2(a) then r e l a b e l p i x e l as 3 e l s e i f p i x e l s a t i s f i e s c o n d i t i o n 3.1.2(b) then r e l a b e l p i x e l as 3; 3. For each 2 p i x e l do i f p i x e l s a t i s f i e s c o n d i t i o n 3.1.3(a) then r e l a b e l p i x e l as 4 e l s e i f p i x e l s a t i s f i e s c o n d i t i o n 3.1.3(b) then r e l a b e l p i x e l as 4; 4. For each 4 p i x e l do i f p i x e l s a t i s f i e s c o n d i t i o n 3.1.4(a) then r e l a b e l p i x e l as 5; 5. F o r each r e m a i n i n g 4 p i x e l do i f p i x e l s a t i s f i e s c o n d i t i o n 3.1.4(b) then r e l a b e l p i x e l as 5 e l s e i f p i x e l s a t i s f i e s c o n d i t i o n 3.1.4(c) then r e l a b e l p i x e l as 5; 6. s e t a l l 2 and 5 p i x e l s t o 0; s e t a l l 3 and 4 p i x e l s t o 7; 7. Repeat s t e p s 1 t o 6 u n t i l a l l c o n t o u r p i x e l s a r e m u l t i p l e or t e n t a t i v e l y m u l t i p l e . 2 There a r e a v a r i e t y of ways the same a l g o r i t h m can be implemented i n r e a l t i m e a p p l i c a t i o n s . P a v l i d i s has suggested a p i e c e m e a l approach where f i v e 8 - b i t r e g i s t e r masks a r e used t o r e p r e s e n t t h e e i g h t n e i g h b o u r s of P and the whole frame i s 2 T h i s c o n d i t i o n i s d i f f e r e n t from ' a l l p i x e l s a r e m u l t i p l e or t e n t a t i v e l y m u l t i p l e ' . The l a t t e r case w i l l not r e s u l t i n program t e r m i n a t i o n i f a p a t t e r n of the t y p e shown below e x i s t s . 0 3 0 3 1 3 0 3 0 26 s u b d i v i d e d and p r o c e s s i n s m a l l s e c t i o n s by a number of p r o c e s s o r s . T h i s approach i s not s u i t a b l e i n r e a l t i m e c h a r a c t e r r e c o g n i t i o n a p p l i c a t i o n s as p r o c e s s s y n c h r o n i z a t i o n r e q u i r e m e n t s w i l l slow down the a l g o r i t h m . For c h a r a c t e r r e c o g n i t i o n p i e c e m e a l t h i n n i n g i s not n e c e s s a r y because the c h a r a c t e r can be e f f e c t i v e l y r e p r e s e n t e d and t h i n n e d i n a 24x24 frame s i z e as shown by t h e Munson's c h a r a c t e r images, f o u r of which i s g i v e n i n f i g u r e 2.7. The t h i n n e d images of t h e s e c h a r a c t e r s w i l l s t i l l c o n t a i n w e l l d e f i n e d f e a t u r e s which w i l l e n a b l e c l a s s i f i c a t i o n t o be made. I n s t e a d , the a l g o r i t h m can be implemented s e q u e n t i a l l y i n hardware u s i n g an 8 - b i t r e g i s t e r f o r each mask ( e x c l u d i n g 90\u00C2\u00B0 r o t a t i o n s ) and a s i n g l e 8 - b i t s c r a t c h pad r e g i s t e r t o r e p r e s e n t the the n e i g h b o u r s of t h e p i x e l b e i n g t e s t e d . Each t e s t i s p e r f ormed by comparing the s c r a t c h pad r e g i s t e r w i t h an a p p r o p i a t e r e g i s t e r mask and each 90\u00C2\u00B0 mask r o t a t i o n i s e q u i v a l e n t t o a 2 - b i t c y c l i c s h i f t of the c o n t e n t s of the s c r a t c h pad r e g i s t e r . In t h i s a pproach o n l y s i m p l e c o n t r o l c i r u i t s a r e r e q u i r e d . As each o p e r a t i o n can be performed whenever 3 or more l i n e s of the image becomes a v a i l a b l e , v e r y h i g h speed o p e r a t i o n can be a c h i e v e d i f s e v e r a l of t h e s e u n i t s each w i t h i t s own s c r a t c h pad r e g i s t e r i s p i p e l i n e d and f a b r i c a t e d u s i n g V L S I . 1500 b i n a r y c h a r a c t e r images from Munson's c h a r a c t e r d a t a were t h i n n e d w i t h t h e a l g o r i t h m . The r e s u l t i n g t h i n n e d images m a i n t a i n i n g most i f not t h e a l l t h e shape a t t r i b u t e s of t h e 27 i n p u t c h a r a c t e r . Four of t h e s e images are shown i n f i g u r e 2.7 w i t h t h e i r t h i n n e d v e r s i o n s by u s i n g b oth P a v l i d i s and m o d i f i e d a l g o r i t h m g i v e n i n f i g u r e s 2.8a and 2.8b. For the images t h i n n e d w i t h P a v l i d i s a l g o r i t h m , shown i n f i g u r e 2.8a, c o n n e c t i v i t y i s not p r e s e r v e d i n images 'A', 'R' and 'X', and image 'B' has a redundant p i x e l a t the r i g h t hand c o r n e r of the bottom c u r v e of 'B'. On the o t h e r hand, a l l images t h i n n e d w i t h t h e m o d i f i e d a l g o r i t h m have p r e s e r v e d c o n n e c t i v i t y w i t h o u t any t ype 2 e x t r a p i x e l s . T h i s i s an i m p o r t a n t f e a t u r e 1 f o r images where f e a t u r e e x t r a c t i o n i n v o l v e s b r a n c h t r a c k i n g and e x t r a p i x e l s w i l l s i g n a l the p r e s e n c e of an i n t e r s e c t i o n of two or more bra n c h e s . E x t r a p i x e l s a t the j u n c t i o n can be f u r t h e r s o r t e d i n t o t h o s e b e l o n g i n g t o the d i f f e r e n t branches meeting t o form the j u n c t i o n . These a r e the t o p o l o g i c a l a t t r i b u t e s of the c h a r a c t e r t h a t can be brought out v e r y e f f e c t i v e l y by the t h i n n i n g a l g o r i t h m , t h u s c o n t r i b u t e s v i t a l i n f o r m a t i o n t h a t can be used f o r p r e c l a s s i f i c a t i o n (or c l a s s i f i c a t i o n ) . 4. D i s c u s s i o n . The t h i n n i n g a l g o r i t h m p r e s e n t e d has been d e s i g n e d t o be used as a f i n a l p r e p r o c e s s o r f o r a r e a l t i m e c h a r a c t e r r e c o g n i z e r . The d e s i g n i n v o l v e s t e s t s of l o c a l 3x3 c l u s t e r s of p i x e l s w h i c h a r e r e l a t i v e l y f a s t and s i m p l e t o make. E x p e r i m e n t s have been made u s i n g Munson's c o l l e c t i o n of h a n d w r i t t e n c h a r a c t e r s , and t h e s e show t h a t t h e shape c h a r a c t e r i s t i c s as judged by the eye a r e w e l l p r e s e r v e d . 28 T y p i c a l t h i n n e d c h a r a c t e r s a r e g i v e n i n f i g u r e 2.8b. These may be compared t o the same s e t of c h a r a c t e r s t h i n n e d w i t h P a v l i d i s ' a l g o r i t h m i n f i g u r e 2.8a. The new a l g o r i t h m c l e a n s up the e x t r a p i x e l s t h a t a r e not r e q u i r e d f o r c o n n e c t i v i t y but a r e p r e s e n t i n images t h i n n e d w i t h P a v l i d i s ' a l g o r i t h m as can be seen i n the bottom c u r v e of image 'B' i n f i g u r e 2.8a, and i n the rounded bottom r i g h t hand c o r n e r of the t e s t image i n f i g u r e 2.6a. Breaks i n c o n n e c t i v i t y a r e a l s o e l i m i n a t e d , l e a v i n g c o n t i n u o u s p a r t s of the c h a r a c t e r as a sequence of c onnected one p i x e l o u t l i n e s . A g a i n g e o m e t r i c p r o p e r t i e s , e s p e c i a l l y a t c o r n e r s a r e w e l l p r e s e r v e d by the a l g o r i t h m . T h i s t h i n n i n g a l g o r i t h m i s t h e r e f o r e an e x c e l l e n t f i n a l p r e p r o c e s s o r f o r b i n a r y c h a r a c t e r images. From the t h i n n i n g of Munson's d a t a , i t i s o b s e r v e d the number of image p i x e l s a r e reduced by 60 t o 70 p e r c e n t i n the m a j o r i t y of the c a s e s . L e a v i n g a s k e l e t a l image t h a t c o n t a i n a l l t h e e s s e n t i a l c h a r a c t e r i s t i c s of the c h a r a c t e r , as seen i n the examples i n f i g u r e 2.8b. The s p e c i f i c c h a r a c t e r i s t i c s such as the c o n t i n u o u s c u r v e s of s i n g l e p i x e l t h i c k n e s s and the w e l l behaved i n t e r s e c t i o n s a r e i m p o r t a n t f e a t u r e s i n the t h i n n e d images which w i l l be e x p l o i t e d i n the subsequent r e c o g n i t i o n p r o c e s s . These f e a t u r e s w i l l be d i s c u s s e d i n g r e a t e r d e t a i l i n the next c h a p t e r . \u00E2\u0080\u00A2e^ep s.uosunw UIOJJ saa^oejeqD Aaeutq axduies L'Z 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 I I 0 0 0 o 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 t I 0 0 0 0 0 0 0 0 0 0 I 0 0 0 0 0 0 0 0 0 0 0 0 1 I I 0 0 0 0 0 0 0 1 I I 0 0 0 0 0 0 0 0 0 0 0 I 1 0 0 0 0 0 0 0 I t 1 I 0 0 0 0 0 0 0 0 0 0 0 0 I 1 0 0 0 0 0 1 I I I 0 0 0 0 0 0 0 o 0 0 0 0 0 t I 1 0 0 0 I 1 I I I 0 0 0 0 0 0 0 0 0 0 0 0 0 0 I 1 I 0 I > 1 I I 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 I 1 I 1 I 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 I I 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 I 1 I 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 L 1 1 I I I 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 I > 1 1 I 1 I 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 I I I I i I 1 I 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 I I I 0 1 I I 1 0 0 0 0 0 0 0 0 0 0 0 0 0 t 1 I I I 0 0 0 1 I 1 I 1 0 0 0 0 0 0 0 0 0 0 t i I 1 I L 0 0 0 I 1 I t 0 0 0 0 0 0 0 0 0 0 0 0 1 I 0 0 0 0 0 0 0 I I I I 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 I I 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 . a. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 I 0 0 0 0 0 0 I 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 t I O O O O I I 0 O O 0 0 0 0 0 0 0 0 0 0 0 0 1 1 I O O 0 O I 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 I 0 0 0 I I 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 I 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 I 0 0 0 1 I O O O O 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 I 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 I I I I 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 I I I I 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 I I I I I 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 I I 1 I I I 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 I I 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 I 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 I 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 I 1 0 1 0 0 0 O O O 0 0 0 0 0 0 0 0 0 0 1 1 I I 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 I I I 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 I 1 1 1 I I 1 0 0 0 1 I 1 1 1 I 1 I I 0 0 1 1 I 1 1 1 1 1 1 1 0 0 1 1 1 I 0 0 0 0 0 0 0 0 1 I 1 0 0 0 0 0 0 0 0 0 I 1 I 0 0 0 0 0 0 0 0 0 I I I 1 0 0 0 0 0 0 0 0 1 1 I 0 0 0 0 0 0 0 0 0 0 1 I 0 0 0 0 0 0 0 0 0 0 1 I 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 I 1 1 t 1 0 0 0 0 0 0 1 I 1 1 I 0 0 0 0 0 0 I 1 1 I 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 1 I 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 I 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 o 0 0 0 0 0 0 1 I 1 0 0 0 0 0 0 0 0 0 0 0 0 .a. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 l l l l l l l l l O O O 1 1 1 1 1 1 1 1 1 1 0 0 l l l l l l l l l O O O l l l O l l l l t O O O I I 1 0 0 0 0 0 0 0 0 0 I I 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 I I 1 0 0 0 0 0 0 0 0 0 I 1 1 0 0 0 0 0 0 0 0 0 1 I 1 0 1 0 1 0 0 0 0 0 I I I I I 1 0 0 0 0 0 0 I t l l l l O O O O O O 1 1 1 1 1 1 0 0 0 0 0 0 0 1 I 0 0 0 0 0 0 0 0 0 0 1 i O O O O O O O O O 0 1 I 1 0 0 0 0 0 0 0 0 0 1 I 1 0 0 0 0 0 0 0 0 0 1 I 1 0 0 0 0 0 0 0 0 0 1 I 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0.0 1 1 I 1 0 1 I I 1 1 1 1 1 1 1 I o l l l l l l l O O O O O 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 I I 0 0 0 0 0 0 0 0 0 0 I 1 0 0 0 0 0 0 0 0 0 0 1 I 0 0 0 0 0 0 0 0 0 0 I 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 I 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 I 1 1 1 0 0 0 0 0 0 0 I 1 I I 1 0 0 0 0 0 0 0 I 1 I 1 1 0 0 0 0 0 0 0 0 1 0 I 0 0 0 0 0 0 0 0 0 I 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 1 1 1 1 t 0 0 0 0 0 0 0 0 1 I 1 I 0 0 0 0 0 0 0 0 1 I 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 I 1 1 0 0 0 0 1 I 0 0 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 I 1 I 0 0 0 0 0 0 0 0 0 I 1 0 0 0 0 0 0 0 0 0 0 t 1 1 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 I 1 I 1 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 I 1 0 0 0 0 0 0 0 0 0 1 I 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 1 o 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 o 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 o 0 0 0 0 62 . 1 . 1 . 1 . 1 . . . . 1 . . . 1 1 1 1 1 . 1 . I . 1 . 1 1 . 1 . 1 . 30 i . . 1 1 1 1 1 . 1 1 1 1 . . . 1 1 i . . . . i . i 1 . . . 1 1 1 . 1 1 1 1 1 . . . . 1 1 . . . i 1 . . . 1 . . . . i i i . i i 1 i 1 i 1 11 1 1 1 1 1 1 . 1 1 1 1 1 1 1 1 . . . 1 1 . 1 1 1 1 . . 1 . 1 i . . . 1 1 . . . i i . . i i . i i . . 1 i . . . i . . . i i . . . . 1 1 1 1 1 i 1 . . . i 1 . . 1 . . . 1 . . . i . i . i F i g . 2.8a Sample b i n a r y c h a r a c t e r s t h i n n e d w i t h o r i g i n a l P a v l i d i s ' a l g o r i t h m . 1 . . . . . . 1 . 1 . . . . 1 . . . 1 1 . 1 . . . 1 . 1 . . . . 1 . . 1 . . . . 1 . . 1 . . . . 1 . . 1 . . . . 1 . 1 1 1 1 1 1 . . 1 . . 1 . . . . . . 1 . . . . . . . 1 . . . . . . . 1 . . . . . . . 1 . . . . . . 1 . . . . . . . 1 . . . . . . . 1 . . . . 1 1 1 1 1 1 . . 1 . . . . 1 1 . 1 1 1 1 . 1 . . . . 1 1 1 1 1 . . . 1 . . . 1 1 . . . 1 1 1 . 1 1 1 1 1 . . . . 1 1 . . . 1 1 . . . 1 . . . . 1 1 1 . 1 1 1 1 1 1 1 1 1 1 1 . . . 1 . . 1 . 1 1 . . 1 . . F i g . 2.8b Sample b i n a r y c h a r a c t e r s t h i n n e d w i t h m o d i f i e d t h i n n i n g a l g o r i t h m . CHAPTER I I I IMAGE EXTRACTION, REPRESENTATION AND PRECLASSIFICATION. 1. I n t r o d u c t i o n . One of the fundamental problems f a c i n g the s u c c e s s f u l d e s i g n of r e a l t i m e c h a r a c t e r r e c o g n i t i o n machines or image r e c o g n i t i o n machines i n g e n e r a l , has been the e f f e c t i v e r e p r e s e n t a t i o n of the i n p u t images i n a format s u i t a b l e f o r e f f i c i e n t p r o c e s s i n g on a d i g i t a l computer. In many p a t t e r n r e c o g n i t i o n problems, t h i s p r o c e s s i s synonymous w i t h the f e a t u r e s e l e c t i o n and d e f i n i t i o n problem, where a t t e m p t s a r e made t o f i n d a f e a t u r e or c o m b i n a t i o n of f e a t u r e s t h a t can be u n i q u e l y i d e n t i f i e d as a d i s t i n g u i s h i n g f e a t u r e b e l o n g i n g t o a g i v e n c l a s s of image. In both the s y n t a c t i c and s t a t i s t i c a l approach t o r e c o g n i t i o n a v a r i e t y of t e c h n i q u e s f o r f e a t u r e s e l e c t i o n have been d e v i s e d and a survey of t h e s e t e c h n i q u e s have been made by Hanakata [ 4 7 ] , and P a v l i d i s [ 4 8 ] . Some of thos e t e c h n i q u e s t h a t have been a p p l i e d t o c h a r a c t e r r e c o g n i t i o n a r e ; image c o n t o u r d e s c r i p t i o n s and a n a l y s i s [ 6 ] , [ 1 0 ] , s t r o k e v e c t o r sequences [ 1 2 ] , p o l y g o n a l a p p r o x i m a t i o n t o shapes [ 2 3 ] , [ 4 9 ] , and s p e c i a l l y d e f i n e d shapes such as a r c s , s p u r s , e t c . [ 3 ] , [ 1 1 ] . The l a r g e number of d i f f e r e n t t y p e s of f e a t u r e s used t o date i n d i c a t e s t h a t t h e r e has not been a s i n g l e f e a t u r e or s e t of f e a t u r e s t h a t can be c o n s i d e r e d e s s e n t i a l f o r c h a r a c t e r shape d e s c r i p t i o n . I n s t e a d the f e a t u r e s e l e c t i o n p r o c e s s i s based 33 o n l y on the d e s i g n e r ' s i n t i m a t e knowledge of the t r a i n i n g s e t of d a t a , w i t h the s e l e c t e d f e a t u r e s s u b j e c t e d t o a g e n e r a l s e t of c r i t e r i a such a s : f e a t u r e i n v a r i a n c e t o r i g i d body motion , i e . t r a n s l a t i o n , r o t a t i o n and d i l a t i o n , maximum n o i s e r e j e c t i o n . maximum d i s c r i m i n a t o r y i n f o r m a t i o n c o n t e n t , low c o s t of e x t r a c t i o n . T h i s approach t o f e a t u r e s e l e c t i o n and image d e s c r i p t i o n has two main d i s a d v a n t a g e s . F i r s t l y , the t e c h n i q u e l a c k s f l e x i b i l i t y , because i n p r a c t i c e shape d i s t o r t i o n i s more o f t e n e l a s t i c i n n a t u r e and the use of g e o m e t r i c p r o p e r t i e s f o r shape d e s c r i p t i o n w i l l r e s u l t i n a r e c o g n i t i o n a l g o r i t h m t h a t w i l l p e r f o r m p o o r l y when a p p l i e d t o u n c o n s t r a i n e d h a n d p r i n t e d c h a r a c t e r s . S e c o n d l y , i n r e a l t i m e o p e r a t i o n s , once s e l e c t e d the f e a t u r e s may be the o n l y i n f o r m a t i o n e x t r a c t e d from the i n p u t image t h a t i s a v a i l a b l e f o r r e c o g n i t i o n , u n l e s s one i s ready t o s t o r e s e v e r a l frames of images i n o r d e r t o re s c a n them i f no c l a s s i f i c a t i o n can be made on the f i r s t t r y . N a t u r a l l y t h i s w i l l a l s o i n c r e a s e the amount of s t o r a g e r e q u i r e d and reduce the r e c o g n i t i o n r a t e as f e a t u r e e x t r a c t i o n i s o f t e n a time consuming p r o c e d u r e . The d e s c r i p t i o n and e x t r a c t i o n t e c h n i q u e p r e s e n t e d i n t h i s c h a p t e r w i l l overcome the above problems by u s i n g a two st a g e c h a r a c t e r d e s c r i p t i o n and e x t r a c t i o n p r o c e s s . The f i r s t s t a g e i n v o l v e s the i d e n t i f i c a t i o n of t o p o l o g i c a l p o i n t s such 34 as j u n c t i o n s (of r a d i a l i t y 2 & 3 ) , i s o l a t e d p o i n t s , e n d p o i n t s and c l o s u r e s . These p o i n t s a r e c a l l e d t o p o l o g i c a l p o i n t s of the image by v i r t u e of t h e i r i n v a r i a n c e t o e l a s t i c d e f o r m a t i o n s . J u n c t i o n s of r a d i a l i t y 2 and 3, e n d p o i n t s and s i n g l e p o i n t s a r e a l s o the c r i t i c a l p o i n t s of a t h i n n e d image because they can be i d e n t i f i e d as p o s s i b l e nodes of the image from the g r a p h i c a l p o i n t of view. These t o p o l o g i c a l f e a t u r e s d e s c r i b e t h e g l o b a l p r o p e r t i e s of the image and w i l l be r e f e r e d t o as g l o b a l f e a t u r e s . The second s t a g e i n v o l v e s the t r a c k i n g and e x t r a c t i o n of the t h i n n e d image by t r e a t i n g the t h i n n e d image as a graph, w i t h nodes r e p r e s e n t e d by the c r i t i c a l p o i n t s and l i n k s by the c h a i n codes of the branches between nodes. These g l o b a l f e a t u r e s (nodes) t o g e t h e r w i t h the c h a i n coded l i n k s c o n t a i n s the complete d e s c r i p t i o n of the image. The g l o b a l f e a t u r e s a r e used f o r image p r e c l a s s i f i c a t i o n , an i m p o r t a n t s t e p i n h i g h speed r e c o g n i t i o n e s p e c i a l l y i f the number of p o s s i b l e d i s t o r t i o n s i n the image can be enormous. G l o b a l f e a t u r e s s e p a r a t e images i n t o d i f f e r e n t groups based on t h e i r t o p o l o g y and a r e t h e r e f o r e i n v a r i a n t t o e l a s t i c d e f o r m a t i o n s . Thus l e a v i n g the f i n a l r e c o g n i t i o n a l g o r i t h m the t a s k of r e s o l v i n g d i f f e r e n c e s i n t h e shapes of o n l y a s m a l l s u b s e t of t h e t o t a l p o s s i b l e image v a r i a t i o n s . The r e m a i n i n g p a r t of t h i s c h a p t e r i s d i v i d e d i n t o t h r e e s e c t i o n s . S e c t i o n 2 p r o v i d e s the d e t a i l s f o r the g l o b a l f e a t u r e d e f i n i t i o n , d e t e c t i o n and e x t r a c t i o n p r o c e s s . S e c t i o n 3, the t r a c k i n g a l g o r i t h m and d a t a s t r u c t u r e s and f i n a l l y s e c t i o n 4, the d i s c u s s i o n on the r e s u l t s of a p p l y i n g the t e c h n i q u e t o the t h i n n e d Munson's c h a r a c t e r images. 2. Image D e f i n i t i o n . 2.1 B a s i c c o n c e p t s - d i s c r e t e c u r v e geometry and g r a p h . The f o l l o w i n g d e f i n i t i o n s p r o v i d e the b a s i c c o n c e p t s fundamental t o the d e t e c t i o n of g l o b a l f e a t u r e s and the r e p r e s e n t a t i o n of graphs i n the d i s c r e t e p l a n e . Defn. 2.1.1 An e n d p o i n t ( f r e e end) i s a p i x e l t h a t has o n l y ONE n e i g h b o u r . Defn. 2.1.2 A j u n c t i o n i s a s i n g l e p o i n t i n the d i g i t a l f i e l d where two or more c u r v e s touch or i n t e r s e c t . The j u n c t i o n p i x e l p r o v i d e s c o n n e c t i v i t y f o r a l l c u r v e s i n t e r s e c t i n g a t the j u n c t i o n . P r o p o s i t i o n 2.1a. The r a d i a l i t y of a j u n c t i o n i s the number of c u r v e s r a d i a t i n g from a j u n c t i o n . The most common type of j u n c t i o n b e i n g the t r i - r a d i a l ( J3) and q u a d - r a d i a l (J4) j u n c t i o n s . As d e f i n e d i n 2.1.2, the d e f i n i t i o n i s o n l y a p p l i c a b l e t o J3s and J 4 s i n the d i s c r e t e p l a n e . T h i s l i m i t a t i o n i s the c h a r a c t e r i s t i c of the d i s c r e t e p l a n e because u n l i k e the c o n t i n u o u s p l a n e j u n c t i o n s w i t h r a d i a l i t y g r e a t e r than f o u r cannot be r e p r e s e n t e d by a s i n g l e p o i n t but by a c o l l e c t i o n of p o i n t s . F i g u r e s 3.1a and 3.1b i l l u s t r a t e s t h i s p o i n t . Both p a t t e r n s i n f i g u r e 3.1 has a c o l l e c t i o n of non-zero p o i n t s which cannot be t h i n n e d any f u r t h e r i f image c o n n e c t i v i t y i s t o be m a i n t a i n e d . A c l o s e r i n s p e c t i o n w i l l show t h a t p a t t e r n s 3.1a and 3.1b a r e formed as a r e s u l t of f i v e and e i g h t i n t e r s e c t i n g c u r v e s r e s p e c t i v e l y . To d e s c r i b e each one of t h e s e s i t u a t i o n s u n i q u e l y i n the d i s c r e t e p l a n e i s n o n t r i v i a l , t h e r e f o r e we w i l l not a t t e m p t t o c l a s s i f y them. T h i s w i l l not p r e s e n t any c o n s i d e r a b l e l i m i t a t i o n on the image d e s c r i p t i o n t e c h n i q u e because j u n c t i o n s w i t h r a d i a l i t y g r e a t e r than f o u r a r e r a r e i n n a t u r e and i n f a c t none was e n c o u n t e r e d i n t h e 1500 random samples from Munson's c h a r a c t e r d a t a . 1 I 0 1 0 0 0 1 0 0 0 1 0 1 0 0 \u00E2\u0080\u00A2 1 1 1 1 0 0 0 0 0 1 1 1 0 0 0 1 0 0 0 1 0 0 1 0 0 0 1 0 1 0 0 0 0 0 1 / ,., N F i g . 3.1 Examples of j u n c t i o n s w i t h r a d i a l i t y g r e a t e r than f o u r . 0 0 1 0 1 0 1 1 0 0 1 1 1 1 1 (b) 1 1 1 1 1 1 0 1 0 S 37 Defn. 2.1.3 A c h a i n coded d i g r a p h G, c o n s i s t s of a s e t of nodes Q={ N } i=1..k t o g e t h e r w i t h a s e t U whose members a r e i o r d e r e d p a i r s of nodes each w i t h a c h a i n coded branch f o r m i n g the d i r e c t e d l i n k between the node p a i r . That i s U . . = {(N . ,N j ), D } , 1 S i , j > k. where D={d , ...d } f o r a branch m p i x e l s l o n g and i m d \u00E2\u0082\u00AC. {1,2,3,4,5,6,7,8}, the Freeman's d i r e c t i o n s shown below. 4 3 2 6 7 8 Defn.2.1 .4 A branch or l i n k i s a c o n n e c t e d p a t h or sequence of p i x e l s , s i n g l e p i x e l t h i c k between two nodes whose members a r e r e p r e s e n t e d by Freeman's c h a i n codes. The l e n g t h of the branch m, i s e q u a l t o the number of c h a i n code elements r e q u i r e d t o r e p r e s e n t the branch e.g. node 2 w i t h m = 9, and D = 122211882 Node 1 i s c a l l e d the node of o r i g i n and node 2 the d e s t i n a t i o n node. 38 Defn. 2.1.5 A s i m p l e c l o s u r e ( r e f e r r e d t o here as j u s t c l o s u r e ) e x i s t s i f a c l o s e d p a t h can be t r a c e d by e x i t i n g a node from a branch and r e t u r n i n g t o the same node v i a a d i f f e r e n t branch w i t h o u t e n c l o s i n g a n other such c l o s e d p a t h . T h i s d e f i n i t i o n can b e s t be i l l u s t r a t e d by the examples shown below. P r o p o s i t i o n 2.1b. A l o o p or s l i n g i s a s p e c i a l c a s e of a c l o s u r e w i t h o n l y one b r a n c h . Loops a r e c h a r a c t e r i z e d by the f a c t t h a t they a r e formed by a br a n c h h a v i n g t h e same node of o r i g i n and d e s t i n a t i o n . L i k e t h e E u l e r number [ 5 0 ] , a w e l l known t o p o l o g i c a l p r o p e r t y r e l a t i n g t h e number of o b j e c t b o d i e s and h o l e s i n a 2-D image, c l o s u r e i s a t o p o l o g i c a l p r o p e r t y of a l i n e image. The p r e s e n c e o f c l o s u r e s i n a t h i n n e d image i n d i c a t e s the p r e s e n c e of c y c l e s i n i t s d i g r a p h r e p r e s e n t a t i o n . I t w i l l be shown l a t e r t h a t c l o s u r e s can be r e a d i l y o b t a i n e d from t h e i n p u t image d u r i n g the image e x t r a c t i o n p r o c e s s , t h u s a v o i d i n g t h e use of l e n g h t y a l g o r i t h m s t o d e t e c t t h e p r e s e n c e of c y c l e s i n d i g r a p h s . No. of c l o s u r e s = 2 2 39 So f a r the co n c e p t s from t o p o l o g y have been used l i b e r a l l y i n the d e f i n i t i o n s and d i s c u s s i o n s w i t h o u t q u a l i f i c a t i o n . As have been p o i n t e d out e a r l i e r the d i s c r e t e p l a n e does not have the same p r o p e r t i e s of the c o n t i n u o u s p l a n e . N e v e r t h e l e s s the a m b i g u i t i e s t h a t may a r i s e from the d i s c r e t e r e p r e s e n t a t i o n can be r e s o l v e d by b e a r i n g i n mind t h a t the images a r e o r i g i n a l l y c o n t i n u o u s and the p r o p e r t i e s r e f e r e d t o can be viewed as t h a t of the e q u i v a l e n t image i n the c o n t i n u o u s p l a n e . One of the most im p o r t a n t p r o p e r t y t h a t w i l l be used i n the d e s i g n of c h a r a c t e r r e c o g n i t i o n a l g o r i t h m s i s the concept of homeomorphism or t o p o l o g i c a l e q u i v a l e n c e . Two graphs or l i n e images A and B a r e s a i d t o be t o p o l o g i c a l l y e q u i v a l e n t i f t h e r e i s a one t o one mapping of p o i n t s from one image t o ano t h e r and v i c e v e r s a , w i t h such mapping b e i n g c o n t i n u o u s . That i s two p o i n t s c l o s e t o g e t h e r or a d j a c e n t i n one image are mapped i n t o two p o i n t s c l o s e t o g e t h e r or a d j a c e n t i n the o t h e r image. P i c t u r e s q u e l y , two images a r e t o p o l o g i c a l l y e q u i v a l e n t i f one image can be o b t a i n e d by e l a s t i c a l l y deforming the o t h e r w i t h o u t any c u t s b e i n g made. Examples of the s e c o n c e p t s i n t o p o l o g y and the t o p o l o g y of d i s c r e t e images can be found i n r e f e r e n c e s [ 4 4 ] , [ 5 4 ] , [ 5 6 ] . 2.2 G l o b a l f e a t u r e d e t e c t i o n and e x t r a c t i o n . F o l l o w i n g the above d e f i n i t i o n s we can now s p e c i f y the g l o b a l f e a t u r e s of a t h i n n e d alphanumeric c h a r a c t e r as j u n c t i o n s of t y p e J 3 and J 4 , e n d p o i n t s ( E p ) , s i n g l e p o i n t s 40 (Sp) and the number of c l o s u r e s . These f e a t u r e s can be d e t e c t e d and e x t r a c t e d from the. t h i n n e d images by examining t h e i r l o c a l neighbourhood f o r the e x i s t e n c e of c e r t a i n b i t p a t t e r n s i n a manner s i m i l a r t o the t h i n n i n g a l g o r i t h m p r e s e n t e d i n c h a p t e r I . T h i s i s c o n s i s t e n t w i t h the s t r a t e g y f o r f a s t p r o c e s s i n g t h a t i s used i n the d e s i g n of the t h i n n i n g a l g o r i t h m and i n f a c t can share the same d e d i c a t e d hardware i f VLSI i m p l e m e n t a t i o n i s t o be used. The g l o b a l f e a t u r e d e t e c t i o n p r o c e d u r e f o r a t h i n n e d b i n a r y image ( c o n s i s t i n g of 1's and 0's) i s based on the f o l l o w i n g d e f i n i t i o n s of c r i t i c a l p o i n t s 1 : 1. A p i x e l P i s c a l l e d an s i n g l e p o i n t i f i t has no non-zero n e i g h b o u r s . S i n g l e p o i n t s a r e l a b e l e d 9 as they a r e found. 2. A p i x e l P i s c a l l e d an e n d p o i n t i f i t has e x a c t l y ONE non-zero n e i g h b o u r . E n d p o i n t s a r e l a b e l e d 2 as they a r e found. 3. A p i x e l P i s t r i - r a d i a l (J3) i f i t s a t i s f i e s any ONE of the two c o n d i t i o n s below. ( a ) . I t has e x a c t l y t h r e e non-zero n e i g h b o u r s and does not have a l o c a l neighbourhood of any ONE of the c o n f i g u r a t i o n s shown i n f i g u r e 3.2 or those o b t a i n e d 1 C r i t i c a l p o i n t s a r e g l o b a l f e a t u r e s t h a t can be viewed as nodes i n t h e t h i n n e d image. 41 from them by m u l t i p l e s of 9 0 \u00C2\u00B0 r o t a t i o n s , A A 1 A P 1 A A A A 1 1 A P A A A A where ONE of A i s n o n - z e r o . F i g . 3.2 L o c a l ne ighbourhood of an i l l e g a l J3 p i x e l P. ( b ) . I t has e x a c t l y f i v e ne ighbours and a neighbourhood of the c o n f i g u r a t i o n shown in f i g u r e 3.3 or those o b t a i n e d from them by m u l t i p l e s of 9 0 \u00C2\u00B0 r o t a t i o n s . A 0 A A P 0 A 0 A where A>0 F i g . 3.3 L o c a l ne ighbourhood of a J3 p i x e l P hav ing f i v e n e i g h b o u r s . 4. A p i x e l P i s q u a d - r a d i a l (J4) i f i t has e x a c t l y four ne ighbours and does not have any ONE of the c o n f i g u r a t i o n s shown i n f i g u r e 3.4 or those o b t a i n e d from 42 them by m u l t i p l e s of 90\u00C2\u00B0 r o t a t i o n s A A A B P B B B B B A B 0 P 0 C A C where A>0, ONE of B and ONE of C i s non-zero. F i g . 3.4 L o c a l neighbourhood of an i l l e g a l J4 p i x e l P. J3 p i x e l s and J4 p i x e l s a r e l a b e l e d as 3s and 4s as they a r e found. These d e f i n i t i o n s f o r J3 and J4 a r e not n e c e s s a r i l y the o n l y p o s s i b l e ones t h a t w i l l unambiguously d e f i n e the j u n c t i o n s of a t h i n n e d image i n the d i s c r e t e p l a n e . T h i s i s because as d e f i n e d a 4-way j u n c t i o n i n the c o n t i n u o u s p l a n e w i l l not n e c e s s a r i l y map i n t o a s i m p l e J4 but p o s s i b l y i n t o d i f f e r e n t c o m b i n a t i o n s of J 3 s and J 4 s back t o back. In the absence of j u n c t i o n s w i t h r a d i a l i t y g r e a t e r than f o u r i t can e a s i l y be v e r i f i e d by examining the p o s s i b l e p e r m u t a t i o n s of the l o c a l neighbourhood of a p i x e l i n a 3x3 p i x e l window t h a t the d e f i n e d J3 and J4 w i l l unambiguously l a b e l a l l p o s s i b l e c o m b i n a t i o n s of t r i - r a d i a l and q u a d - r a d i a l j u n c t i o n s , p r o v i d e d t h a t back t o back j u n c t i o n p i x e l s a r e p e r m i t t e d and c o n s i d e r e d as two j u n c t i o n s s e p a r a t e d by a br a n c h of u n i t p i x e l l e n g t h . Examples of some c h a r a c t e r images whose g l o b a l f e a t u r e s have been l a b e l e d can be seen i n f i g u r e 3.5. F i g u r e s 3.5a-c a r e images from Munson's d a t a but f i g u r e 3.5d i s a s i m u l a t e d image 43 showing the worst p o s s i b l e case t h a t can a r i s e f o r a q u a d - r a d i a l j u n c t i o n . The analogue e q u i v a l e n c e of these images were o b t a i n e d by drawing c o n t i n u o u s c u r v e s t o the t h i n n e d images. The number of c l o s u r e s i n an image can be o b t a i n e d from the number of d i s j o i n t p i e c e s and the number of c r i t i c a l p o i n t s p r e s e n t i n the image. The number of d i s j o i n t p i e c e s can be o b t a i n e d d u r i n g the image or graph t r a c k i n g p r o c e s s which i s g i v e n i n a l g o r i t h m A2. For a c o n t i n u o u s l i n e image i t i s easy t o v e r i f y t h a t the e m p i r i c a l f o r m u l a of e q u a t i o n 3.2.1 g i v e s the c o r r e c t number of c l o s u r e s i n the image. C = l/2( 0 + 27 + 2p - a ) (3.2.1) where a = No. of e n d p o i n t s . j3 = No. of J 3 s . 7 = No. of J 4 s . p = No. of d i s j o i n t p i e c e s . Because of the non-unique mapping from the c o n t i n u o u s t o the d i s c r e t e c a s e , u s i n g the number of J3 s and J 4 s o b t a i n e d from the d i s c r e t e r e p r e s e n t a t i o n of the image i n e q u a t i o n 3.2.1 w i l l y i e l d an e r r o r n e o u s r e s u l t . However, i f a p a i r of back t o back j u n c t i o n i s viewed as a d i s c r e t e r e p r e s e n t a t i o n of a s i n g l e j u n c t i o n formed from two j u n c t i o n s t h a t have merged i n t h e c o n t i n u o u s p l a n e , ( d e s p i t e the f a c t t h a t a u n i t p i x e l b ranch i s c o n s i d e r e d t o e x i s t i n i t s d i s c r e t e r e p r e s e n t a t i o n ) than some of the branches would be l o s t i n 44 t h i s merger. For a d i s c r e t e image w i t h a J3 and J4 back t o back t h e s e two j u n c t i o n s share a common b r a n c h , i n o t h e r words an e q u i v a l e n t branch i s l o s t i n i t s analogue image. S i m i l a r l y , f o r two J 4 s back t o back two branches are s h a r e d or l o s t i n i t s analogue v e r s i o n . T h e r e f o r e e q u a t i o n 3.2.1 can be m o d i f i e d so t h a t the c o r r e c t c l o s u r e count i n the image can be o b t a i n e d by u s i n g the j u n c t i o n s d e f i n e d i n i t s d i s c r e t e v e r s i o n . T h i s i s done by i n t r o d u c i n g two o f f s e t v a r i a b l e s ; o f f s e t l , the number of J3-J4 p a i r s and o f f s e t 2 , the number of J4-J4 p a i r s found i n the d i s c r e t e image. These o f f s e t s a r e e a s i l y o b t a i n e d through the use of c o u n t e r s i n the t r a c k i n g a l g o r i t h m 2 . The m o d i f i e d e q u a t i o n i s then g i v e n as C = 1/2( /5 + 27 + 2p -a - o f f s e t l - 2 x o f f s e t 2 ) \u00E2\u0080\u00A2 \u00E2\u0080\u00A2 \u00E2\u0080\u00A2\u00E2\u0080\u00A2\u00E2\u0080\u00A2\u00E2\u0080\u00A2(3\u00C2\u00BB2*2)\u00C2\u00AB T h i s completes the d e s c r i p t i o n of the d e t e c t i o n p r o c e d u r e s f o r the c r i t i c a l p o i n t s and c l o s u r e s . Note t h a t the g l o b a l f e a t u r e s d e f i n e d do not i n c l u d e f e a t u r e s such as 2-way j u n c t i o n s , p o i n t s of i n f l e c t i o n , maximas and minimas. These p o i n t s a r e n o n t o p o l o g i c a l p o i n t s and t h e i r p r e s e nce i n an image a r e somewhat s u b j e c t i v e and d i f f i c u l t t o d e f i n e . B e s i d e s t h e i r p r o p e r t i e s would be b e t t e r u t i l i z e d i f used i n the l a t t e r s t a g e of the r e c o g n i t i o n p r o c e s s t o d i f f e r e n t i a t e between images h a v i n g the same t o p o l o g y . 2 More p r e c i s e l y o f f s e t l i s i ncremented once e v e r y time a n o n t e r m i n a l J3 node i s e n c o u n t e r e d as a n e i g h b o u r of a J4 node or v i c e v e r s a . 0 f f s e t 2 i s incremented once e v e r y time a n o n t e r m i n a l J4 node i s e n c o u n t e r e d as a n e i g h b o u r of another J4 node. F i g . 3.5 C r i t i c a l p o i n t s of c h a r a c t e r images from Munson's da t a and t h e i r 'analogue e q u i v a l e n t ' . 46 3. Image E x t r a c t i o n . 3.1 Data s t r u c t u r e . The d a t a s t r u c t u r e used t o r e p r e s e n t a c h a i n coded d i g r a p h not o n l y must be e c o n o m i c a l i n i t s memory r e q u i r e m e n t s but must a l s o be s u i t a b l e f o r h a n d l i n g a b s t r a c t d a t a w i t h f a s t a c c e s s t i m e . T h i s i s m a i n l y because the r e c o g n i t i o n p r o c e d u r e s i n g e n e r a l i n v o l v e r e p e a t e d a c c e s s t o d i f f e r e n t v a r i a b l e s of the image. I f r e c o g n i t i o n i s t o be performed i n r e a l t i m e , the type of d a t a s t r u c t u r e w i l l p l a y a key r o l e i n d e t e r m i n i n g the r e c o g n i t i o n speed. B e s i d e s t h e c h a r a c t e r images when r e p r e s e n t e d by i t s d i g r a p h w i l l be s u b j e c t e d t o g r a p h i c a l a n a l y s i s which i n v o l v e s the use of graph t r a v e r s a l a l g o r i t h m s . T h e r e f o r e t h e da t a s t r u c t u r e used must be one t h a t p e r m i t s \u00E2\u0080\u00A2 r a p i d a c c e s s from one node t o a n o t h e r as w e l l as a l l o w i n g some form of r e l a t i o n s h i p t o e x i s t between nodes. The most s u i t a b l e d a t a s t r u c t u r e f o r the above r e q u i r e m e n t s i s the p o i n t e r i m p l e m e n t a t i o n of l i n k e d l i s t s f o r d i g r a p h s . U s i n g two p o i n t e r s a s e a r c h a l g o r i t h m can move fo r w a r d or backward from a g i v e n node as w e l l as d e l e t e or i n s e r t nodes from the l i s t w i t h ease. The c h a i n coded d i g r a p h r e p r e s e n t a t i o n of an image can be s t o r e d as a l i n k e d l i s t formed by l i n k i n g the node d a t a t a b l e (NDT) t h a t i s c r e a t e d f o r each node found i n the image. Each NDT c o n t a i n s the a t t r i b u t e s of the node such as node number, j u n c t i o n t y p e , l o c a t i o n and c h a i n codes of the branches a s s o c i a t e d w i t h the node. S t a t u s r e g i s t e r s or f l a g s a r e a l s o i n c l u d e d t o p r o v i d e 4 7 d i f f e r e n t s t a t u s i n f o r m a t i o n about each node. T a b l e I shows the c o n t e n t of a t y p i c a l NDT. 3.2 Image e x t r a c t i o n and s p u r i o u s branch p r u n i n g p r o c e d u r e . Image e x t r a c t i o n i s b a s i c a l l y a t r a n s f o r m a t i o n of the t h i n n e d image i n t o i t s d i g r a p h . The t r a n s f o r m a t i o n i s a c c o m p l i s h e d by t r a c k i n g and e x t r a c t i n g the c h a i n codes of the branches ( l i n k s ) between the nodes ( c r i t i c a l p o i n t s ) of the image t h a t have been d e t e c t e d and l a b e l e d by the proc e d u r e g i v e n i n s e c t i o n 2. In o r d e r t o t r a c k t h e s e branches s u c c e s s f u l l y , the t r a c k i n g p r o c e d u r e must observe the f o l l o w i n g r u l e s : 1. S t a r t i n g from a node. When the f i r s t p i x e l of a branch has been i d e n t i f i e d by p r o c e d u r e ' t r a c k ' , a l l o t h e r '1' n e i g h b o u r s of the node must be t e m p o r a r i l y i g n o r e d or s u p p r e s s e d u n t i l the next p i x e l i n the branch has been i d e n t i f i e d . 2. P r o c e d u r e ' t r a c k ' must check a l l the n e i g h b o u r s of the c u r r e n t branch p i x e l f o r the p r e s e n c e of c r i t i c a l p o i n t p i x e l s (nodes) b e f o r e i d e n t i f y i n g the next '1' p i x e l (hence the next code) of the b r a n c h . 3. R e l a b e l a l l p i x e l s i n a branch whose code has been e x t r a c t e d t o 9. 4. The next p i x e l of a branch i s i d e n t i f i e d by f o l l o w i n g i t s '1's c o n n e c t i v i t y . 5. Branch t e r m i n a t i o n o c c u r s when a new c r i t i c a l p o i n t p i x e l i s found or a c r i t i c a l p o i n t i s found a f t e r the branch 48 code has a l e n g t h of g r e a t e r than two. Lemma: A l l branches of a t h i n n e d b i n a r y image whose j u n c t i o n s a r e unambiguously d e f i n e d and l a b e l e d by the pr o c e d u r e i n s e c t i o n 2 can be s u c c e s s f u l l y t r a c k e d by u s i n g r u l e s 1 t o 5. P r o o f : Only e n d p o i n t s and j u n c t i o n s of type J3 or J4 have bra n c h e s . S i n c e branches have s i n g l e p i x e l t h i c k n e s s they can be t r a c k e d by f o l l o w i n g i t s 1's c o n n e c t i v i t y . . The r e s t of the pro o f l i e s i n the c o r o l l a r y t o d e f i n i t i o n 2.1.2. That i s , i f a p i x e l has more than two n e i g h b o u r s then i t must e i t h e r be a j u n c t i o n p i x e l (J3 or J4) or i t has a t l e a s t one j u n c t i o n p i x e l as i t s n e i g h b o u r . T h i s g u a r a n t e e s a branch t e r m i n a t i o n i n a n o t h e r c r i t i c a l p o i n t . H aving e s t a b l i s h e d a v i a b l e b r a n c h t r a c k i n g p r o c e d u r e , the r e s t of the image e x t r a c t i o n i n v o l v e s t r a c k i n g the branches and l i n k i n g the nodes whose NDT's have been c r e a t e d p r e v i o u s l y by the f e a t u r e d e t e c t i o n and d e f i n i t i o n p r o c e s s . The image e x t r a c t i o n f o l l o w s a depth f i r s t graph t r a v e r s a l t e c h n i q u e u s i n g the f o l l o w i n g r u l e s : 1. P i c k a c o n v e n i e n t node and c a l l t h i s the r o o t node. T h i s node i s taken t o be the bottom r i g h t - m o s t node by the A l g o r i t h m A2. 2. S t a r t i n g w i t h the r o o t node as the p r e s e n t node, t r a c k and e x t r a c t the c h a i n code of any branch t h a t i s found s t a r t i n g from the e a s t e r l y (Freeman's 1) d i r e c t i o n and moving c o u n t e r c l o c k w i s e . I f a branch t r a c k e d l e a d s t o an e n d p o i n t or a node t h a t has p r e v i o u s l y been v i s i t e d ( t e r m i n a l node) then the branch i s c a l l e d a s u b l i n k . The c h a i n code f o r t h i s s u b l i n k i s s t o r e d and i t s a s s o c i a t e d p o i n t e r s e t t o p o i n t t o the n o n t e r m i n a l node. Branch s e a r c h i n g and t r a c k i n g c o n t i n u e s a t t h i s p r e s e n t node. I f a branch t r a c k e d l e a d s t o a J3 or J4 t h a t has not been p r e v i o u s l y v i s i t e d ( n o n t e r m i n a l node) then the branch i s c a l l e d a main l i n k . The c h a i n code f o r t h i s main l i n k i s s t o r e d a t the p r e s e n t node and the new n o n t e r m i n a l node found i s taken as the new p r e s e n t node. The f o r w a r d p o i n t e r and backward p o i n t e r of the new and p r e v i o u s p r e s e n t nodes a r e then s e t . T r a v e r s a l c o n t i n u e s i n t h i s manner u n t i l the a l g o r i t h m can go no deeper, t h a t i s a l l branches from a p r e s e n t node have been t r a c k e d . Then the a l g o r i t h m b a c k t r a c k s t o the l a s t node t h a t was used as the p r e s e n t node and the p r o c e s s c o n t i n u e s . The t r a v e r s a l i s complete when the p r o c e s s b a c k t r a c k s t o the r o o t node and a l l branches of the r o o t node has been t r a c k e d . In t h i s approach the p r o c e s s i s gu a r a n t e e d t o t e r m i n a t e a f t e r t r a c k i n g a l l the nodes b e l o n g i n g t o the graph w i t h the chosen r o o t node. Upon t e r m i n a t i o n of each t r a v e r s a l the e x t r a c t i o n a l g o r i t h m must check f o r the p r e s e n c e of o t h e r d i s j o i n t p i e c e s or i s o l a t e d c l o s u r e s i n the image t h a t has not been t r a c k e d ( e x t r a c t e d ) . D i s j o i n t p i e c e s can be d e t e c t e d by c h e c k i n g i f a l l the nodes i n the image have been v i s i t e d by 50 the t r a c k i n g a l g o r i t h m . O t h e r w i s e a new u n v i s i t e d node w i l l be t a k e n as the new r o o t node and t r a c k i n g of the d i s j o i n t p i e c e s can be a c c o m p l i s h e d i n the same way as above. I s o l a t e d c l o s u r e s a r e c i r c u l a r p a t t e r n s of s i n g l e p i x e l t h i c k and t h e r e f o r e has no nodes. The presence of t h e s e p a t t e r n s are d e t e c t e d by c h e c k i n g t h a t a l l 1's p i x e l s i n the image have been t r a c k e d . I s o l a t e d c l o s u r e s when found can be t r a c k e d by f i r s t t a k i n g i t s top l e f t m o s t p o i n t (or any p o i n t v i a a c o n s i s t e n t c h o i c e ) and l a b e l i t as a s p e c i a l node of type ' c l o s e d ' . Then the same t r a c k i n g p r o c e d u r e s g i v e n above can be a p p l i e d t o e x t r a c t i t s c h a i n code. The r e s u l t of t h i s e x t r a c t i o n p r o c e d u r e i s one or more l i n k e d l i s t s of NDTs, each d e s c r i b i n g g r a p h i c a l l y p a r t of or the whole t h i n n e d image of an a l p h a n u m e r i c c h a r a c t e r . T h i s d e s c r i p t i o n of the image may s t i l l c o n t a i n n o i s e i n the form of s p u r i o u s branches t h a t may be p r e s e n t due t o the t h i n n i n g p r o c e s s or d e l i b e r a t e l y i n t r o d u c e d as a r e s u l t of d i f f e r e n t w r i t i n g s t y l e s . These n o i s e branches can be pruned by merely i n s p e c t i n g the nodes (NDTs i n the l i n k e d l i s t ) f o r s u b l i n k s t h a t t e r m i n a t e i n e n d p o i n t s w i t h a l e n g t h of say l e s s than 5% of t h e t o t a l number of non-zero p o i n t s i n the image. T h i s user programmable p r u n i n g parameter i s an advantage because i t a l l o w s the a l g o r i t h m t o be tuned or a d j u s t e d t o o p e r a t e o p t i m a l l y under d i f f e r e n t n o i s e c o n d i t i o n s . P r u n i n g a l s o r e s u l t i n a change t o the t ype of j u n c t i o n t h a t forms the node. For example, a J3 node w i t h one branch pruned w i l l mean t h a t the j u n c t i o n no l o n g e r q u a l i f i e s as a node and t h e r e f o r e 51 the l i n k e d l i s t s t r u c t u r e w i l l have t o be r e v i s e d . T h i s i s e q u i v a l e n t t o a node d e l e t i o n from the l i s t w i t h the c h a i n code of the main l i n k of the d e l e t e d node j o i n e d t o the c h a i n code of the main l i n k of i t s p r e d e c e s s o r . Such d e l e t i o n can be done v e r y e a s i l y w i t h a two way l i n k e d l i s t s t r u c t u r e - . The b a s i c p r o c e d u r e s f o r g l o b a l f e a t u r e d e t e c t i o n and image e x t r a c t i o n i s p r e s e n t e d i n A l g o r i t h m A2. F i g u r e s 2.7a and 2.7b shows the t h i n n e d image of c h a r a c t e r 'A' a f t e r g l o b a l f e a t u r e d e t e c t i o n , i t s e q u i v a l e n t c h a i n coded d i g r a p h and i t s image s t a t i s t i c s both b e f o r e and a f t e r p r u n i n g . 4. Image P r e c l a s s i f i c a t i o n . A graph based image d e f i n i t i o n and e x t r a c t i o n has been d e s i g n e d based on d e s c r e t e image t o p o l o g y . The a l g o r i t h m i s implemented i n P a s c a l on the PDP 11/23 minicomputer. A l i s t of g l o b a l f e a t u r e s was chosen based on e n g i n e e r i n g knowledge of c h a r a c t e r shapes. These f e a t u r e s a r e used t o form t h e 25 groups of the p r e c l a s s i f i e r . When t e s t e d w i t h 1000 c h a r a c t e r s i t i s found t h a t 108 d i s t i n c t v a r i a t i o n s i n the shapes of t h e 26 c h a r a c t e r s were c l a s s i f i e d i n t o the 25 d i f f e r e n t g roups. The l a r g e s t of t h e s e groups c o n t a i n 22 c l a s s e s w h i l e some groups such as Group I , IV, V, e t c . c o n t a i n o n l y a s i n g l e c l a s s or c h a r a c t e r t y p e . These s i n g l e c l a s s groups w i l l r e s u l t i n the d i r e c t r e c o g n i t i o n of the c h a r a c t e r s w i t h o u t f u r t h e r p r o c e s s i n g as shown i n the b l o c k diagram of f i g u r e 1.2. 52 4.1 Input e n t r o p y r e d u c t i o n due t o p r e c l a s s i f i c a t i o n . To measure the e f f e c t i v e n e s s of t h i s p r e c l a s s i f i e r , we w i l l c a l c u l a t e i t s e f f e c t i v e n e s s i n r e d u c i n g the e n t r o p y H of the i n p u t , where H i s d e f i n e d a s , H = - I p l o g 2 p i i i w i t h p the a priori p r o b a b i l i t y of each c h a r a c t e r . Assuming i a l l 26 c h a r a c t e r s as e q u a l l y p r o b a b l e , then the t o t a l e n t r o p y ( u n c e r t a i n t y ) of an image a t the i n p u t of the p r e c l a s s i f i e r i s 4.7 b i t s ( = l o g 2 2 6 ) . A f t e r p r e c l a s s i f i c a t i o n , the i n p u t t o the f i n a l c l a s s i f i e r w i l l be from a known group. Hence i f we assume t h a t the c h a r a c t e r s i n each group a r e a g a i n e q u a l l y p r o b a b l e , then the t o t a l e n t r o p y of an i n p u t t o the f i n a l c l a s s i f i e r can be c a l c u l a t e d s i m i l a r l y and w i l l depend on which group i t b e l ongs t o . The e n t r y H i n t a b l e I I shows the G t o t a l e n t r o p y of an image from each group. I t can be seen t h a t the t o t a l e n t r o p y of an image from any group i s s m a l l e r than t h a t of an image a t the i n p u t of t h e p r e c l a s s i f i e r . To o b t a i n a more r e a l i s t i c average r e d u c t i o n i n e n t r o p y by the p r e c l a s s i f i e r , one has t o c o n s i d e r the d i s t r i b u t i o n of the i n p u t c h a r a c t e r s over the 25 g r o u p s . T h i s can be done by making use of the p e r c e n t a g e d i s t r i b u t i o n f i g u r e s g i v e n i n the A% column of t a b l e I I . C o n s i d e r a b a t c h of 100 c h a r a c t e r images, r e p r e s e n t i n g a t o t a l e n t r o p y of 470 b i t s a t the i n p u t of t h e p r e c l a s s i f i e r . Then from th e A% f i g u r e f o r Group I I X , we can say t h a t on t h e average 16 of t h e s e i n p u t images w i l l be c l a s s i f i e d as b e l o n g i n g t o Group I I X . These 16 images from 53 Group I I X w i l l have a t o t a l e n t r o p y of 64 b i t s when p r e s e n t e d as i n p u t t o the f i n a l c l a s s i f i e r . P e r f o r m i n g s i m i l a r c a l c u l a t i o n s f o r the images c l a s s i f i e d i n t o a l l the o t h e r groups and summing, we o b t a i n a t o t a l e n t r o p y a f t e r p r e c l a s s i f i c a t i o n of 330 b i t s . T h e r e f o r e p r e c l a s s i f i c a t i o n has r e s u l t e d i n an average e n t r o p y r e d u c t i o n of 140 b i t s (1.4 b i t per i n p u t ) or 30%. The 30% average e n t r o p y r e d u c t i o n a c t u a l l y r e f l e c t s a v e r y e f f e c t i v e p r e c l a s s i f i e r because the above e v a l u a t i o n i s based on a human o b s e r v e r ' s p e r c e p t i o n of the problem. That i s t o i d e n t i f y one of the 26 p o s s i b l e c h a r a c t e r s i r r e s p e c t i v e of i t s s t y l e , shape or f o n t . I d e a l l y , one would l i k e t o be a b l e t o d e s i g n a r e c o g n i t i o n system t h a t c o u l d p e r f o r m the t a s k of r e c o g n i z i n g a c h a r a c t e r t o the same l e v e l of s o p h i s t i c a t i o n as the human re a d e r but t h i s i s not p o s s i b l e a t the p r e s e n t s t a t e of a r t . I n s t e a d i n machine r e c o g n i t i o n , the c l a s s i f i c a t i o n i s based on image s t r u c t u r e s and the r e l a t i o n s between these s t r u c t u r e s t h a t d e f i n e i t s shapes. T h e r e f o r e from the machine's p o i n t of v i e w, the problem i s not s i m p l y t o i d e n t i f y one of the 26 p o s s i b l e c h a r a c t e r s but t o i d e n t i f y one of the t o t a l number of shapes t h a t can be formed from the 26 c h a r a c t e r s . Each c h a r a c t e r i s now not t r e a t e d as a s i n g l e c l a s s by i t s e l f but c o m p r i s e s of a number of c l a s s e s depending on the number of t o p o l o g i c a l v a r i a t i o n s i n i t s shape. From the d a t a we have i d e n t i f i e d 108 p o s s i b l e v a r i a t i o n s i n the shapes of t h e s e c h a r a c t e r s , so t o the r e c o g n i t i o n machine t h i s r e p r e s e n t s an i n i t i a l i n p u t image e n t r o p y of 6.75 b i t s 54 ( = l o g 2 l 0 8 ) . From t h i s p o i n t of v i e w, th e p r e c l a s s i f i e r has an average e n t r o p y r e d u c t i o n of 51%. 5. D i s c u s s i o n . O b v i o u s l y i n p u t image e n t r o p y r e d u c t i o n i s not the o n l y g a i n from u s i n g the p r e c l a s s i f i e r . Another i m p o r t a n t r e s u l t of t h i s t e c h n i q u e i s t h a t images a r e grouped such t h a t images i n d i f f e r e n t groups a r e t o p o l o g i c a l l y n o n e q u i v a l e n t . U n f o r t u n a t e l y , the c o n v e r s e cannot be s a i d f o r a l l images w i t h i n a g i v e n group f o r two r e a s o n s . The f i r s t i s the i n e x a c t r e p r e s e n t a t i o n of analogue images i n the d i s c r e t e p l a n e . For j u n c t i o n s w i t h r a d i a l i t y g r e a t e r than 4, the s h a r e d branch i n a back t o back node would be a t t a c h e d t o a d i f f e r e n t node depending on the branch p o s i t i o n and t h e o r d e r the nodes a r e v i s i t e d . S e c o n d l y , a l t h o u g h the g l o b a l f e a t u r e s a r e d e f i n e d as t o p o l o g i c a l p o i n t s , t h e s e p o i n t s a l o n e are i n s u f f i c i e n t t o u n i q u e l y s p e c i f y t o p o l o g i c a l e q u i v a l e n c e . The e x t r a i n f o r m a t i o n t h a t i s needed i s the c u r v e c o n t i n u i t y or o r d e r of c o n n e c t i v i t y , which i s not used i n t h e p r e c l a s s i f i c a t i o n of the images. T h e r e f o r e images w i t h i n each group may have common g l o b a l f e a t u r e s but a r e not n e c e s s a r i l y t o p o l o g i c a l l y e q u i v a l e n t as i l l u s t r a t e d by the two images i n f i g u r e 3.6 below. 55 F i g . 3.6 Images w i t h i d e n t i c a l g l o b a l f e a t u r e s tha t are t o p o l o g i c a l l y i n e q u i v a l e n t . N e v e r t h e l e s s , i f the o r d e r of c o n n e c t i v i t y or c o n t i n u i t y i s c o n s i d e r e d as l o c a l v a r i a t i o n s i n the image than p r e c l a s s i f i c a t i o n does r e s u l t i n a g r o s s s e p a r a t i o n of images i n t o groups wi th commom g l o b a l f e a t u r e s as r e f l e c t e d by the en tropy r e d u c t i o n . More i m p o r t a n t l y , p r e c l a s s i f i c a t i o n a l l o w s v a r i a t i o n s i n l o c a l f e a t u r e s can be examined in g r e a t e r d e t a i l in a s eparate p r o c e s s tha t w i l l r e s u l t i n the f i n a l r e c o g n i t i o n . Such a p r o c e s s i s g i v e n in the next c h a p t e r . 56 Table I . A t y p i c a l node data t a b l e f o r chain coded digraph r e p r e s e n t a t i o n of thinned alphanumeric c h a r a c t e r s . CONTENTS: Abv. I n i t i a l Value Node number Node-no. 0 June. t y p . JT ** Coordinate (I , J ) (0,0) Forward p o i n t e r fwdptr N i l Backward p o i n t e r bkptr N i l Integer s ta tus o r d e r , l k , M l 0 ,0 ,0 Main l i n k code M a i n - l i n k 0. .0 s u b l i n k l code s u b - l i n k 1 0. .0 subl ink2 code s u b - l i n k 2 0. .0 sub l ink3 code s u b - l i n k 3 0. .0 s u b l i n k l p t r . subptr1 N i l sub l ink2 p t r . subptr2 N i l sub l ink3 p t r . subptr3 N i l Remarks: 1. Node number i s the order the nodes are found. 2 . Order i s the order the nodes are v i s i t e d by during the e x t r a c t i o n process. Therefore once v i s i t e d a node w i l l have an order of > 0 . 3 . Lk and Ml are used to i n d i c a t e the number of s u b l i n k s and mainlink attached to a node. 4. Subptrs are used t o i n d i c a t e the t e r m i n a l nodes of s u b l i n k s , these information are required by the pruning procedures. 57 T a b l e I I . Group c l a s s i f i c a t i o n of sample c h a r a c t e r s data from Munson's d a t a . GROUP. GLOBAL FEATURES A% CHARACTERS. H SP. J 3 . J 4 . SP. c . G I 0 0 0 0 1 3.0 0 0 II 0 2 0 0 2 1 .2 0,B 1 .00 III 1 1 0 0 1 5.8 D , G , 0 , P , Q , S 2.59 IV 1 1 1 0 2 0.1 Q 0 V 1 1 2 0 2 0.2 Q 0 VI 1 2 1 0 2 0.1 B 0 VII 1 3 0 0 2 1 .8 B , 0 , Q 1 .59 IIX 2 0 0 0 0 16.0 B , C , D , G , J , L , M , N ,0 4.00 P , R , S , U , V , W , 2 IX 2 0 1 0 1 0.3 R 0 x 2 0 2 0 1 4.5 Q 0 XI 2 1 1 0 1 8.0 P .Q .R 1 .59 XII 2 2 0 0 1 6.0 A , B , D , G , P , Q , R , J 3.00 XIII 2 4 0 0 2 0.2 B 0 XI V 3 1 0 0 0 28.2 B , C , D , E , F , G , H , I , J , L ,M 4.46 N , P , Q , R , S , T , U , V , W , Y , Z XV 3 1 1 0 1 0.1 A 0 XVI 3 3 0 0 1 0.2 A , B , G , Q , R 2.32 XVII 4 0 0 0 0 0.3 G , J , T 1 .59 XIIX 4 0 1 0 0 0.2 Q,x 1 .00 XIX 4 0 2 0 0 0.3 K 0 XX 4 1 1 0 0 0.5 K , X 1 .00 XXI 4 2 0 0 0 20.8 B , E , F , G , H , I , J , K ,M 4.00 N , P , R , T , W , X , Z XXII 4 2 1 0 1 0.1 A 0 XXIII 4 4 0 0 2 0.3 A 0 XXIV 5 1 1 0 0 0.2 H 0 XXV 5 3 0 0 0 1.6 A , E , H , M , N , W , X , Z 3.00 Remarks: 1. Ep,J3,J4,Sp and C a r e t h e number of e n d p o i n t s , J 3 s , J 4 s , s i n g l e p o i n t s and c l o s u r e s found i n the image. 2. A % i s the p e r c e n t a g e d i s t r i b u t i o n o f i n p u t images over t h e d i f f e r e n t g r oups. 3. H r i s the t o t a l e n t r o p y of an image from the group. 26 2i 1 3 1 1 1 1 \u00C2\u00A9 E q u i v a l e n t d i g r a p h . Chain c o d e d l i n k s : Ml H2 M3 SI S2 S3 332333233 233323446666 7777 4 1111 567767676 \u00C2\u00A9 Ml M2 SI \u00C2\u00AB'S2 \u00C2\u00A9 E q u i v a l e n t diagraph. Chain coded l i n k s . Ml - 332333233 M2 - 2333234466667777 51 - 1111 52 - 567767676 Image s t a t i s t tea before pr-unnlng: Totel no. of p i x e l s * 39 Total no. of nodes \u00E2\u0080\u00A2 6 Es \u00E2\u0080\u00A2 3. 03 \u00E2\u0080\u00A2 3 J4 \u00E2\u0080\u00A2 0. Sp \u00E2\u0080\u00A2 O Number of pieces - 1. O f f s e t l - O. 0 f f s e t 2 \u00E2\u0080\u00A2 0 Number of closures \u00E2\u0080\u00A2 1 Node^no - 6 , Order - 1 Junction type : Es. coord:(23,15) Associated branches :-Main_11nk : 332333233 : next node no - 4 Node_no - 4 . Order - 2 Junction type : J3. coord:(14,17) Associated branches :-\u00C2\u00ABa1n_llnk : 233323446666 : next node no - 2 Node_no - 2 . Order - 3 Junction type : J3. coord:(10.13) Associated branches :-Main_link : 7777 : next node no - 3 Sut>_l1nk[1] : 4 : terminal node no - 1 Nodervo - 3 , Order - S JuncTlon type : J3, coord: ( 14 . 13 ) Associated branches :-Sub 11nk[1] : 1111 : term1na1 node no - 4 Sub -1Infc[2) : 967767676 : terminal node no - 5 Image s t a t i s t i c s a f t e r prunnmg: Total no. of p i x e l s \u00C2\u00BB 38 Total no. of nodes * 4 Es \u00E2\u0080\u00A2 2. J3 \u00E2\u0080\u00A2 2 J4 - 0 Number of pieces \u00E2\u0080\u00A2 1, O f f s e t l \u00E2\u0080\u00A2 0. 0 f f s e t 2 - 0 Number of closures \u00E2\u0080\u00A2 1 Sp Node_no - 6 . Order - 1 Junction type : Es. coord:(23.15) Associated branches :-Mam li n k : 332333233 : next node no - 4 _no - 4 . Order - 2 Junction type : J3. coord:(14.17) Associated branches :-Maln_11nk : 2333234466667777 : next node no - 3 Node_no - 3 , Order - 5 Junction type : J3. coord:(14,13) Associated branches :-Sub_1lnk(1] . 1111 : terminal node no - 4 Sub~11nkl2] : S67767676 : terminal node no - 5 (a) (b) F i g . 2.7 R e p r e s e n t a t i o n of c h a r a c t e r 'A* b e f o r e p r u n i n g (a) and a f t e r p r u n i n g ( b ) . ALGORITHM A2. In p u t : Thinned b i n a r y image of an al p h a n u m e r i c c h a r a c t e r . Output: L i n k e d l i s t g r a p h i c a l r e p r e s e n t a t i o n of i n p u t image w i t h s p u r i o u s n o i s e branches removed. Root node of the graph i s c a l l e d base and any a u x i l i a r y graphs (subgraphs) p r e s e n t i n the image have t h e i r r o o t nodes c a l l e d s u b - b a s e [ l ] t o s u b - b a s e [ p i e c e s - 1 ] . BEGIN { main } 1 . For each '1' p i x e l Do check and l a b e l p i x e l s t h a t s a t i s f y any one of the c o n d i t i o n s 1 t o 4 i n s e c t i o n 2.2; 2. For each c r i t i c a l p o i n t found by s t e p 1 Do (a) . c r e a t e an NDT; (b) . E n t e r node a t t r i b u t e s of the new NDT, i e . node-no., j u n c t i o n type and c o o r d i n a t e s . 3. No. of p i e c e s := 0; 4. S e l e c t an NDT whose j u n c t i o n t y p e i s not an Sp and c a l l i t base; 5. Track and s t o r e g r a p h i c a l i n f o r m a t i o n of the image u s i n g the r u l e s i n s e c t i o n 3.2. T r a c k i n g p r o c e s s i n c l u d e s : (a) . I n c r e m e n t i n g c o u n t e r s o f f s e t l and o f f s e t 2 as a p p r o p i a t e . (b) . R e l a b e l a l l branch p i x e l s t h a t has been t r a c k e d as 9. (c) . L i n k the NDTs t r a c k e d a c c o r d i n g t o depth f i r s t t r a v e r s a l . 6. p i e c e s := p i e c e s + 1 ; 7. I f a l l nodes o t h e r than Sps have been v i s i t e d t h e n goto 8 e l s e B e g i n (a) , p i c k an u n v i s i t e d node o t h e r than an Sp and c a l l i t sub b a s e t p i e c e s ] (b) . r e p e a t s t e p s 5 t o 7 u n t i l a l l nodes t h a t a r e not Sps have been v i s i t e d . End. 8. c a l c u l a t e c l o s u r e u s i n g e q u a t i o n 3.2.2; c o n t . 60 9. I f t h e r e a r e any 1 1 ' p i x e l s l e f t i n the image then B e g i n (a) , c r e a t e a new NDT w i t h j u n c t i o n t y p e 'closed'and c a l l i t s u b - b a s e [ p i e c e s ] . (b) . t r a c k and s t o r e c h a i n code of l o o p . (c) . c l o s u r e := c l o s u r e + 1; (d) . p i e c e s := p i e c e s + 1; (e) . r e p e a t s t e p 9 u n t i l a l l '1' p i x e l s i n the image has been t r a c k e d . End. 10. F o r each NDT Do { p r u n i n g } (a) , remove each s u b l i n k t h a t t e r m i n a t e s a t an endpoint w i t h l e n g t h l e s s than some s p e c i f i e d minimum. (b) . update NDT e n t r i e s and p o i n t e r s as a p p r o p i a t e . END { ma i n }. 61 CHAPTER IV FINAL IMAGE CLASSIFICATION. 1. I n t r o d u c t i o n . Graphs have been used e x t e n s i v e l y f o r m o d e l l i n g r e l a t i o n s h i p s between d a t a o b j e c t s i n a l a r g e v a r i e t y of problems encountered i n computer s c i e n c e , mathematics and e n g i n e e r i n g . C o n s e q u e n t l y , a l a r g e number of r e s u l t s and a l g o r i t h m s p e r t a i n i n g t o g r a p h i c a l a n a l y s i s a r e a v a i l a b l e , [56] t o [ 6 2 ] . With the i n c r e a s e d demand f o r s o l v i n g h i g h l y complex problems on the d i g i t a l computer, a number of h i g h l y s p e c i a l i z e d graphs have been d e v e l o p e d from c o n v e n t i o n a l graph t h e o r i e s . One such graph i s the A t t r i b u t e d R e l a t i o n a l Graph (ARG), used i n s y n t a c t i c p a t t e r n r e c o g n i t i o n t o r e p r e s e n t s t r u c t u r a l and r e l a t i o n a l i n f o r m a t i o n of g i v e n p a t t e r n s [ 6 0 ] , A re v i e w of the b a s i c ARG w i l l be g i v e n i n the next s e c t i o n and the p a t t e r n d e f o r m a t i o n models t h a t can be r e p r e s e n t e d by the ARG a r e p r e s e n t e d t o g e t h e r w i t h the d i s t a n c e or c o s t measures f o r p a t t e r n d e f o r m a t i o n s . The main o b j e c t i v e of the r e v i e w on the ARG i s t o show i t s p o t e n t i a l a p p l i c a t i o n i n c h a r a c t e r r e c o g n i t i o n . B e f o r e such an a p p l i c a t i o n i s p o s s i b l e i t has t o be shown t h a t c h a r a c t e r images can be d e s c r i b e d r e a d i l y by an ARG. T h e r e f o r e s e c t i o n 3 i s devoted t o the d e s i g n of a t r a n s f o r m a t i o n which w i l l map a c h a i n coded d i g r a p h r e p r e s e n t a t i o n of a t h i n n e d c h a r a c t e r image r e p r e s e n t e d by i t s nodes and c h a i n codes of 62 i t s branches (as g i v e n i n c h a p t e r I I I ) t o an ARG d e s c r i p t i o n . I t w i l l be shown t h a t such t r a n s f o r m a t i o n i s e f f e c t i v e l y a l o c a l f e a t u r e e x t r a c t i o n p r o c e s s where ' i n t e r e s t i n g ' s t r u c t u r a l and r e l a t i o n a l a t t r i b u t e s are e x t r a c t e d from the c h a i n coded d i g r a p h . The r e s u l t i s a ARG d e s c r i p t i o n of the image which p r o v i d e s both the s t r u c t u r a l and r e l a t i o n a l i n f o r m a t i o n t h a t i s n e c e s s a r y f o r a s y n t a c t i c ( l i n g u i s t i c ) c l a s s i f i c a t i o n of the image. One of the main drawbacks i n u s i n g graphs f o r t h e purpose of computer r e c o g n i t i o n has been the c o m p l e x i t y t h a t i s i n v o l v e d i n graph matching or graph isomorphism. I n g e n e r a l , graph matching belongs t o a c l a s s of n o n d e t e r m i n i s t i c p o l y n o m i a l - t i m e (NP) complete problem where the o p t i m a l s o l u t i o n i s o b t a i n e d b a s i c a l l y by t r y i n g a l l p o s s i b i l i t i e s . Such an approach i s c o m p u t a t i o n a l l y v e r y e x p e n s i v e . A more w i d e l y a c c e p t e d and p r a c t i c a l approach i s t o use a h e u r i s t i c m atching p r o c e d u r e . A h e u r i s t i c matching a l g o r i t h m i s one t h a t can q u i c k l y produce a good but not n e c e s s a r i l y an o p t i m a l s o l u t i o n i n most i f not a l l the c a s e s . S e c t i o n 4 i s d e v o t e d t o the d e s i g n of such an a l g o r i t h m , c a l l e d the r e f e r e n c e g u i d e d i n e x a c t matching p r o c e d u r e . T h i s a l g o r i t h m i s shown t o g i v e a h i g h r e c o g n i t i o n r a t e w i t h Munson's c h a r a c t e r d a t a when used w i t h the p r e c l a s s i f i e r d e s i g n e d i n c h a p t e r I I I . 63 2. A t t r i b u t e d R e l a t i o n a l Graph - An I n t r o d u c t i o n . 2.1 B a s i c d e f i n i t i o n and t e r m i n o l o g y . The approach to ARG f o r m u l a t i o n and d e f i n i t i o n tha t i s taken here i s c l o s e l y r e l a t e d to the work of T s a i and Fu [ 6 0 ] . D e f n . 2.1.1 An ARG over a set of node and branch l a b e l s V\u00E2\u0080\u009E U V D i s a 4-tuple.. G = ( N , B , u , e ) where N = { a j \ i : [ l , N ] } a f i n i t e set of nodes . B = W j \ J : [ 1 r n B J CI NxN i s a set of o r d e r e d p a i r s of d i s t i n c t e lements in N c a l l b r a n c h e s . u(a>\i:[1,N]) = V N = { n , , n 2 . . . . n N } i s c a l l e d the node i n t e r p r e t e r . e ( 7 \ j : [ l , n _ ]) = V D = { b , , b 2 , . . . . b \u00E2\u0080\u009E } i s c a l l e d a branch 3 ** \" n B i n t e r p r e t e r . D e f n . 2.1.2 For each element i n N , the c o r r e s p o n d i n g node l a b e l (n j \ i : [ l , N ] ) denotes a p a t t e r n p r i m i t i v e and i s a 2 - t u p l e . M ( a i ) = = ( s i , ^ i ) , i : [ l , N ] . where s^ i s a s y n t a c t i c symbol . x. i s a semantic v e c t o r d e n o t i n g a set of l o c a l f e a t u r e s . 64 Semantic v e c t o r s d e s c r i b e the c h a r a c t e r i s t i c f e a t u r e s p e r t a i n i n g t o the s y n t a c t i c symbol and t o g e t h e r they d e s c r i b e a p a t t e r n p r i m i t i v e . For the case where the semantic v e c t o r i s a n u l l s e t or s i m p l y not d e f i n e d , then we have a c o n v e n t i o n a l node whose symbol i s s^. For our purpose of u s i n g ARGs f o r c h a r a c t e r d e s c r i p t i o n and r e c o g n i t i o n , the node s y n t a c t i c symbols chosen must be of the type t h a t denotes the t o p o l o g i c a l p r o p e r t i e s of the image f o r r e a s o n s which w i l l become apparent i n s e c t i o n 2.2. Defn. 2.1.3 S i m i l a r l y f o r each element 7 j i n B, the c o r r e s p o n d i n g branch l a b e l (b j \ j : [ l , n B ]) denotes a r e l a t i o n a l p r i m i t i v e and i s a 2 - t u p l e . e ( 7 j > = b j = ( U l k , ^ ), l , k : [ l , N ] , j : [ l , n B ]. where U l k = ^ n l n k ^ fc^e b r a n c f t s y n t a c t i c symbol, and i s a p a i r of node l a b e l s n^ and n^ whose r e l a t i o n i s d e s c r i b e d by the branch semantic v e c t o r . As an example f i g u r e 4.1 i l l u s t r a t e s the ARG d e s c r i p t i o n of a sample c h a r a c t e r 'R'. De f n. 2.1.4 An ARG G' i s a d e f o r m a t i o n of a n o t h e r ARG G i f f t h e r e e x i s t a t r a n s f o r m a t i o n h such t h a t : h: G'-^ G and h~ 1: G \u00E2\u0080\u0094*\u00E2\u0080\u00A2 G' . 65 Input image. Nodes:-N = U | l 0 2 , 0 ) I a , , O i , o 6 } 1 Branches : -B = {71 -72 .73 . 7 . .75 r7\u00C2\u00AB )\u00E2\u0080\u00A2 ARG Representa t ion . where i i (o , ) s NODE 1 = (s,,X u(a2) B NODE 2 = ( s 2 , x u(a3) = NODE 3 \u00E2\u0080\u00A2= ( s , , x i> \u00E2\u0080\u00A2 ( T i ) b 2 = (U 2 3 ' ^ ^ *<7,> = b , = e<7.) B b. = ( u 3 4 , * . ) t ( 7 i ) \u00E2\u0080\u00A2S b s \u00E2\u0080\u00A2= ( u 3 5 . \u00E2\u0080\u009E > \u00C2\u00AB ( > \u00E2\u0080\u00A2 ) b . \u00C2\u00AB ( u 4 6 , , \u00C2\u00AB > F i g . 4.1 ARG d e s c r i p t i o n of c h a r a c t e r 'R'. Remarks: D e t a i l d e s c r i p t i o n of th e s y n t a c t i c symbol ' s' and semantic v e c t o r s x and y used f o r c h a r a c t e r d e s c r i p t i o n w i l l be g i v e n i n s e c t i o n 3. 66 2.2 ARG d e f o r m a t i o n models. C o n s i d e r an ARG G' = (N' ,B' , / u ' , e' ) o b t a i n e d from G =(N,B,ji,e) by a t r a n s f o r m a t i o n h~1. By s u i t a b l y d e f i n i n g h such t h a t o n l y a p a r t i c u l a r component of G i s p e r m i t t e d t o be deformed, s e v e r a l d e f o r m a t i o n models can be o b t a i n e d . These models can be c a t e g o r i z e d i n t o t h r e e main t y p e s , namely; non-graph p r e s e r v i n g , graph p r e s e r v i n g and t o p o l o g y p r e s e r v i n g d e f o r m a t i o n s . Non-graph p r e s e r v i n g d e f o r m a t i o n r e s u l t s when h i s such t h a t N#N', B*B', u*u' and e*e'. T h i s means t h a t G' can be c o m p l e t e l y a d i f f e r e n t graph from G as none of the p r i m i t i v e s p r e s e n t i n G' and G may have any common p r o p e r t i e s . As such, t h i s t y p e of d e f o r m a t i o n i s of l i t t l e i n t e r e s t i n p a t t e r n r e c o g n i t i o n . Graph p r e s e r v i n g d e f o r m a t i o n r e s u l t s when h i s such t h a t N=N', B=B', u*n' and e*e'. Here the two graphs G and G' have i d e n t i c a l number of nodes and branches but d i f f e r s i n t h e i r node and bra n c h i n t e r p r e t a t i o n s . T h i s i m p l i e s t h a t b o t h s t r u c t u r a l and r e l a t i o n a l d e f o r m a t i o n s t o t h e nodes and branches can e x i s t . I n o t h e r words, the t y p e s of nodes, branches and c o n n e c t i o n o r d e r of t h e ARG a r e s u b j e c t e d t o change by h. Topology p r e s e r v i n g d e f o r m a t i o n (TPD) can be c o n s i d e r e d as a s u b c l a s s of the graph p r e s e r v i n g d e f o r m a t i o n . L e t G' be a t o p o l o g y p r e s e r v e d d e f o r m a t i o n of an ARG (TPD-ARG) G and h be the a s s o c i a t e d t r a n s f o r m a t i o n . Then h i s d e f i n e d t o have the T f o l l o w i n g p r o p e r t i e s : 67 h : G ' ( N ' , B ' , M ' , e ' ) \u00E2\u0080\u00A2 G (N, B , M , e ) \u00E2\u0080\u00A2 w i t h 1 . N = N'. 2. B = B ' . 3. G i v e n t h a t node l a b e l s n' i n G' and n i n G i s such h m n t h a t n' \u00E2\u0080\u0094 n then m n u'(a ) = n' = ( s , x ' ) and m m m uia ) = n = ( s , x ). m,n :[ 1 , N ] . n n n 4. S i m i l a r l y g i v e n t h a t b ranch l a b e l s b' i n G' and b h P q i n G i s such t h a t b' \u00E2\u0080\u0094 b then P q e' (7 ) = b' = (U' , y ) and p p ml p e ( 7 ) = b = (U , , y ) . q q nk q where U' , = (n' n' ). m,l : [ l , N ] ml m l and U , = (n n, ). n,k :[ 1 , N ] . nk n k h h g i v e n t h a t n' \u00E2\u0080\u0094 n and n ' , \u00E2\u0080\u0094 n , . m n 1 k The f i r s t and second p r o p e r t i e s a r e r e q u i r e d f o r graph p r e s e r v a t i o n . The t h i r d p r o p e r t y s t a t e s t h a t i n a TPD-ARG the node s y n t a c t i c symbol ' s ' remains unchanged. T h i s i s o n l y p o s s i b l e i f the ARG node s y n t a c t i c symbols chosen a re of the ty p e t h a t i n d i c a t e the t o p o l o g i c a l p r o p e r t i e s of the image. T h i s i s t h e r e f o r e the c o n d i t i o n f o r the e x i s t e n c e of TPD-ARG. For the ARG d e s c r i p t i o n of t h i n n e d c h a r a c t e r images, the c r i t i c a l p o i n t s ( t o p o l o g i c a l p o i n t s ) d e f i n e d i n the l a s t c h a p t e r a r e used as the node s y n t a c t i c symbols. In the d e f o r m a t i o n s above we have assumed t h a t the nodes a r e deformed i n d e p e n d e n t l y of each o t h e r . T h i s same assumption w i l l not be 68 p r a c t i c a l f o r branch a t t r i b u t e s because the branches are c o n s t r a i n e d a t t h e i r ends by nodes. The d e f o r m a t i o n s of the branches or r e l a t i o n a l a t t r i b u t e s can o n l y be d e f i n e d i f the d e f o r m a t i o n of t h e i r end nodes a r e known. Hence t h e c o n d i t i o n s h h n' \u00E2\u0080\u0094 \u00C2\u00BB . n and n' \u00E2\u0080\u0094T-*- n i n (4) above. T h i s c o n d i t i o n i s m n 1 k not r e s t r i c t e d t o TPD-ARGs but must a p p l y t o a l l graph p r e s e r v i n g ARG d e f o r m a t i o n s . TPD-ARGs a r e of s p e c i a l i n t e r e s t i n c a s e s where a p r e c l a s s i f i e r i s used t o p e r f o r m a g l o b a l c l a s s i f i c a t i o n and s o r t i n p u t s i n t o groups of t o p o l o g i c a l l y e q u i v a l e n t images. Then the TPD-ARG model can be used t o c o n c e n t r a t e on the l o c a l or n o n t o p o l o g i c a l f e a t u r e s of the images i n each group and s y n t a c t i c a l l y d i s t i n g u i s h one image from the o t h e r . 2.3 D e f o r m a t i o n d i s t a n c e measures f o r ARG. S i m i l a r i t y ( o r d i s s i m i l a r i t y ) between two ARGs can be i n f e r r e d w i t h t h e used of some q u a n t i t a t i v e measures such as the p r o b a b i l i t y or d i s t a n c e measures. P r o b a b i l i t y measure o f t e n t a k e s the form of h y p o t h e s i s t e s t i n g , such as the maximum l i k e l i h o o d c r i t e r i a or the B a y e s i a n c o n d i t i o n a l p r o b a b i l i t y . A l t h o u g h the s t a t i s t i c a l t h e o r y i s r i c h w i t h r e s u l t s i n p r o b a b i l i t y a n a l y s i s , t hey a r e based on the ass u m p t i o n t h a t the u n d e r l y i n g b e h a v i o u r i n the d i s t r i b u t i o n of t h e i n p u t s can be e s t i m a t e d or m o d e l l e d . For the case of u n c o n s t r a i n e d h a n d w r i t t e n c h a r a c t e r s i t i s e x t r e m e l y d i f f i c u l t t o i n f e r t h i s d e f o r m a t i o n p r o b a b i l i t y r e l i a b l y from the samples, t h e r e f o r e o t h e r measures a r e p r e f e r r e d . 69 D i s t a n c e measures a r e d e f i n e d as the c o s t i n c u r r e d as a consequence of t r a n s f o r m i n g one ARG i n t o a n o t h e r . When used w i t h t h e s y n t a c t i c a p p r o a c h t o r e c o g n i t i o n t h i s measure i s e x t r e m e l y i n f o r m a t i v e and t h e e s s e n t i a l p a r t of a s u c c e s s f u l d e s i g n i s t o append t h e c o r r e c t p e n a l t y f o r each t r a n s f o r m a t i o n . The d e s i g n of t h i s c o s t f u n c t i o n f o r a s p e c i f i c a p p l i c a t i o n i s an a r e a of r e s e a r c h i n i t s own r i g h t . C o s t measures can range from s i m p l e v a l u e s f o r each type of d e f o r m a t i o n t o complex c o n s i d e r a t i o n s i n v o l v i n g the p s y c h o l o g i c a l a s p e c t s of human r e c o g n i t i o n of d i s t o r t e d images. For a g e n e r a l g r a p h p r e s e r v i n g d e f o r m a t i o n , the c a l c u l a t i o n of t h e d e f o r m a t i o n d i s t a n c e between G' and G where h G' * G i s d e f i n e d as f o l l o w s : d(G',G) = w,I d ( n \ ,n. ) + w 2Z d(b' . , b . \ t T , ,U ) i 1 1 j ] ] ml nk \u00E2\u0080\u00A2 \u00E2\u0080\u00A2\u00E2\u0080\u00A2 \u00E2\u0080\u00A2 \u00E2\u0080\u00A2 \u00E2\u0080\u00A2 (4\u00C2\u00AB2\u00C2\u00BB13) \u00E2\u0080\u00A2 where d ( n ' . ,n. ) i s t h e c o s t of o b t a i n i n g node l a b e l n'. from 1 1 i n. by h~ 1 l d(b* . ,b.\ U' , ,U , ) i s the c o s t of o b t a i n i n g branch 3 ] N ml nk l a b e l b' . from b. by /i\" 1 g i v e n t h a t U' , , the end 3 3 ml node p a i r of b'. i s o b t a i n e d from U , t h e end nodes 3 nk of b. by the same t r a n s f o r m a t i o n . 1 w1 and w 2 can be n o r m a l i z i n g c o n s t a n t s or w e i g h t s . 70 P r o p e r t i e s of d e f o r m a t i o n d i s t a n c e . 1. d(G',G) = d(G,G'), symmetry. 2. a. Node d e f o r m a t i o n d i s t a n c e i s composed of two components, the s y n t a c t i c and semantic d e f o r m a t i o n components. d ( n ' . ,n \u00C2\u00A3 ) = d ( s * i ,s. ) + d ( x V ) V i . b. Branch or r e l a t i o n a l d e f o r m a t i o n d i s t a n c e i s the d e f o r m a t i o n d i s t a n c e of i t s semantic v e c t o r y s u b j e c t e d t o the c o n d i t i o n t h a t t h e i r end nodes are t r a n s f o r m e d a c c o r d i n g l y . T h i s i s i n acc o r d a n c e t o the g e n e r a l p r o p e r t y (4) f o r h i n s e c t i o n 2.2. For conve n i e n c e we s h a l l r e f e r t o t h i s c o n d i t i o n as the f e a s i b i l i t y c o n d i t i o n . d ( b ' j ,bj ) = d{(y' j ,y^ ) \ f e a s i b i l i t y c o n d i t i o n } . 3. d(G',G) i s NOT a m e t r i c because of c o n d i t i o n (c) below. That i s g i v e n t h a t G,, G 2 and G 3 a r e t h r e e ARGs such t h a t h i fi2 G 2 > G, and G 3 \u00E2\u0080\u0094 * G 2, then (a) d(G,,G 2) \u00C2\u00A3 0, e q u a l i t y i f f G,= G 2. (b) d ( G 1 r G , ) = d ( G 2 , G 2 ) = d ( G 3 , G 3 ) = 0. (c) d(G 3,G,) ^ d ( G 2 , G 1 ) + d ( G 3 , G 2 ) . For a TPD-ARG, the s y n t a c t i c symbol remains unchanged, t h e r e f o r e d ( s ' j , s . )=0 and e q u a t i o n 4.2.1a s i m p l i f i e s t o d T (G',G) = w ^ d U ^ rac. ) + W j E d t t ^ ' j ,>>j ) \ f e a s i b i l i t y c o n d i t i o n } (4.2.1b). From e q u a t i o n s 4.2.1, r e c o g n i t i o n by ARG matching reduces t o the problem of f i n d i n g a match between the i n p u t and r e f e r e n c e ARGs t h a t w i l l produce the minimum d e f o r m a t i o n d i s t a n c e . 3. T r a n s f o r m a t i o n of c h a i n coded d i g r a p h t o ARG. B e f o r e the a n a l y t i c a l t e c h n i q u e s d e v e l o p e d f o r the ARGs i n s e c t i o n 2 can be a p p l i e d t o t h e t h i n n e d c h a r a c t e r images, a t r a n s f o r m a t i o n must be d e s i g n e d t o t r a n s f o r m the c h a i n coded d i g r a p h d e s c r i p t i o n of t h e images g i v e n i n the l a s t c h a p t e r t o t h e i r ARG d e s c r i p t i o n s . A l t h o u g h t h i s d e s i g n i s aimed a t d e s c r i b i n g c h a r a c t e r images, the concept can be a p p l i e d g e n e r a l l y t o any t h i n n e d image t h a t can be d e s c r i b e d g r a p h i c a l l y . The t r a n s f o r m a t i o n i s a r e w r i t i n g and r e f o r m a t t i n g p r o c e s s of t h e g r a p h i c a l d a t a t h a t r e p r e s e n t s the d i g r a p h . The main o b j e c t i v e i s the e x t r a c t i o n of l o c a l f e a t u r e s i n the image t h a t a r e u s e f u l f o r c l a s s i f i c a t i o n and r e j e c t i n g redundant or e x c e s s i n f o r m a t i o n . T h i s l o c a l f e a t u r e s e l e c t i o n s t a g e i s where the r e c o g n i t i o n machine examines the f i n e r d e t a i l s of the geometry of the images t h a t have been p r e - s o r t e d and does the f i n a l c l a s s i f i c a t i o n . S i n c e the t r a n s f o r m a t i o n o p e r a t e s on the g r a p h i c a l d a t a e x t r a c t e d from the image the p r o c e s s can be f a c i l i t a t e d by a w e l l d e s i g n e d d a t a s t r u c t u r e . U s i n g the l i n k e d l i s t r e p r e s e n t a t i o n f o r the c h a i n coded d i g r a p h t h a t i s g i v e n i n c h a p t e r I I I the mapping can be a c c o m p l i s h e d by r e w r i t i n g the da t a i n t h e node d a t a t a b l e s (NDTs) f o r each graph, the 72 e q u i v a l e n c e between t h e i r NDTs i s shown t a b l e I I I below. The r e s u l t of the t r a n s f o r m a t i o n i s a l i n k e d l i s t r e p r e s e n t a t i o n of an ARG C h a i n coded d i g r a p h NDT. ARG NDT. J u n c t i o n t y p e . \u00E2\u0080\u0094\u00C2\u00BB\u00E2\u0080\u00A2 Node s y n t a c t i c symbol. C o o r d i n a t e . \u00E2\u0080\u0094> Node semantic v e c t o r . P o i n t e r s & node no. \u00E2\u0080\u0094\u00C2\u00BB\u00E2\u0080\u00A2 Branch s y n t a c t i c symbol (denotes l i n k a g e o r d e r ) . M a i n - l i n k & s u b l i n k c h a i n \u00E2\u0080\u0094 * Branch semantic v e c t o r . codes. T a b l e I I I . E q u i v a l e n c e between c h a i n coded d i g r a p h and ARG NDTs. 3.1 R e w r i t i n g node p r i m i t i v e s . As i n d i c a t e d i n the p r e v i o u s s e c t i o n s , i n o r d e r t o use the TPD-ARG d e f o r m a t i o n model the node s y n t a c t i c symbols must be the node j u n c t i o n t y p e s ( c r i t i c a l p o i n t s ) , so no r e w r i t i n g i s r e q u i r e d . The node s y n t a c t i c symbols f o r the t h i n n e d c h a r a c t e r s a r e Ep, J 3 , J 4 , Sp and ' c l o s e d ' , c o r r e s p o n d i n g t o the j u n c t i o n t y p e s d e f i n e d i n the l a s t c h a p t e r . The c o o r d i n a t e s of a g i v e n node marks i t s p r e c i s e l o c a t i o n i n the d i s c r e t e f i e l d . For s i m p l i c i t y , we d i v i d e the image frame i n t o 73 9 e q u a l a r e a r e g i o n s as shown below. aa ba ca ab bb cb ac be cc T h i s e q u a l a r e a d i v i s i o n has been done a r b i t r a r i l y and more complex s p a t i a l d i v i s i o n can be used i f i t i s d e s i r e d depending on the c h a r a c t e r i s t i c s of t h e image. The node semantic v e c t o r i s d e f i n e d as a v a r i a b l e p a i r d e n o t i n g the l o c a t i o n of t h e node i n t h e image frame and i s a n o n t o p o l o g i c a l p r o p e r t y of the image. x {aa,ab,ac , ba,bb,be ,ca , c b , c c } . 3.2 R e w r i t i n g branch ( r e l a t i o n a l ) p r i m i t i v e s . Branch p r i m i t i v e t r a n s f o r m a t i o n i s more i n v o l v e d than node p r i m i t i v e t r a n s f o r m a t i o n because b r a n c h p r i m i t i v e s c o n t a i n t h e b u l k of the i n f o r m a t i o n on t h e l o c a l f e a t u r e s t h a t w i l l be used f o r f i n a l c l a s s i f i c a t i o n . T h i s i n f o r m a t i o n i s e x t r a c t e d e n t i r e l y from the c h a i n coded l i n k s of the d i g r a p h d e s c r i p t i o n . Branch p r i m i t i v e t r a n s f o r m a t i o n i s a c h i e v e d i n two p a r t s , the e x t r a c t i o n of the s y n t a c t i c symbol and the semantic v e c t o r . In the l i n k e d NDT l i s t r e p r e s e n t a t i o n , the branch s y n t a c t i c symbol can be r e a d i l y o b t a i n e d from the p o i n t e r s . 74 For c o n v e n i e n c e a new n o t a t i o n f o r the s y n t a c t i c symbol w i l l be i n t r o d u c e d . U s i n g the node numbers ( i n t e g e r s ) t o r e p r e s e n t node l a b e l s n^ , the s y n t a c t i c symbol f o r a branch between two nodes 1 and k where 1 and k a r e two s i n g l e d i g i t i n t e g e r s w i l l be denoted as U l k . The i n t e g e r s 1 and k a r e no l o n g e r used as s u b s c r i p t s and l , k : [ 1,8], That i s , not more than a maximun of e i g h t nodes a r e e x p e c t e d from t h e ARG d e s c r i p t i o n of a h a n d p r i n t e d c h a r a c t e r . Branch p r i m i t i v e s a r e now w r i t t e n a s : b. = (Ulk,;/. ). where U l k denotes the end nodes of the branch w i t h node 1 as the node of o r i g i n and node k the d e s t i n a t i o n node. The t r a n s f o r m a t i o n of the c h a i n coded l i n k s t o the semantic v e c t o r y i s an important one. Here the problem i s c o n c e r n e d w i t h t h e s e l e c t i o n of c u r v e f e a t u r e s as the components of the branch semantic v e c t o r must c o n t a i n i n f o r m a t i o n on the shape of the c u r v e t h a t forms the branch between t h e two nodes i n q u e s t i o n . A commonly used s o l u t i o n i s t o a n a l y s e t h e c h a i n codes and d e c l a r e the branch as h a v i n g one of a number of p r e d e f i n e d shapes. The d i f f i c u l t i e s e n c o u n t e r e d i n t h i s approach a r e two f o l d ; f i r s t l y , the d i f f i c u l t y i n d e t e r m i n i n g the t y p e s of shape t h a t s h o u l d be chosen f o r t h e g i v e n problem and s e c o n d l y the p r o c e s s of shape e x t r a c t i o n and i d e n t i f i c a t i o n from t h e image i s o f t e n time consuming. These two problems a r e not independent and i t i s w e l l known t h a t more complex shapes a r e c a p a b l e of more d e t a i l d e s c r i p t i o n but a r e a l s o more c o s t l y t o e x t r a c t . In f a c t the c u r v e f e a t u r e s e l e c t i o n problem can be approached from two r e l e v a n t p o i n t s of v i e w , a m a t h e m a t i c a l and p s y c h o l o g i c a l v i e w p o i n t . In t h i s d e s i g n we w i l l use th e s e two c o n s i d e r a t i o n s t o o b t a i n i n t u i t i v e l y the shape f e a t u r e s such t h a t t hey are b o t h w e l l d e f i n e d m a t h e m a t i c a l l y and a l s o e s s e n t i a l t o the g e n e r i c d e s c r i p t i o n of a l p h a n u m e r i c c h a r a c t e r s . T a k i n g t h i s approach, we d e f i n e the b r a n c h semantic v e c t o r v. f o r branch b. of l e n g t h m. a s : 3 I D y. = (L . ,0 1 . ,0 2 . ) (4.3.1 ). 3 3 3 3 3 where L_. denotes the l e n g t h a t t r i b u t e of the b r a n c h , denotes the c u r v a t u r e a t t r i b u t e of the b r a n c h . 3 0 1 . and 62 . a r e the Freeman's d i r e c t i o n s 1 d e n o t i n g t h e 3 3 b r a n c h e x i t d i r e c t i o n from the node of o r i g i n and e n t r y d i r e c t i o n a t the d e s t i n a t i o n node. 3.2.1 L e n g t h a t t r i b u t e (L) d e f i n i t i o n and e x t r a c t i o n . I f T i s the t o t a l number of p i x e l s i n the t h i n n e d image and m the l e n g t h of a b r a n c h , then t h e l e n g t h a t t r i b u t e of the branch i s d e f i n e d a s : 1Freeman's d i r e c t i o n s a r e i n t e g e r s d e n o t i n g the d i r e c t i o n s shown: 4 3 2 1 76 L = Sh i f m3T/lO. (4.3.2) . The symbols Sh, Me and Lg denotes th e t h r e e l e n g t h a t t r i b u t e s of the b ranch namely; s h o r t , medium l e n g t h and l o n g . These c a t e g o r i e s a r e d e c i d e d upon s o l e l y by the number of c h a i n code elements r e q u i r e d t o d e f i n e t h e branch and the t o t a l number of p i x e l s t h a t i s i n the image, t h e r e f o r e L i s independent of branch d i r e c t i o n . 3.2.2 C u r v a t u r e a t t r i b u t e (*) d e f i n i t i o n and e x t r a c t i o n . G i v e n t h a t {d 1,d 2,....d } i s the Freeman's c h a i n code f o r the b r a n c h , then we d e f i n e a t o t a l i n c r e m e n t a l c u r v a t u r e 4> a s : m-i Z 6. 0 , m> 1 . m= 1 . \u00E2\u0080\u00A2 \u00E2\u0080\u00A2\u00E2\u0080\u00A2\u00E2\u0080\u00A2\u00E2\u0080\u00A2 \u00E2\u0080\u00A2 \u00C2\u00BB(4\u00C2\u00BB3\u00C2\u00BB3) w i t h 6. the i n c r e m e n t a l c u r v a t u r e ( i n degrees) i n moving from one component of the code t o another a s : 6. = I 4 5 ( d i + 1 - d . ) , 4 5 ( d i + 1 - d . \" 8 ) , 45(8 - | d i + 1 \" * . | ) f -4 < ( d i + 1 - d . ) < 4. ( d i + 1 - d . ) > 4. ( d i + 1 - d i ) < -4 (4.3.4) The i n c r e m e n t a l a n g l e 6^ i s the a n g u l a r change i n s t e p s of 45\u00C2\u00B0 i n moving from one code of the branch t o the next w i t h the a n t i c l o c k w i s e r o t a t i o n t a k e n as the +ve d i r e c t i o n of a n g u l a r change. 5^ i s not d e f i n e d f o r ( d ^ + 1 - d j )=\u00C2\u00B14 because i t 77 cannot e x i s t in a proper c h a i n code for a b r a n c h . Assume tha t the Freeman's c h a i n code for d ^ _ 1 and d^ are as shown below, 3 4 n ! 2 *; * l 7 then the next code d ^ + 1 can take any v a l u e s denoted by the d o t t e d arrows except where ( d ^ + 1 - d^ ) = \u00C2\u00B1 4 i f the c h a i n code i s not to b a c k t r a c k on i t s e l f . T h e r e f o r e in a proper c h a i n code (d \u00C2\u00A3 + 1 - d^ ) = \u00C2\u00B1 4 does not e x i s t and 6^ i s bounded i n the i n t e r v a l - 1 8 0 \u00C2\u00B0 < 8 i < + l 8 0 \u00C2\u00B0 . The branch c u r v a t u r e a t t r i b u t e * i s d e f i n e d as one of the f i v e d i f f e r e n t curve shapes d e f i n e d f o r f i v e d i f f e r e n t types of t o t a l i n c r e m e n t a l c u r v a t u r e s t h a t are c o n s i d e r e d e s s e n t i a l f o r the d e s c r i p t i o n of c h a r a c t e r shapes . These f i v e c u r v a t u r e types are d e s i g n a t e d C 1 f C 2 , C 3 , C t t and C 5 where * = (c, f or - 4 5 \u00C2\u00B0 < * ^ 4 5 \u00C2\u00B0 . C 2 f o r 4 6 \u00C2\u00B0 < * < 9 0 \u00C2\u00B0 or - 4 6 \u00C2\u00B0 < * < - 9 0 \u00C2\u00B0 . < C 3 f o r 9 1 \u00C2\u00B0 < $ < 2 7 0 \u00C2\u00B0 or -91 \u00C2\u00B0 < 4 > < - 2 7 0 \u00C2\u00B0 . C , f o r $ > 2 7 0 \u00C2\u00B0 or * < - 2 7 0 \u00C2\u00B0 . C\u00C2\u00AB * (4 3 5) * C 5 d e f i n e s a s p e c i a l shape of the form ' / V \" \ ' tha t i s o f t e n present i n c h a r a c t e r s B , M and W. A curve i s d e c l a r e d a C 5 i f the t o t a l i n c r e m e n t a l c u r v a t u r e $ i s \u00C2\u00A3 9 0 \u00C2\u00B0 and i n moving from one node of the branch to the o t h e r , $ f i r s t reaches a v a l u e of \u00C2\u00A3 1 3 5 \u00C2\u00B0 then \u00C2\u00A3 4 5 \u00C2\u00B0 be fore t a k i n g a f i n a l v a l u e of >90\u00C2\u00B0. By d e f i n i t o n C,, C 2, C 3 f and C\u00E2\u0080\u009E a r e symmetric w h i l e $ i s a n t i s y m m e t r i c w i t h r e s p e c t t o branch d i r e c t i o n . That i s , i f A and B are two end nodes of the branch then the $ o b t a i n e d from the c h a i n code e x t r a c t e d w h i l e moving from A t o B and the $ o b t a i n e d from the c h a i n code e x t r a c t e d by moving from B t o A ( r e v e r s e c h a i n codes) w i l l o n l y d i f f e r i n s i g n , w h i l e the c u r v a t u r e a t t r i b u t e s t o C\u00C2\u00AB w i l l remain unchanged. For example, i f a branch h a v i n g node 1 as i t s node of o r i g i n and node 2 i t s d e s t i n a t i o n node and i t s c h a i n code g i v e n a s ; 87888123 then 4> = 45(- 1 +1+0 + 0+1 +1 +1 ) = 135\u00C2\u00B0. and * = C 3. R e v e r s i n g the r o l e of the node of o r i g i n and d e s t i n a t i o n the r e v e r s e d c h a i n c o d e 2 f o r the same branch i s : 76544434 w i t h $ = 45(-1-1-1+0+0-1+1) = -135\u00C2\u00B0. and * = C 3. T h i s p r o p e r t y i s i m p o r t a n t because c u r v a t u r e a t t r i b u t e s Ci t o Co i s independent of which end of the branch one b e g i n s i n e x t r a c t i n g i t s c h a i n codes. U n f o r t u n a t e l y C 5 do not have such a p r o p e r t y and a r e v e r s e c h a i n code have t o be g e n e r a t e d i n o r d e r t o t e s t f o r C 5. However t h i s need not be done f o r a l l 2The r e v e r s e c h a i n code {d' , ,d' 2,....d' } of { d 1 f d 2 f . . . . d } can be o b t a i n e d u s i n g the r e l a t i o n shown below: d' . = I (d, m-i + 1 + 4)Mod 8, (d, m-i + 1 + 4)Mod 8 > 0 . 8, o t h e r w i s e . branches because C 5 s are c h a r a c t e r i s e d by the f a c t that t h e i r f i n a l t o t a l i n c r e m e n t a l c u r v a t u r e i s > 9 0 \u00C2\u00B0 , so o n l y those branches tha t have t h i s c h a r a c t e r i s t i c s need to have t h e i r r e v e r s e c h a i n codes generated and checked for C 5 type of c u r v a t u r e . 3 . 2 . 3 D e f i n i t i o n and e x t r a c t i o n of 0 1 and Q2. Given tha t {d,,d 2,....d } i s the Freeman's c h a i n code for a branch whose node of o r i g i n i s node 1 and d e s t i n a t i o n node i s node 2, we d e f i n e i t s e x i t and e n t r y d i r e c t i o n s a s : For m\u00C2\u00A34 For m < 4 0 1 = d,. 62 = d (4. 3.6b) . m F o r branches whose l e n g t h i s g r e a t e r than 4, the average d i r e c t i o n o b t a i n e d from the two end codes are u s e d . T h i s w i l l g i v e a b e t t e r e s t i m a t e of the a c t u a l e x i t and e n t r y d i r e c t i o n s . N a t u r a l l y , 0 1 and 62 w i l l be a f f e c t e d by branch d i r e c t i o n r e v e r s a l , the s i t u a t i o n where the r o l e of the node of o r i g i n and node of d e s t i n a t i o n i s i n t e r c h a n g e d . L e t b , = ( U 1 2 , ( L , , 8 } ! , 6 2 ,) ) be the p r i m i t i v e for a branch whose node r = r(d,+ d 2 ) / 2 l , Id,- d 2| < 4. < ([(d,+ 62)/2\+ 4)Mod 8 , |d,- d2|> 4. 80 of o r i g n i s node 1 and d e s t i n a t i o n node i s node 2. b 2 = ( U 2 1 , ( L 2 , * 2 , 6 1 2 i 9 2 2 ) ) be the p r i m i t i v e f o r the branch formed by r e v e r s i n g the r o l e of the o r i g i n and d e s t i n a t i o n nodes. Then from s e c t i o n 3.2.2, L , = L 2 and \u00E2\u0080\u00A2 i = * 2 w i l l remain unchanged but the e x i t and e n t r y d i r e c t i o n s of the o r i g i n a l and r e v e r s e d branch w i l l be r e l a t e d by; 0 1 ( 0 2 ,+4)Mod 8, 8, \u00C2\u00BB 2 2 = [ ( 0 i 1+4)Mod 8, 1 8, (0 2!+4)Mod 8 > 0. o t h e r w i se. (0 1,+4)Mod 8 > 0. o t h e r w i se. \u00E2\u0080\u00A2 \u00E2\u0080\u00A2 \u00E2\u0080\u00A2 \u00E2\u0080\u00A2 \u00E2\u0080\u00A2 (4.3.7) E.g. For the c h a i n codes b, = 87888123, u s i n g e q u a t i o n s 4.3.6a we o b t a i n e d 0 1, = 8 and 6 2 , = 3. The c h a i n codes f o r the r e v e r s e branch i s b 2 = 76544434. The e x i t and e n t r y d i r e c t i o n f o r t h i s r e v e r s e branch can be c a l c u l a t e d i n two ways. (a) . U s i n g e q u a t i o n s 4.3.6a and branch b 2 ' s c h a i n codes we o b t a i n e d 0 1 2 = 7 and 6 2 2 = 4. (b) . U s i n g e q u a t i o n s 4.3.7 and the e x i t and e n t r y d i r e c t i o n s 0 1, and 0 2, of branch b, we o b t a i n e d 0 1 2 = (3 + 4)Mod 8 = 7 . and 0 2 = ( 8 + 4 ) M o d 8 = 4 . The e q u a t i o n i s e x t r e m e l y u s e f u l i n matching a branch of one ARG t o a branch of an o t h e r ARG whose branch a t t r i b u t e s had 81 been o b t a i n e d from the c h a i n code which i s t r a c k e d i n the r e v e r s e d i r e c t i o n . S i n c e the l e n g t h and c u r v a t u r e a t t r i b u t e s remain unchanged, matching can s t i l l p r o c e e d by u s i n g e q u a t i o n s 4.3.7 t o c o r r e c t the d i r e c t i o n codes of the r e v e r s e b r a n c h w i t h o u t r e s o r t i n g t o g e n e r a t i n g i t s r e v e r s e c h a i n c o d e s . B e s i d e s the c h a i n codes may not be a v a i l a b l e a f t e r the b r a n c h t r a n s f o r m a t i o n . In t h i s s e c t i o n the t e c h n i q u e f o r t r a n s f o r m i n g a c h a i n coded d i g r a p h t o an ARG has been d e v e l o p e d . The d e s i g n has been based m a i n l y on two i m p o r t a n t a s p e c t s . F i r s t l y , the a n a l y s i s a v o i d s u s i n g complex shape d e s c r i p t o r s ; i t doesn't become i n v o l v e d i n s t a t i s t i c a l f e a t u r e o p t i m i z a t i o n but t a k e s a s y n t a c t i c approach t o e x t r a c t f e a t u r e s t h a t have s t r o n g s y m b o l i c meanings. S e c o n d l y , t h e f e a t u r e s a r e d e f i n e d such t h a t they can be e x t r a c t e d e a s i l y from the e x i s t i n g d a t a . F e a t u r e s t h a t a r e i n v a r i a n t t o branch r e v e r s a l can h e l p reduce the amount of e x t r a c t i o n t i m e . B a s i c a l l y the t r a n s f o r m a t i o n t u r n s a d i g r a p h d e s c r i p t i o n of a d i s c r e t e image i n t o a more n a t u r a l d e s c r i p t i o n w i t h the node semantic v e c t o r s g i v i n g i n f o r m a t i o n on the l o c a t i o n of th e nodes i n the image and t h e branch a t t r i b u t e s t h e i r r e l a t i o n s h i p s . I n t h i s r e s p e c t we have o b t a i n e d s y m b o l i c a l l y a r i c h e r d e s c r i p t i o n of t h e c h a r a c t e r and so performs t h e f i n a l r e c o g n i t i o n based on t h i s d e s c r i p t i o n . The t y p e s of shape used i n t h e d e s c r i p t i o n can be d e r i v e d t h r o u g h p s y c h o l o g i c a l s t u d i e s on the human v i s u a l system [13] thus a d d i n g t o the d e s c r i p t i o n an a s p e c t which cannot be m o d e l l e d m a t h e m a t i c a l l y . As an i l l u s t r a t i o n of the a p p l i c a t i o n of the t h e o r i e s t h a t has been p r e s e n t e d as w e l l as an i n t r o d u c t i o n t o the next s e c t i o n , we c o n c l u d e t h i s s e c t i o n w i t h two examples. Example 1 shows the ARG d e s c r i p t i o n of a c h a r a c t e r from Munson's d a t a t h a t i s o b t a i n e d by t r a n s f o r m i n g from i t s c h a i n coded d i g r a p h and example 2 shows the c a l c u l a t i o n of the d i s t a n c e measure between two ARGs. Example 1 ; T r a n s f o r m a t i o n of the d i g r a p h r e p r e s e n t a t i o n of 'R' i n t o an ARG r e p r e s e n t a t i o n . Input Image. Digraph R e p r e s e n t a t i o n . t i i i t i . 1 1 . i . . i i . . t o\u00C2\u00AB (5,23) 7 i \u00E2\u0080\u00A2 556, m, \u00E2\u0080\u00A2 3. - 77766777. n, \u00E2\u0080\u00A2 8. 7 , - 1 1 1 2 1 22233445555, m, -7. \u00E2\u0080\u00A2 2, m, \u00E2\u0080\u00A2 1. It - 87777778, m, . 8. 7t - 323232332 1 , m, \u00E2\u0080\u00A2 10. t o t a l no. of p i x e l s T . 46. a, (12, 22) 16. Nodes: Branches: 1 - ( J 3 , b a ) , b , - ( U 1 2 , ( M e . C i , 5 , 6 ) ) 2 \u00C2\u00AB ( E p , b a > , b , \u00C2\u00AB ( U l 3 , ( M e , C i , 7 , 7 ) ) 3 \u00C2\u00AB ( J 3 , b b ) , b , \u00C2\u00AB ( U 3 l , ( L g , C 3 , 1 , 5 ) ) 4 - ( J 3 , b b ) , b , - \u00C2\u00AB ( U 4 3 , ( S h . d ,2 ,2 ) ) 5 \u00C2\u00AB ( E p , c c ) , b 5 \u00C2\u00AB ( U 4 5 , ( M e , C i , 8 , 8 ) ) 6 - ( E p , a c ) , b , \u00C2\u00AB ( U 6 4 , ( M e , C 2 , 3 , 2 ) ) Sample c a l c u l a t i o n s . u(a6) = Node 6 = ( s s , x 6 ) = ( E p , a c ) . where s y n t a c t i c symbol i s Ep and c o o r d i n a t e (5,23) maps i n t o s e c t o r a c . \u00C2\u00AB(7s> - b 6 = ( V6A,(L*,*$,0%S.02B > w i t h L 6 = Me s i n c e T/20 b, \u00E2\u0080\u00A2 (042,(Me,Ci,3,4)) 3 - (J3,bb) b, \u00E2\u0080\u00A2 (U23,(Me,CI,7,7)) 4 - (Bp.cb) b, \u00E2\u0080\u00A2 (U34,(Me.Ci,1.I)) 5 - (Ep.ac) b, > (D35,(Me,C1,6,6)) 6 \u00E2\u0080\u00A2 (Ep.cc) b ( \u00E2\u0080\u00A2 (U64,(Me,Ci,3,4>) ARG of (Ep, ba ) b - , \u00E2\u0080\u00A2 (C2';' ,(Me,C2,1,7 i i 2' \u00E2\u0080\u00A2 (J 3 , ba ) b ' i \u00E2\u0080\u00A2 (U4,2' ,(Me,C2,3,5)) 3' \u00E2\u0080\u00A2 (Ep,ac) b'. \u00E2\u0080\u00A2 (U4'6' ,(Me,C2,1,6)) Given that the tr a n s f o r m a t i o n * T i s such that the branch and node semantic vector components have the f o l l o w i n g deformation d i s t a n c e s : Por nodes: d(a,b)-3, d7. Por branches: 1. Length a t t r i b u t e s : - . d(Sh,Me)\u00C2\u00AB2, d(Me,Lg)-2, d(Sh,Lg)>B. 2. Curvature a t t r i b u t e s : -d(Ct,C2)-2, d(Cl,C3)-4, d(C1.C4)-16, d(C1,C5)-l6, d(C2,C3)>2. d(C2,C4)-8, d(C2,C5)\u00C2\u00BBB, d(C3,C4)-2, d(C3.C5)-B, d(C4.C5)-B. 3. 4\" and E x i t and entry d i r e c t i o n s have a di s t a n c e of 2 for every 45\u00C2\u00B0 of deformation. eg. d(l,2)\u00C2\u00AB2. d(i,3>\u00C2\u00BB4, d(l,4)-6 d<1.5>-8, d(l,6)\u00C2\u00AB6, d(l,7).4, d(l,8)-2, d(2,3)-2, d(2,4)-4 e t c . . \u00E2\u0080\u00A2,\u00E2\u0080\u00A21 and \u00C2\u00BB,\u00E2\u0080\u00A2!. D i s t a n c e c a l c u l a t i o n s : d(B,A) \u00C2\u00AB= Z (node d e f o r m a t i o n d i s t a n c e ) + Z (branch d e f o r m a t i o n d i s t a n c e ) = (0+0+0+0+3+7) + (8+4+0+2+4+6) = 34. e.g. d(node 6 ' ,node 6 ) \u00C2\u00BB d(c,c) + d ( a r c ) - 7 + 0 - 7. d ( b ' c , b 6 ) - d(Me,Me) \u00E2\u0080\u00A2 d(C2,C1) + d t * 1 , * 1 ' ) + d ( 0 2 , 0 2 ' ) . cont Note t h a t node 6 i s matched t o node 6' and node 4 t o node 4' so U64 and U 4 ' 6 ' d e s c r i b e a p a i r of matched branches b 6 and b 6 ' w i t h one b r a n c h t r a c k e d i n the r e v e r s e d i r e c t i o n w i t h r e s p e c t to t h e i r end nodes as i n d i c a t e d by t h e i r s y n t a c t i c symbols. In o r d e r t o match these two branches we have t o use e q u a t i o n 4.3.7 t o c o r r e c t 0 1 and 62 of any one of the branch b e f o r e m a t c h i n g . C o r r e c t i n g 0 1 and 82 of b 6 ' we r e w r i t e i t s branch p r i m i t i v e as b' 6 = (US' 4',(Me,C2,2,5)). T h e r e f o r e the branch d e f o r m a t i o n d i s t a n c e i s c a l c u l a t e d a s : d(Me,Me) = 0. d(C1,C2) = 2. d(3,2) = 2. d(4,5) = 2. T h e r e f o r e d ( b 6 , b ' 6 ) = 0+2+2+2 = 6. 86 4 . ARG M a t c h i n g . 4.1 Concept of r e f e r e n c e g u i d e d m a t c h i n g . As have been mentioned e a r l i e r , c o n v e n t i o n a l graph isomorphism belongs t o a c l a s s of NP-complete problems and the s o l u t i o n i s o b t a i n e d u s i n g an e x h a u s t i v e b l i n d s e a r c h . To a v o i d u s i n g such a time consuming s e a r c h p r o c e d u r e , a h e u r i s t i c ARG matching scheme i s d e s i g n e d by making use of the known i n f o r m a t i o n about the images t h a t a r e b e i n g matched. T h i s i n f o r m a t i o n i s a v a i l a b l e as a r e s u l t of p r e c l a s s i f i c a t i o n as w e l l as from the r e f e r e n c e ARG i t s e l f . S p e c i f i c a l l y , p r e c l a s s i f i c a t i o n d e t e r m i n e s the t y p e s of nodes and hence the s y n t a c t i c symbols of the nodes t h a t a r e p r e s e n t i n t h e image. T h e r e f o r e i t i s o n l y r e q u i r e d t o match the i n p u t ARG w i t h the r e f e r e n c e ARGs of the same group ( c o n s i s t i n g of images w i t h the same f i x e d number and type of no d e s ) . I n c h a p t e r I I I , i t i s shown t h a t not a l l images i n a g i v e n group a r e t o p o l o g i c a l l y e q u i v a l e n t . But by u s i n g a d i c t i o n a r y of r e f e r e n c e c h a r a c t e r ARGs f o r each group t h a t c o n s i s t s of ARGs f o r each type of t o p o l o g y t h a t a c h a r a c t e r i n the group can have, then t h e f i n a l r e c o g n i t i o n i n v o l v e s o n l y the matching of t o p o l o g i c a l l y e q u i v a l e n t images. That i s , the f i n a l r e c o g n i t i o n i n v o l v e s the matching of ARGs u s i n g the TPD-ARG model and t h e t r a n s f o r m a t i o n s d e v e l o p e d i n s e c t i o n 3. Another source of i n f o r m a t i o n t h a t can be used t o guide the m a t c h i n g procedure can be o b t a i n e d from t h e r e f e r e n c e ARG i t s e l f . By e x p r e s s i n g the r e f e r e n c e ARG as a d i r e c t e d graph, 87 the ARG can be t r a v e r s e d i n an o r d e r l y manner and matching between the i n p u t and the r e f e r e n c e can be g u i d e d a l o n g by the r e f e r e n c e ARG and a c c o m p l i s h e d i n two main s t e p s . 1. O b t a i n a b e s t match between the nodes of the i n p u t ARG and r e f e r e n c e ARG. M a t c h i n g w i l l p roceed i f and o n l y i f a match can be found f o r e v e r y node i n the r e f e r e n c e and i n p u t ARG. 2. P e r f o r m a depth f i r s t t r a v e r s a l of the r e f e r e n c e ARG. For each s t e p of t h i s t r a v e r s a l f i n d an e q u i v a l e n t s t e p i n the i n p u t ARG by c h e c k i n g the f e a s i b i l i t y of making such a s t e p between the p a i r ( s ) of nodes i n the i n p u t image t h a t has been matched t o the node p a i r i n the r e f e r e n c e ARG t h a t i s i n v o l v e d i n the s t e p . For each f e a s i b l e s t e p found i n the i n p u t ARG, c a l c u l a t e the d e f o r m a t i o n d i s t a n c e between the branch i n v o l v e d and the r e f e r e n c e branch t r a v e r s e d . The f e a s i b l e e q u i v a l e n t branch y i e l d i n g the minimum d i s t a n c e i s taken as the best matched bra n c h . A l t h o u g h s t e p s 1 and 2 shows o n l y the g e n e r a l concept of the r e f e r e n c e g u i d e d matching p r o c e d u r e i t s u f f i c e s i n showing the importance of the r o l e p l a y e d by the d a t a s t r u c t u r e i n the r e c o g n i t i o n a l g o r i t h m . The l i n k e d l i s t d a t a s t r u c t u r e d e s c r i b e d i n c h a p t e r I I I has e n a b l e d the c h a i n coded d i g r a p h t o be t r a n s f o r m e d i n t o a d i r e c t e d ARG by t r a n s f o r m i n g o n l y the c o n t e n t s of t h e NDTs w h i l e p r e s e r v i n g i t s l i s t s t r u c t u r e . T h i s makes i t easy f o r the matching a l g o r i t h m t o check t h e branches a t t a c h e d t o each node of t h e i n p u t image ARG by s i m p l y c h e c k i n g t h e c o n t e n t s of i t s NDT i n s t e a d of s c a n n i n g a l l the 88 branches and i d e n t i f y i n g t h e i r end nodes. S t e p 2 r e v e a l s t h a t the r e f e r e n c e g uided matching p r o c e d u r e r e q u i r e s the r e f e r e n c e ARG t o be a d i r e c t e d ARG. However, the l i n k e d l i s t r e p r e s e n t a t i o n of the d i r e c t e d ARG cannot be s t o r e d i n permanent memory as the p o i n t e r s w i l l become m e a n i n g l e s s and t h u s the d a t a s t r u c t u r e d e s t r o y e d . A s l i g h t m o d i f i c a t i o n has t o be made t o the r e f e r e n c e ARGs by r e p l a c i n g t h e i r p o i n t e r s by the node numbers of the nodes p o i n t e d by the p o i n t e r s . The r e f e r e n c e ARG can then be s t o r e d by s t o r i n g t h e i r m o d i f i e d NDTs. These NDTs ar e read back b e f o r e matching and t h e i r s t r u c t u r e s r e s t o r e d . Note t h a t the r e f e r e n c e ARGs i n each group have the same number of NDTs, t h e r e f o r e they can be c o n v e n i e n t l y s t o r e d i n a s e q u e n t i a l format i n the group d i c t i o n a r y w i t h the most f r e q u e n t l y o c c u r i n g c h a r a c t e r s i n the group p l a c e d i n f r o n t of the l i s t . T h i s h e l p s t o improve the average matching time because i f a p e r f e c t match i s found e a r l i e r than an i n p u t ARG do not have t o be matched w i t h t h e r e s t of the c h a r a c t e r s i n the d i c t i o n a r y . Another i m p o r t a n t p o i n t t o note here i s t h a t the r e f e r e n c e ARGs can be a c q u i r e d i n the same manner as any o t h e r i n p u t ARGs. T h e r e f o r e the same a l g o r i t h m can be used t o c r e a t e the d i c t i o n a r y or the r e c o g n i t i o n a l g o r i t h m can be made i n t o an i n t e l l i g e n t a l g o r i t h m t h a t i s c a p a b l e of l e a r n i n g new or s p e c i a l c h a r a c t e r s by a c t i v a t i n g a s p e c i a l r o u t i n e t h a t can p l a c e the new ARG i n t o the p r o p e r group d i c t i o n a r y . 89 4.2 D i s t a n c e m a t r i x and r e f e r e n c e g u i d e d i n e x a c t m a t c h i n g . The r e f e r e n c e g u i d e d matching of ARGs can be a c c o m p l i s h e d v e r y e f f i c i e n t l y by u s i n g an ARG d i s t a n c e m a t r i x (DM). C o n s i d e r a group of ARGs w i t h N nodes. We form a DM of s i z e NxN w i t h the rows r e p r e s e n t i n g the r e f e r e n c e nodes and columns r e p r e s e n t i n g the unknown nodes as shown below. Ref. nodes ( I ) unknown nodes ( J ) N x N The r e s u l t a n t d i s t a n c e between the unknown and the r e f e r e n c e ARGs can be c a l c u l a t e d w i t h the a i d of t h i s DM i n two s e p a r a t e s t e p s . 1. DM g e n e r a t i o n and f i l l i n g t h r o u g h node m a t c h i n g . 2. DM r e d u c t i o n t h r o u g h f e a s i b i l i t y t e s t and branch m a t c h i n g . U s i n g the DM, the complete ARG matching p r o c e d u r e can best be e x p l a i n e d t h r o u g h the f o r m a l p r e s e n t a t i o n of i t s a l g o r i t h m A3. 90 A l g o r i t h m A 3 : R e f e r e n c e Guided I n e x a c t M a t c h i n g . Input : L i n k e d l i s t of NDTs r e p r e s e n t i n g the d i r e c t e d r e f e r e n c e ARG and a l i n k e d l i s t of NDTs r e p r e s e n t i n g the ARG of i n p u t image. Output : T o t a l d e f o r m a t i o n d i s t a n c e between the Re f e r e n c e ARG and i n p u t ARG. Let ' I ' s r e p r e s e n t the node numbers of the r e f e r e n c e ARG and 'J's r e p r e s e n t the node numbers of the i n p u t (unknown) ARG each h a v i n g N nodes. 1 . I n i t i a l i z e DM of s i z e NxN t o z e r o ; d ( I n p u t ARG, Ref. ARG) := 0; 2. { s t e p s 2 t o 4 f i n d t he best match between the nodes of the i n p u t and r e f e r e n c e ARGs } For r e f . node I := 1 t o N Do For unknown node J := 1 t o N Do Begin I f node J s y n t a c t i c symbol = node I s y n t a c t i c symbol then c a l c u l a t e d ( n l f n j ) ; I f d(n f ,nj ) = 0 then DM (I , J ) := 1 e l s e i f d ( n x ,n, ) \u00C2\u00A3 t h r e s h o l d l 1 then DM(I,J) := 0 e l s e DM(I,J) := d ( n x , n 3 ) End; 3. F o r I := 1 t o N Do Begin keep the minimum non-zero e n t r y of each row and s e t the r e s t t o z e r o ; I f a row w i t h a l l z e r o e n t r i e s i s d e t e c t e d then goto s t e p 10 End; 4. For J := 1 t o N Do If column J has no non-zero e n t r y then Begin For I := 1 t o N Do Begin I f node J s y n t a c t i c symbol = node I s y n t a c t i c symbol then c a l c u l a t e d ( n I f n 3 ) ; I f d ( n x , n j ) = 0 then DM(I,J) := 1 e l s e i f d ( n i , n T ) \u00C2\u00A3 t h r e s h o l d l then DM(I,J) := 0 e l s e DM(I,J) := d ( n x , n 3 ) End; c o n t . 1 t h r e s h o l d l = node d e f o r m n a t i o n t h r e s h o l d above which we c o n s i d e r the d e f o r m a t i o n t o be unr e a s o n a b l e so the match i s not c o n s i d e r e d a p o s s i b l e match. 91 For J := 1 t o N Do Begin keep the minimum non-zero e n t r y of each column and s e t the r e s t t o z e r o ; I f a column w i t h a l l z e r o e n t r i e s i s d e t e c t e d then goto s t e p 10 End; End; 5. Ref. node I := r o o t node of d i r e c t e d Ref. ARG ; 6. { f e a s i b i l i t y check and branch matching } For J := 1 t o N Do Begin I f DM(I,J) > 0 then Repeat Le t I ' be an end node a s s o c i a t e d w i t h an o u t g o i n g branch from node I ; r e s e t b f l a g ; db := t h r e s h o l d 2 2 ; Begin For J ' := 1 t o N Do I f DM(I',J') > 0 then Begin I f a branch e x i s t s between nodes J J ' of the Unknown ARG { f e a s i b i l i t y s a t i s f i e d } then i f ( d ( b r a n c h J J ' , b r a n c h I I ' ) < t h r e s h o l d 2 and d ( b r a n c h J J ' , b r a n c h l I ' ) < bd) then Begin db := d ( b r a n c h J J ' , b r a n c h I I ' ) ; s e t b f l a g End; End; I f b f l a g s e t then DM(I,J) := DM(I,J) + db e l s e B e g in DM(I,J) := 0 { node p a i r I & J i s not a f e a s i b l e match so i s e l i m i n a t e d }; goto nn End; End; U n t i l a l l o u t g o i n g branches of Ref. node I have been t e s t e d and matched; nn : End; 7. check row I and keep the minimum non-zero e n t r y of the row and s e t the r e s t t o z e r o ; I f a l l z e r o s i n the row i s d e t e c t e d then goto s t e p 10; c o n t . 2 T h r e s h o l d 2 i s the branch d e f o r m a t i o n t h r e s h o l d above which we c o n s i d e r the d e f o r m a t i o n as u n r e a s o n a b l e and so the match i s not c o n s i d e r e d f e a s i b l e 8. I := next node of the depth f i r s t t r a v e r s a l of the Ref. ARG; 9. Repeat s t e p s 5 t o 8 u n t i l t r a v e r s a l of the Ref.ARG i s co m p l e t e d ; g o t o 11; 10. No match between the two ARGs i s p o s s i b l e ; g o t o l 2 ; 11. F o r I := 1 t o N Do Fo r J := 1 t o N Do d.(Input ARG, Ref. ARG) := d d n p u t ARG, Ref.ARG) + D M ( I , J ) ; 12. End. Remarks: In t h e d i s t a n c e m a t r i x , z e r o e n t r i e s a r e used t o i n d i c a t e 'no match' w h i l e '1's i n d i c a t e p e r f e c t l y matched nodes. S t e p s 2 and 3 i n d e n t i f i e s t h e i n p u t node(s) t h a t g i v e s the b e s t match f o r each r e f e r e n c e node. T h i s i s a row dominated node matching where p r i o r i t y i s g i v e n t o f i n d i n g a be s t match f o r each row ( r e f . node). As a r e s u l t i t i s p o s s i b l e t h a t a l t h o u g h e v e r y r e f e r e n c e node may have a b e s t match, t h e r e may be i n p u t nodes w h i c h a r e not matched t o any r e f e r e n c e node a t a l l . T h i s s i t u a t i o n shows up i n the DM as columns w i t h a l l z e r o e n t r i e s w h i l e e v e r y row has a t l e a s t one non-zero e n t r y . T h i s problem i s r e s o l v e d i n s t e p 4 which e n s u r e s t h a t a t t e m p t s a r e made t o f i n d a be s t match f o r a l l i n p u t nodes as w e l l . F o r two ARGs w i t h i d e a l l y matched nodes, t h e r e w i l l be a one t o one matching between the r e f e r e n c e and the i n p u t nodes. The i d e a l l y matched DM s h o u l d t h e r e f o r e have e x a c t l y one '1' 93 i n each row and column. For n o n - i d e a l but n e v e r t h e l e s s b e s t matched c a s e s , the b e s t matched nodes are d e s i g n a t e d by the c o r r e s p o n d i n g elements i n the DM t a k i n g the v a l u e s of the d e f o r m a t i o n d i s t a n c e s between the two nodes. In t h i s case i t i s p o s s i b l e t h a t t h e r e c o u l d be more than one minimum non-zero e n t r y i n a row or column. For the m a j o r i t y of such c a s e s these m u l t i p l e b e s t matches w i l l be e l i m i n a t e d a f t e r the f e a s i b i l i t y t e s t and branch matching i n s t e p s 5 t o 9. In the r a r e cases where t h e s e m u l t i p l e best matches s t i l l e x i s t a f t e r the complete ARG matching then they w i l l c o n t r i b u t e t o an i n c r e a s e i n the r e s u l t a n t d e f o r m a t i o n d i s t a n c e . T h e r e f o r e ' i n e x a c t ' matchings y i e l d a more c o n s e r v a t i v e measure of the d e f o r m a t i o n d i s t a n c e . 4.2.1 C o m p u t a t i o n a l c o m p l e x i t y . The c o m p u t a t i o n a l c o m p l e x i t y f o r the ARG matching c o m p r i s e s of the time r e q u i r e d t o match the nodes and the time r e q u i r e d t o make a f e a s i b i l i t y t e s t and branch matching. Suppose t h e matching a l g o r i t h m i s used t o match an i n p u t ARG of N nodes w i t h a r e f e r e n c e of M nodes. The f i r s t p a r t of the matching p r o c e s s c o n s i s t s of f i n d i n g the b e s t match f o r the nodes. L e t c, be the time r e q u i r e d t o match one node. Then t o f i n d the b e s t match f o r a l l the r e f e r e n c e nodes t a k e s c,MN t i m e . In o r d e r t o ensure t h a t a l l t h e i n p u t nodes g e t s a b e s t match ( s t e p 4) r e q u i r e s i n the worst case another c,MN t i m e , g i v i n g the t o t a l time r e q u i r e d f o r node matching as 2ciMN. 94 The second p a r t of the matching p r o c e s s i n v o l v e s the f e a s i b i l i t y t e s t and branch m a t c h i n g . In the r e f e r e n c e guided m a t c h i n g p r o c e s s , f o r each r e f e r e n c e branch t r a v e r s e d a f e a s i b i l i t y t e s t i s made and a branch d e f o r m a t i o n d i s t a n c e c a l c u l a t e d i f the match i s f e a s i b l e . The number of such t e s t s p e r f o rmed f o r each r e f e r e n c e branch depends on the number of i n p u t nodes t h a t a r e matched t o the r e f e r e n c e node p a i r i n v o l v e d . In terms of the DM, t h e number of t e s t s performed depends on t h e number of non-zero elements i n the two rows c o r r e s p o n d i n g t o the two r e f e r e n c e nodes i n v o l v e d . T h e r e f o r e t o o b t a i n an i n d i c a t i o n of the time c o m p l e x i t y , we can use a h y p o t h e t i c a l worst case where th e DM i s a f u l l m a t r i x of non-zero e l e m e n t s . ( T h i s s i t u a t i o n cannot o c c u r i n the DM f o r m a t c h i n g the ARGs of c h a r a c t e r s because i t r e q u i r e s e v e r y node t o match each o t h e r ) . L e t c 2 be the time r e q u i r e t o p e r f o r m a f e a s i b i l i t y t e s t and a branch matching and k be the average number of o u t g o i n g branches f o r each r e f e r e n c e node. Suppose f o r each r e f e r e n c e node a f e a s i b i l i t y t e s t and branch matching i s done f o r each one of the k o u t g o i n g b r a n c h e s . T h i s w i l l t a k e c 2 * N time as each t e r m i n a l node of an o u t g o i n g r e f e r e n c e b r a n c h has N i n p u t nodes matched t o i t . S i n c e the r e f e r e n c e node i t s e l f has N i n p u t nodes matched t o i t then the time t a k e n t o c o m p l e t e l y check t h e f e a s i b i l i t y and match the o u t g o i n g branches from each r e f e r e n c e node i s c 2 * N 2 . W i t h a r e f e r e n c e ARG of M nodes th e h y p o t h e t i c a l w orst c a s e c o m p u t a t i o n f o r the second p a r t of t h e m a t c h i n g p r o c e s s i s c 2*MN 2. Thus th e t o t a l worst c a s e r e f e r e n c e g u i d e d matching 95 time i s 2c,MN+c 2fcMN 2. From t h e h i g h e r c o m p l e x i t y of the b r a n c h a t t r i b u t e s compared t o t h e nodes a t t r i b u t e s i t i s o b v i o u s t h a t c 2 i s much g r e a t e r than c,. In the ARG r e p r e s e n t a t i o n of h a n d p r i n t e d c h a r a c t e r s t h e maximum number of branches a node can have i s d e f i n e d as 4, t h e r e f o r e k=2 i s a r e a s o n a b l e e s t i m a t e f o r the average number of o u t g o i n g branches per node. U s i n g t h i s a ssumption we can s i m p l i f y the worst case time r e q u i r e d f o r matching t o 2 C 2 M N ( N + 1 ) or a time c o m p l e x i t y of 0 ( M N ( N + 1 ) ) . For t o p o l o g i c a l l y e q u i v a l e n t images M=N, so the time c o m p l e x i t y becomes 0 ( N 2 ( N + 1 ) ) . T h i s t i m e c o m p l e x i t y i s e x t r e m e l y f a v o u r a b l e compared t o t h e s t a t e space approach f o r matching ARGs [61] which r e q u i r e s a t i t s b e s t 0(N*) time or the p o l y n o m i a l , f a c t o r i a l or even e x p o n e n t i a l time c o m p l e x i t i e s f o r o t h e r c o n v e n t i o n a l graph isomorphisms [ 6 2 ] . 5. F i n a l r e c o g n i z e r i m p l e m e n t a t i o n and performance. 5.1 F i n a l r e c o g n i z e r i m p l e m e n t a t i o n . The d i s c u s s i o n on the ARG matching g i v e n above com p l e t e s t h e p r e s e n t a t i o n of the d e s i g n f o r t h e t h r e e main s t a g e s of t h e f i n a l r e c o g n i z e r as d e p i c t e d i n f i g u r e 1.2. In the i m p l e m e n t a t i o n of the r e c o g n i z e r the a l g o r i t h m s A1, A2 and A3 form the b a s i c t h r e e s t a g e s of t h e r e c o g n i t i o n p r o c e s s . As t h e s e p r o c e s s e s have been p r e s e n t e d i n d e t a i l i n t h e p r e v i o u s s e c t i o n s what remain t o be d i s c u s s e d i n the f i n a l i m p l e m e n t a t i o n a r e the f o r m a t i o n of the group d i c t i o n a r i e s and 96 the d e r i v a t i o n of the d e f o r m a t i o n t r a n s f o r m a t i o n h T Group d i c t i o n a r i e s f o r the r e c o g n i z e r a r e formed by ex a m i n i n g 1000 samples from Munson's d a t a . These c h a r a c t e r images were t h i n n e d and a f t e r p r e c l a s s i f i c a t i o n the r e s u l t i n g c h a i n coded r e p r e s e n t a t i o n of the images a r e t r a n s f o r m e d i n t o t h e i r ARG d e s c r i p t i o n s u s i n g the t r a n s f o r m a t i o n g i v e n i n s e c t i o n 3. The c h a r a c t e r s i n each group a r e examined and the t o p o l o g i e s of each c h a r a c t e r i n the group i d e n t i f i e d . T a b l e IV shows the number of t o p o l o g i e s each c h a r a c t e r i n the group i s observ e d t o have and the t o t a l number of r e f e r e n c e ARGs r e q u i r e d i n each group d i c t i o n a r y . I d e a l l y , the number of r e f e r e n c e c h a r a c t e r ARGs i n each group s h o u l d e q u a l t o t h e sum of the t o t a l number of t o p o l o g i e s of each c h a r a c t e r i n the group. In t a b l e IV t h i s i s not the case because a c h a r a c t e r h a v i n g a s i n g l e t o p o l o g y may appear t o be f a i r l y d i f f e r e n t v i s u a l l y . T h i s i s i l l u s t r a t e d i n f i g u r e s 4.2a and b below. (a) (b) F i g u r e 4.2. D i f f e r e n t forms of a s i n g l e c h a r a c t e r h a v i n g the same t o p o l o g y . 97 These d i f f e r e n t forms a r e taken i n t o c o n s i d e r a t i o n by the ARG i n i t s node semantic v e c t o r which i n d i c a t e s the p o s i t i o n of the nodes. The changes i n the node p o s i t i o n of t h e c h a r a c t e r s i n t h e s e c a s e s a r e not due t o n o i s e or d e f o r m a t i o n s but are d e l i b e r a t e as a r e s u l t of d i f f e r e n t w r i t i n g s t y l e s . For the r e c o g n i t i o n of u n c o n s t r a i n e d h a n d p r i n t e d c h a r a c t e r s , the group d i c t i o n a r y s h o u l d i n c l u d e d c h a r a c t e r s w i t h t h e s e d e l i b e r a t e s h i f t s i n node p o s i t i o n s . O t h e r w i s e the matching w i l l r e s u l t i n an u n n e c e s s a r y p e n a l t y on t h e s e images which a r e n o r m a l l y a c c e p t a b l e . By t a k i n g t h i s i n t o c o n s i d e r a t i o n we o b t a i n e d a t o t a l o f 231 r e f e r e n c e c h a r a c t e r ARGs a r r a n g e d i n t o the d i f f e r e n t group d i c t i o n a r i e s as shown i n t a b l e IV. The b l o c k diagram of t h i s f i n a l r e c o g n i z e r i s shown i n s o l i d l i n e s i n f i g u r e 4.3. The f i n a l r e c o g n i z e r uses the same d e f o r m a t i o n t r a n s f o r m a t i o n h as t h a t g i v e n i n example 2. T h i s t r a n s f o r m a t i o n i s o b t a i n e d i n t u i t i v e l y t h r o u g h the o b s e r v a t i o n of the samples t h a t were used i n d e r i v i n g the d i c t i o n a r y . As such, t h e d i s t a n c e s appended t o the d i f f e r e n t f e a t u r e d e f o r m a t i o n s a r e not n e c e s s a r i l y optimum. The optimun d e f o r m a t i o n t r a n s f o r m a t i o n s h o u l d be o b t a i n e d t h r o u g h e x p e r i m e n t a l s t u d i e s where d i f f e r e n t f e a t u r e s a r e s y s t e m a t i c a l l y deformed, and t h e s e v e r i t y (hence r e l a t i v e d i s t a n c e ) f o r each type of d e f o r m a t i o n i n f e r r e d from the r e l a t i v e d i f f i c u l t i e s f o r human s u b j e c t s t o r e c o g n i z e the r e s u l t a n t c h a r a c t e r s . T h i s type of a n a l y s i s i s h i g h l y i n v o l v e d and i s not performed i n t h i s r e s e a r c h . For t h i s e x p e r i m e n t , 98 t h e h e u r i s t i c a l l y d e r i v e d t r a n s f o r m a t i o n of example 2 i s an adequate e s t i m a t e f o r h and t h i s i s c o n f i r m e d by the performance r e s u l t s g i v e n below. 5.2 Performance w i t h Munson's c h a r a c t e r d a t a . The matching a l g o r i t h m i s implemented i n P a s c a l on the PDP 11/23 minicomputer and the Vax 11/750 r u n n i n g i n the PDP c o m p a c t i b i l i t y mode. 1511 samples from Munson's da t a a r e used as i n p u t s t o the r e c o g n i z e r u s i n g the same d e f o r m a t i o n t r a n s f o r m a t i o n h t h a t i s g i v e n i n example 2. 1382 of thes e i n p u t images were c o r r e c t l y i d e n t i f i e d g i v i n g an o v e r a l l r e c o g n i t i o n r a t e of 9 1 . 4 6 % . T h i s r e c o g n i t i o n r a t e i s the d i r e c t r e c o g n i t i o n r a t e w i t h o u t s u b s t i t u t i o n s . There was no need f o r s u b s t i t u t i o n s i n t h i s c a s e because 97% of the f a i l u r e s were due t o m i s r e c o g n i t i o n and not due t o f a i l u r e on the p a r t of the r e c o g n i z e r t o make an i d e n t i f i c a t i o n . The low pe r c e n t a g e of u n i d e n t i f i a b l e images i m p l i e s t h a t the t h i n n i n g , g l o b a l f e a t u r e d e t e c t i o n and matching p r o c e d u r e s have performed e x c e e d i n g l y w e l l . T h i s i s because i f t h i n n i n g has not been a b l e t o g i v e o u t p u t s w i t h t h e d e s i r e d f e a t u r e s or the g l o b a l f e a t u r e d e t e c t i o n , e x t r a c t i o n and p r e c l a s s i f i c a t i o n p r o c e d u r e s cannot s u c c e s s f u l l y p r o c e s s a l l the p o s s i b l e t o p o l o g i e s , then the r e c o g n i t i o n p r o c e s s would have f a i l e d a t th e p r e c l a s s i f i c a t i o n s tage r e s u l t i n g i n a h i g h e r p e r c e n t a g e of u n i d e n t i f i a b l e c h a r a c t e r s . L i k e w i s e the f a i l u r e of the matc h i n g p r o c e d u r e t o match a l l t h e images w i t h the r e f e r e n c e c h a r a c t e r s would have i n c r e a s e d the p e r c e n t a g e of u n i d e n t i f i a b l e c h a r a c t e r s . L i k e w i s e t h e f a i l u r e o f the 99 m atching p r o c e d u r e t o match a l l t h e images w i t h the r e f e r e n c e c h a r a c t e r s would have i n c r e a s e d t h e p e r c e n t a g e of u n i d e n t i f i a b l e c h a r a c t e r s . T h e r e f o r e the f i r s t c o n c l u s i o n t h a t can be drawn from the r e s u l t i s t h a t the experiment has c o n f i r m e d t h a t the r e c o g n i z e r can p e r f o r m as d e s i g n e d over the wide range of e x p e c t e d i n p u t images as r e p r e s e n t e d by Munson's d a t a . The breakdown of the r e c o g n i t i o n r a t e s f o r the i n d i v i d u a l c h a r a c t e r s a r e g i v e n i n t a b l e V, which shows t h a t the most d i f f i c u l t c h a r a c t e r s t o i d e n t i f y c o r r e c t l y a r e the U's and V s w i t h a r e c o g n i t i o n r a t e of 77.3% and 80% r e s p e c t i v e l y . T h i s i s not s u r p r i s i n g c o n s i d e r i n g t h a t t h e s e two c h a r a c t e r s e x i b i t a h i g h degree of a m b i g u i t y e s p e c i a l l y f o r t h e U's t h a t a r e w r i t t e n w i t h o u t a ' t a i l ' ( U- ). The low r e c o g n i t i o n r a t e s between t h e s e two c h a r a c t e r s have been i n v e s t i g a t e d by Suen and S h i l l m a n [ 1 4 ] . T h e i r e xperiment had shown t h a t human r e c o g n i t i o n r a t e s f o r thes e two c h a r a c t e r s a r e o n l y 86.8% and 95.9% r e s p e c t i v e l y . In t h i s e x p e r i m e n t , o t h e r p o o r l y r e c o g n i z e d c h a r a c t e r s a r e M, N, and G where a h i g h degree of a m b i g u i t y e x i s t between t h e s e c h a r a c t e r s and H, W and C r e s p e c t i v e l y . Examples of some of t h e s e ambiguous c h a r a c t e r s a r e shown i n f i g u r e 4.4. The pr e s e n c e of ambiguously shaped c h a r a c t e r s i n d i c a t e s t h a t i n t h e c o n t e x t f r e e r e c o g n i t i o n of i s o l a t e d u n c o n s t r a i n e d h a n d p r i n t e d a l p h a n u m e r i c c h a r a c t e r s t h e r e i s an upper l i m i t t o t h e r e c o g n i t i o n r a t e because the c h a r a c t e r shapes o v e r l a p and c r e a t e a m b i g u i t i e s which cannot be r e s o l v e d based on the e x a m i n a t i o n of the s i n g l e c h a r a c t e r . 100 A m b i g u i t i e s of the s e n a t u r e have been r e s e a r c h e d by B l e s s e r et al [13] and f i g u r e 4.5 shows the a m b i g u i t y m a t r i x f o r h a n d p r i n t e d a lphanumeric c h a r a c t e r s as c o m p l i e d by B l e s s e r . In o r d e r t o a c h i e v e a h i g h r e c o g n i t i o n r a t e , f u t u r e r e s e a r c h has t o i n c l u d e c o n t e x t u a l i n f o r m a t i o n i n t o the r e c o g n i t i o n p r o c e s s or employ p s y c h o p h y s i c a l t e c h n i q u e s t o o b t a i n p s y c h o l o g i c a l l y based f e a t u r e s f o r d e s c r i b i n g c h a r a c t e r shapes. Suen [14] i l l u s t r a t e s t h i s p o i n t i n h i s r e p o r t where r e c o g n i t i o n r a t e s of over 94% f o r the U's and V s can be o b t a i n e d . In t h e d e s i g n of t h i s f i n a l r e c o g n i z e r , the components of the semantic ( f e a t u r e ) v e c t o r s x and y a r e d e r i v e d i n t u i t i v e l y and the c h a r a c t e r d e f o r m a t i o n t r a n s f o r m a t i o n h used i s a l s o T d e r i v e d h e u r i s t i c a l l y w i t h o u t any d e t a i l c o n s i d e r a t i o n on the s e v e r i t y of each d e f o r m a t i o n w i t h r e s p e c t t o i t s r e c o g n i t i o n . That i s , t h e way each t y p e of d e f o r m a t i o n a f f e c t s t h e r e c o g n i t i o n of the c h a r a c t e r . F u r t h e r more, the w e i g h t e d d i s t a n c e measure i s p o o r l y u t i l i z e d when w1 and w2 a r e taken as 1. These parameters s h o u l d be c a r e f u l l y o b t a i n e d u s i n g a r e l i a b l e s e t of sample c h a r a c t e r s i n the d e s i g n of a p r a c t i c a l c h a r a c t e r r e c o g n i z e r . T a k i n g t h e s e f a c t o r s i n t o c o n s i d e r a t i o n , the r e c o g n i t i o n r a t e of 91.46% i s ind e e d h i g h 3 and i t s u f f i c e s i n c o n f i r m i n g the m e r i t of t h i s d e s i g n approach t o u n c o n s t r a i n e d h a n d p r i n t e d a l p h a n u m e r i c c h a r a c t e r r e c o g n i t i o n . 3Compared t o Munson's e x p e r i m e n t a l r e s u l t of 85% [ 3 ] , o b t a i n e d by u s i n g edge masks t o d e t e c t shape f e a t u r e s and c l a s s i f i e d on the b a s i s of the r e s u l t a n t f e a t u r e v e c t o r s o b t a i n e d . 101 T a b l e IV. Table showing the number of t o p o l o g i e s f o r each image i n a g i v e n p r e c l a s s i f i e d group and the d i c t i o n a r y s i z e of each group. GROUP CHARACTERS T C . TD. I 0(1 1 0 II 0(1 >,B(2) ) , G ( 1 ) , 0 ( 1 ) , P ( 1 ) , Q ( 1 ) , S ( 1 ) 2 3 III D(1 6 1 1 IV Q(1 1 0 V Q(1 1 0 VI B(1 1 0 VII B( 1 ) , 0 (1 ) ,Q(1 ) 3 7 IIX B( 1 0(1 ) ,C(1 ) , D ( 1 ) , G ( 1 ) , J ( 1 ) , L ( 1 ) , M ( 1 ) ,N( 1 ) ) , P ( 1 ) , R ( 1 ) , S ( 1 ) , U ( 1 ) , V ( 1 ) , W ( 1 ) , Z ( 1 ) 16 32 IX R(1 1 0 X Q(1 1 0 XI P(1 ) ,Q(2 ) ,R(2 ) 3 8 XII A(1 ) , B ( 1 ) ,D ( 1 ) , G ( 1 ) , P ( 1 ) , Q ( 1 ) , R ( 1 ) , J ( 1 ) 8 24 XIII B(1 1 0 XIV B(1 J(1 T(1 ) , C ( 1 ) ,D ( 1 ) , E ( 1 ) , F ( 1 ) , G ( 1 ) , H ( 1 ) , 1 ( 1 ) ) , L ( 1 ) ,M ( 1 ) , N ( 1 ) , P ( 1 ) , Q ( 1 ) , R ( 1 ) , S ( 1 ) ) , U ( l ) , V ( l ) , W ( l ) , y ( l ) , Z ( l ) 22 58 XV A(1 1 0 XVI A(1 ) , B ( 1 ) , G ( 1 ) , Q ( 1 ) , R ( 1 ) ) , J ( 1 ) , T ( 1 ) 5 8 XVII G(1 3 3 XIIX Q d ) ,X(1) 2 2 XIX K(1 1 0 XX K(1 ) ,X(1) 2 7 XXI B(1 M(1 ) , E ( 1 ) , F ( l ) , G ( l ) , H ( l ) , I ( 1 ) , J ( 1 ) , K ( 1 ) ) , N ( 1 ) , P ( 1 ) , R ( 1 ) , T ( 1 ) , W ( 1 ) , X ( 1 ) , Z ( 1 ) 16 52 XXII A(1 1 0 XXIII A(1 1 0 XXIV H(1 1 0 XXV A(1 ) , E ( 1 ) , H ( 1 ) , M ( 1 ) , N ( 1 ) , W ( 1 ) , X ( 1 ) , Z ( 1 ) e 16 R e m a r k s : T C \u00C2\u00BB T o t a l n u m b e r o f d i f f e r e n t c h a r a c t e r s i n t h e g r o u p . T D \u00E2\u0080\u00A2 T o t a l n u m b e r o f r e f e r e n c e c h a r a c t e r s f o r t h e g r o u p . N u m b e r o f t o p o l o g i e s o b s e r v e d f o r e a c h c h a r a c t e r i s g i v e n i n b r a c k e t s b e s i d e e a c h c h a r a c t e r . T a b l e V. Table of r e c o g n i t i o n r a t e s f o r d i f f e r e n t c h a r a c t e r s . A - 93.75% F - 96.88% K - 90 .91% P - 96.83% u - 77.27% Z - 90.16% B - 90.57% G - 88 .10% L - 94.44% Q - BB.09% V - 80.00% c - 95.24% H - 92.31% M - 84.21% R - 92.59% W - 92 .10% D - 92.31% 1 - 93.75% N - 87.72% s - 95.65% X - 90 .91% E - 93 .10% J - 90 .91% 0 - 90.00% T - 97.37% y - 89.33% cha * n Digi t ized Input Image 1>-V Preprocessor and SegmentatIon i i B1 nary Input Image Global feature detect and Image E x t rac t(on digraph Th inn i ng Prun1ng Preclass-if teat Ion ARG Trans-forms t t on. Pruning Parameter ARG ARG Matching. 0 ictlonary setup Group Diet ionarles Control Block 1 Variable weights deformat ton threshoIds Ex ternaI inputs U n i d e n t i f i a b l e character Character i d e n t i t y F i g . 4.3 Bl o c k diagram showing the f i n a l i m p l e m e n t a t i o n of the r e c o g n i z e r and p o t e n t i a l f u t u r e developments. o 1 03 i i i i l i i i i i i i i i 1 i i i P < D ) H I H ) D ( O ) 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 ( D ) t 1 1 1 1 1 1 1 1 1 1 1 U ( V ) 1 1 1 1 1 1 1 1 1 1 1 1 1 1 K ( I ) F i g . 4.4 Examples of some c h a r a c t e r s t h a t were m i s r e c o g n i z e d . Remarks: The i n c o r r e c t i d e n t i f i c a t i o n of each c h a r a c t e r i s g i v e n i n b r a c k e t s . 104 A B C D E F 6 H 1 J K L M N 0 p Q R s T U V w X Y z A A k \u00C2\u00A3 e K r. A\ H \u00E2\u0080\u00A2 n R V B f) B R D B E H M 6 B 0 R S 2 C R C C E c r r C I c c C c L O 0 6 0 C 0 E p 0 D 0 D D D E B E E E F. & r I tr- li \u00E2\u0080\u00A2 F c r <\u00E2\u0080\u00A2 F A C 0 F F X F: i: c F r * /-6 B r , & G ft O P o Q S o 0 H H H H H u H H W u \l w V 1 r r i t: I. I X JL I Z J j : J < 0 a J r J 7 1 K H c p: & H C < K K w K T 1/ Y w Y L \u00C2\u00A3 li i: 6 u L L L L L M n H K M N ft M Y N H H W N N V A/ V 0 \u00E2\u0080\u00A2 0 c 0 n o O a 0 D a P y O P /\u00C2\u00BB B C D P F P (0 0 P 0 R ? T 0 n 0 c 0 O a Q 0 0 Q 9 u \J R R R D Q H k ft N P R Q R H V V S S c S I s <>' $ s T r r T T T T L T V T -V T U o t> o u J u L U V) 0 u u u V V V C U J Y U V li \j V V Y V V w M W ~> o u V w V X K M T * K Y i 1 \ V Y V X X Y e V I 7 r > s V T V V X Y z 2 z 1 L 1s V w 1 2 F i g . 4.5 M a t r i x showing a m b i g u i t i e s and o v e r l a p s i n the shapes of c h a r a c t e r s (from [ 1 3 ] ) . 105 CHAPTER V CONCLUSION AND FUTURE DEVELOPMENTS. In t h i s t h e s i s , the d e s i g n of a c h a r a c t e r r e c o g n i z e r f o r u n c o n s t r a i n e d h a n d p r i n t e d alphanumeric c h a r a c t e r s i s p r e s e n t e d . The r e s u l t a n t r e c o g n i z e r as g i v e n i n the b l o c k diagram of f i g u r e 4.3 e x h i b i t s the f o l l o w i n g c h a r a c t e r i s t i c s : E f f i c i e n t d a t a r e d u c t i o n by t h i n n i n g . The t h i n n i n g p r o c e d u r e r e s u l t s i n images w i t h w e l l p r e s e r v e d shapes and c o n t a i n f e a t u r e s e s s e n t i a l f o r a g r a p h i c a l r e p r e s e n t a t i o n of the images, a c o n v e n i e n t form f o r r i g o r o u s a n a l y s i s by d i g i t a l computers. E f f e c t i v e image e x t r a c t i o n and p r e c l a s s i f i c a t i o n based on image t o p o l o g y . T h i s p r e c l a s s i f i c a t i o n s t a g e a c h i e v e d two i m p o r t a n t r e s u l t s t h a t have e l u d e d o t h e r d e s i g n s ; ( i ) I t p r o v i d e s an e f f e c t i v e method f o r h a n d l i n g the wide range of e l a s t i c d e f o r m a t i o n s t h a t e x i s t i n c h a r a c t e r images and p e r m i t s the t o p o l o g y and geometry of the images t o be examined more e f f e c t i v e l y i n s e p a r a t e p r o c e d u r e s w i t h o u t i n t e r f e r e n c e . ( i i ) I t r e s u l t s i n a s u b s t a n t i a l r e d u c t i o n of the e n t r o p y of the i n p u t image and p r o v i d e s t h e n e c e s s a r y c o n d i t i o n s t h a t a r e e s s e n t i a l t o the d e s i g n of h i g h speed r e c o g n i t i o n a l g o r i t h m s . Use of ARG graph d e s c r i p t i o n t e c h n i q u e s i n c r e a s e s the d e s c r i p t i v e c a p a b i l i t y of the a l g o r i t h m s and e n a b l e s more complex shapes t o be p r o c e s s e d by the d i g i t a l computer. 1 E f f i c i e n t and f a s t matching t e c h n i q u e s f o r t o p o l o g i c a l l y e q u i v a l e n t graphs. Use of s i m p l e a r i t h m e t i c and l o g i c e x p r e s s i o n s f o r image p r o c e s s i n g t h a t can be implemented a t h i g h speed u s i n g V L S I . These a r e some of the c h a r a c t e r i s t i c s t h a t were demonstrated i n the c o u r s e of the d e s i g n and i n the l a s t c h a p t e r w i t h Munson's d a t a . In f a c t the d e s i g n e d r e c o g n i z e r has f a r more p o t e n t i a l than t h a t r e a l i z e d so f a r . The f u l l p o t e n t i a l of t h i s r e c o g n i z e r can o n l y be brought out through f u r t h e r r e s e a r c h i n t o the s p e c i f i c t y p e s of images t h a t a r e be r e c o g n i z e d so t h a t the o p t i m a l c h o i c e can be made f o r the l o c a l f e a t u r e a t t r i b u t e s , d e f o r m a t i o n t r a n s f o r m a t i o n s and w e i g h t s . T h i s p o i n t can b e s t be i l l u s t r a t e d by a d i s c u s s i o n on the p o t e n t i a l s f o r f u t u r e developments t h a t can be seen as a n a t u r a l e x t e n s i o n of t h i s d e s i g n . These a r e a s of developments a r e c h a r a c t e r segmentation and c o n t e x t u a l p r o c e s s i n g . A r e l i a b l e s e g m e n t a t i o n p r o c e d u r e w i l l have t o be a c l o s e d - l o o p p r o c e s s where the r e s u l t of each segmentation attempt can be f e d back and used t o improve the a c c u r a c y of the next a t t e m p t . T h i s i s the b a s i c r e q u i r e m e n t of r e c u r s i v e s e g m e n t a t i o n . In the d e s i g n e d r e c o g n i z e r , the i n f o r m a t i o n f o r feedback i s a v a i l a b l e from two s o u r c e s , the p r e c l a s s i f i e r and t h e o u t p u t from ARG matching ( f i n a l c l a s s i f i e r ) . S i n c e the most time consuming p r o c e s s i s t h e f i n a l c l a s s i f i e r , an i n p u t t h a t does not meet the t o p o l o g i c a l r e q u i r e m e n t s of known c h a r a c t e r s does not have t o go t h r o u g h the matching p r o c e d u r e . B e s i d e s t h i n n i n g and p r e c l a s s i f i c a t i o n can be performed a t h i g h speed w i t h the a i d of hardware, so t h i s d e s i g n w i l l u n d o u b t e d l y be a s u i t a b l e c h o i c e f o r use i n r e a d i n g machines t h a t u t i l i z e s r e c u r s i v e s e g m e n t a t i o n . The use of c o n t e x t i n p a t t e r n r e c o g n i t i o n can occur a t many d i f f e r e n t l e v e l s [ 2 6 ] , In s i n g l e c h a r a c t e r r e c o g n i t i o n the main use of c o n t e x t u a l i n f o r m a t i o n w i l l be t o t a c k l e the problem of d i s a m b i g u a t i o n and e r r o r c o r r e c t i o n . As mentioned p r e v i o u s l y , c o n t e x t u a l i n f o r m a t i o n can be o b t a i n e d and e x p r e s s e d e f f e c t i v e l y by s t a t i s t i c a l means. The use of ARG d e s c r i p t i o n f o r c h a r a c t e r images i n the d e s i g n a l l o w s one t o combine the s t a t i s t i c a l and s y n t a c t i c t e c h n i q u e s . For example, d e f o r m a t i o n of a p a r t i c u l a r f e a t u r e v e c t o r component (say c u r v a t u r e or l e n g t h ) may a f f e c t the r e c o g n i t i o n of some c h a r a c t e r s more than o t h e r s . T h i s d i f f e r e n c e i n s e n s i t i v i t y t o s p e c i f i c d e f o r m a t i o n s can be t a k e n i n t o c o n s i d e r a t i o n i n the d e s i g n by i n t r o d u c i n g w e i g h t s t o i n d i v i d u a l f e a t u r e v e c t o r components i n a d d i t i o n t o t h e node and branch w e i g h t i n g s . These w e i g h t s can be changed under program c o n t r o l so t h a t d i f f e r e n t w e i g h t s a r e used when an i n p u t i s matched w i t h d i f f e r e n t r e f e r e n c e c h a r a c t e r s . S i m i l a r l y , c o n t e x t u a l i n f o r m a t i o n can be used t o improve the r e c o g n i t i o n r a t e of a m biguously shaped c h a r a c t e r s . T h i s can be a c c o m p l i s h e d u s i n g dynamic w e i g h t s t o b i a s the d e f o r m a t i o n d i s t a n c e when matching w i t h d i f f e r e n t r e f e r e n c e c h a r a c t e r s . The w e i g h t s used w i l l be d e t e r m i n e d by the p r o b a b i l i t y of o b s e r v i n g a p a r t i c u l a r 108 c h a r a c t e r g i v e n t h a t i t i s p r e c e e d by c e r t a i n c h a r a c t e r ( s ) . Developments of the r e c o g n i z e r a l o n g t h e s e c o n c e p t s are i l l u s t r a t e d by the dashed l i n e s i n f i g u r e 4.3. T h e r e f o r e based on t h i s and p r e v i o u s d i s c u s s i o n s , we c o n c l u d e t h a t the d e s i g n e d r e c o g n i z e r has a d e q u a t e l y met the o b j e c t i v e s s e t i n c h a p t e r I . 109 R e f e r e n c e s . [ I ] C. Y. Suen, M. B e r t h o d and S. M o r i , \"Automatic r e c o g n i t i o n of h a n d p r i n t e d c h a r a c t e r s - The s t a t e of the a r t , \" P r o c . of the IEEE, V o l . 68, No.4, pp. 469-487, A p r i l 1980. [2] D.P. Himmel, \"Some r e a l w o r l d e x p e r i e n c e s w i t h h a n d p r i n t e d o p t i c a l c h a r a c t e r r e c o g n i t i o n , \" IEEE t r a n s , on SMC, V o l . SMC-8, No. 4, pp. 88-292, A p r i l 1978. [3] J . H. Munson, \"Experiments i n t h e r e c o g n i t i o n of h a n d p r i n t e d t e x t : P a r t I - C h a r a c t e r r e c o g n i t i o n , \" P r o c . F a l l J o i n t Computer Conf., V o l . 33, pp. 1 125-1 138, Dec. 1968.\" [4] J . Shurmann, \"Reading machines,\" P r o c . 6 t h I n t . J o i n t Conf. on P a t t e r n R e c o g n i t i o n , pp. 1031-1043, Nov. 1978. [5] S. M o r i , K. Yamamoto and M. Yasuda, \"Research on machine r e c o g n i t i o n of h a n d p r i n t e d c h a r a c t e r s , \" IEEE t r a n s , on PAMI, V o l . PAMI-6, No. 4, pp. 386-405, J u l y 1984. [6] K. B a d i e and M. Shimura, \"Machine r e c o g n i t i o n of roman c u r s i v e s c r i p t s , \" P r o c . 6 t h I n t . J o i n t Conf. on p a t t e r n R e c o g n i t i o n , pp. 28-30, Oct 1982. [7] D. J . B u r r , \" D e s i g n i n g a h a n d w i t i n g r e a d e r , \" IEEE t r a n s . on PAMI, V o l . PAMI-5, No. 5, pp. 554-559, S e p t . 1983. [8] M. R. I t o and T. L. C h u i , \" O n - l i n e r e c o g n i t i o n of proposed s t a n d a r d ANSI h a n d p r i n t e d c h a r a c t e r s , \" P a t t e r n R e c o g n i t i o n , V o l . 10, pp. 341-349, 1978. [9] A. B. S h a h i d u l H u s s a i n , G. T. T o u s s i a n t and R. W. Donaldson, \" R e s u l t s o b t a i n e d u s i n g a s i m p l e c h a r a c t e r r e c o g n i t i o n p r o c e d u r e on Munson's h a n d p r i n t e d d a t a , \" IEEE t r a n s , on Computers, V o l . C-21, No. 2, pp. 201-205, Feb. 1972. [10] A. A l i and A. P a v l i d i s , \" S y n t a c t i c r e c o g n i t i o n o f h a n d w r i t t e n numerals,\" IEEE t r a n s , on SMC, V o l . SMC-7, No. 7, pp. 537-541, J u l y 1977. [ I I ] D. D'Amato e t a l . , \"High speed r e c o g n i t i o n system f o r alp h a n u m e r i c h a n d p r i n t e d c h a r a c t e r s , \" P r o c . IEEE P a t t e r n R e c o g n i t i o n and Image P r o c e s s i n g , pp. 165-170, 1982. 1 10 [12] K. Ikeda e t a l . \" O n - l i n e r e c o g n i t i o n of h a n d w r i t t e n c h a r a c t e r s u t i l i z i n g p o s i t i o n a l and s t r o k e v e c t o r sequences,\" P a t t e r n R e c o g n i t i o n , V o l . 13, No. 3, pp. 191-206, 1981. [13] B. B l e s s e r e t a l . , \"A t h e o r e t i c a l approach f o r c h a r a c t e r r e c o g n i t i o n based on p h e n o m e n o l o g i c a l a t t r i b u t e s , \" I n t . J o u r n a l of Man-Machine S t u d i e s 6, pp. 701-714, 1974. [14] C. Y. Suen and J . R. S h i l l m a n , \"Low e r r o r r a t e o p t i c a l r e c o g n i t i o n of u n c o n s t r a i n e d l e t t e r s based on a model of human p e r c e p t i o n , \" IEEE t r a n s , on SMC, V o l . SMC-7, No. 6, pp. 491-495, June 1977. [15] S. M o r i and C. Y. Suen, \"A study of the z e r o and Oh problem,\" P r o c . 5 t h I n t . J o i n t Conf. on P a t t e r n R e c o g n i t i o n , pp. 842-847, Dec. 1980. [16] P. S. Wang, \"A new c h a r a c t e r r e c o g n i t i o n scheme w i t h lower a m b i g u i t y and h i g h e r r e c o g n i z i b i l i t y , \" P r o c . 6 t h I n t . J o i n t Conf. on P a t t e r n R e c o g n i t i o n , pp. 37-39, Oct. 1982. [17] K. S. Fu, \" A p p l i c a t i o n s of p a t t e r n r e c o g n i t i o n , \" E d i t e d K.S. Fu, S p r i n g e r - V e r l a g , 1976. [18] - , \"Recent advances i n s y n t a c t i c p a t t e r n r e c o g n i t i o n , \" P r o c . 4 t h I n t . J o i n t Conf. on P a t t e r n R e c o g n i t i o n , pp. 13-18, Nov. 1978. [ 1 9 ] - , \"A s t e p towards u n i f i c a t i o n of s y n t a c t i c and s t a t i s t i c a l p a t t e r n r e c o g n i t i o n , \" IEEE t r a n s , on PAMI, V o l . PAMI-5, No. 2, pp. 200-205, March 1983. [20] A. R o s e n f e l d and A.C. Kak, \" D i g i t a l p i c t u r e p r o c e s s i n g , \" V o l . 2, Academic P r e s s , 1982. [21] A. B. Whinston and K. S. Fu, \" P a t t e r n r e c o g n i t i o n -Theory and p r a c t i c e , \" E d i t e d A. B. Whinston and K S. Fu, N o o r d h o f f - L e y d e n , 1977. [22] M. G. Thomason, \" S y n t a c t i c / s e m a n t i c t e c h n i q u e s i n p a t t e r n r e c o g n i t i o n - Surv e y , \" I n t . J o u r n a l of Computer and I n f o r m a t i o n S c i e n c e , V o l . 1 1 , No. 2, pp. 75-100, 1982. [23] T. P a v l i d i s , \" S t r u c t u r a l p a t t e r n r e c o g n i t i o n , \" S p r i n g e r - V e r l a g , 1977. [ 2 4 ] P. A. D e v i j v e r and J . K i t t l e r , \" P a t t e r n r e c o g n i t i o n - A s t a t i s t i c a l a p p r o a c h , \" P r e n t i c e H a l l , 1982. 111 [25] A. V. Aho and J . D. U l l m a n , \" I n t r o d u c t i o n t o automata t h e o r y , languages and c o m p u t a t i o n , \" A d d i s i o n - W e s l e y 1979. [26] G. T. T o u s s a i n t , \"The use of c o n t e x t i n p a t t e r n r e c o g n i t i o n , \" P r o c . IEEE Comp. S c i . Conf. on P a t t e r n R e c o g n i t i o n and Image P r o c e s s i n g , pp. 1-10, June 1977. [27] W. T. T s a i and K. S. Fu, \" A t t r i b u t e d grammar - A t o o l f o r combining a s y n t a c t i c and s t a t i s t i c a l approaches t o p a t t e r n r e c o g n i t i o n , \" IEEE t r a n s , on SMC, V o l . SMC-10, No. 12, pp. 873-885, Dec. 1980. [28] S. Watanabe, \" P a t t e r n r e c o g n i t i o n as a ques t f o r minimum e n t r o p y , \" P a t t e r n R e c o g n i t i o n , V o l . 13, No. 5, pp. 381-387, 1981. [29] Q. R. Wang and C. Y. Suen, \" A n a l y s i s and d e s i g n of a d e c i s i o n t r e e based on e n t r o p y r e d u c t i o n and i t s a p p l i c a t i o n t o l a r g e c h a r a c t e r s e t r e c o g n i t i o n , \" IEEE t r a n s , on PAMI, V o l , PAMI-6, No. 4, pp. 406-417, J u l y 1984. ( [30] N. J . N i l s s o n , \" P r i n c i p l e of a r t i f i c i a l i n t e l l i g e n c e , \" T i o g a P u b l i s h i n g Co., 1980. [31] E. R i c h , \" A r t i f i c i a l i n t e l l i g e n c e , \" M c g r a w - H i l l , 1983. [32] D. Marr and E. H i l d e r t h , \"Theory of edge d e t e c t i o n , \" P r o c . R o y a l Soc. London B, V o l . 207, pp. 187-217, 1980. [33] W. H. H. J . L u n s c h e r , \"A d i g i t a l p r e p r o c e s s o r f o r o p t i c a l c h a r a c t e r r e c o g n i t i o n , \" M.A. S c i . T h e s i s , Dept. of E.E., U n i . of B r i t i s h C o l u m b i a , 1983. [34] M. K. Brown and S. Ganapathy, \" P r e p r o c e s s i n g techniques' f o r c u r s i v e s c r i p t word r e c o g n i t i o n , \" P a t t e r n R e c o g n i t i o n , V o l . 16, pp. 447-458, 1983. [35] W. D. Wasson, \"A p r e p r o c e s s o r f o r h a n d p r i n t e d c h a r a c t e r r e c o g n i t i o n \" . P r o c . 5 t h I n t . J o i n t Conf. on P a t t e r n R e c o g n i t i o n , pp. 703-707, Dec. 1980. [36] R. G. Casey and G. Nagy, \" R e c u r s i v e segmentation and c l a s s i f i c a t i o n of composi t e c h a r a c t e r p a t t e r n s , \" P r o c . 6 t h I n t . J o i n t Conf. on P a t t e r n R e c o g n i t i o n , pp. 1023-1025, Oct 1982. 1 12 [37] H. Blum, \"A t r a n s f o r m a t i o n f o r e x t r a c t i n g new d e s c r i p t o r s of shape,\" Models f o r the P e r c e p t i o n of Speech and V i s u a l Form, W. Wathen-Dunn ( e d i t e d ) , pp. 362-380, Cambridge, Mass., 1964. [38] A. R o s e n f e l d and L. S. D a v i s , \"A note on t h i n n i n g , \" IEEE t r a n s , on SMC, V o l . SMC-6, No.3, pp. 226-228, March 1976. [39] A. R o s e n f e l d , \"A c h a r a c t e r i z a t i o n of p a r a l l e l t h i n n i n g a l g o r i t h m s , \" I n f o r m a t i o n and C o n t r o l 29, pp. 286-291, 1975. [40] - , \"A co n v e r s e t o the J o r d a n ' s Curve Theorem f o r d i g i t a l c u r v e s , \" I n f o r m a t i o n and C o n t r o l 29, pp. 292-293, 1975. [41] F. W. M. S t e n t i f o r d and R. G. M o r t i m e r , \"Some new h e u r i s t i c s f o r t h i n n i n g b i n a r y h a n d p r i n t e d c h a r a c t e r s f o r OCR,\" IEEE t r a n s , on SMC, V o l . SMC-13, No. 1, pp. 81-84, Jan/Feb. 1983. [42] H. Tamura, \"A Comparison of l i n e t h i n n i n g a l g o r i t h m from the d i g i t a l v i e w p o i n t , \" P r o c . 4 t h I n t . J o i n t . Conf. on P a t t e r n R e c o g n i t i o n , pp. 715-719, Nov. 1978. [43] T. P a v l i d i s , \"An asynchoronous t h i n n i n g a l g o r i t h m , \" Computer G r a p h i c s and Image P r o c e s s i n g 20, pp. 133-157, 1982. [44] - . \" A l g o r i t h m s f o r computer g r a p h i c s and image p r o c e s s i n g , \" Computer S c i e n c e P r e s s , 1982. [45] H. Freeman and A. S a g h a r i , \" G e n e r a l i z e d c h a i n codes f o r p l a n a r c u r v e s , \" P r o c . 4 t h I n t . J o i n t Conf. on P a t t e r n R e c o g n i t i o n , pp. 701-703, Nov. 1978. [46] H. Freeman, \"Computer p r o c e s s i n g of l i n e - d r a w i n g images,\" Computing S u r v e y s , V o l . 6, No. 1, pp. 57-93, March 1974. [47] K. Hanakata, \" F e a t u r e s e l e c t i o n and e x t r a c t i o n f o r d e c i s i o n - t h e o r e t i c and s t r u c t u r a l approach,\" i n P a t t e r n R e c o g n i t i o n - Theory and a p p l i c a t i o n . K.S Fu and A.B Whinston e d i t e d , pp. 133-169 N o o r d h o f f - L e y d e n , 1977. [48] T. P a v l i d i s , \"A r e v i e w of a l g o r i t h m s f o r shape A n a l y s i s , \" Computer G r a p h i c s and Image P r o c e s s i n g 7, pp. 243-238, 1978. [49] L. G. S h a p i r o , \" S t r u c t u r a l model f o r shape,\" IEEE t r a n s . on PAMI., V o l . PAMI-2, no. 2, pp. 111-126, March 1980. 1 13 [50] S. B. Gray, \" L o c a l p r o p e r t i e s of b i n a r y images i n 2-D,\" IEEE t r a n s , on Computer, V o l . C-20, no. 5, pp. 551-561, May 1971. [51] H. Freeman, \"Shape d e s c r i p t i o n v i a the use of c r i t i c a l p o i n t s , \" P a t t e r n R e c o g n i t i o n V o l . 10, pp. 158-166. 1978. [52] M. P a v e l , \"An i n v i t a t i o n t o shape t h e o r y , \" P a t t e r n R e c o g n i t i o n L e t t e r s 1, pp. 31-35, 1982. [53] S. K. P a r u i and D. M. Majumder, \"Shape s i m i l a r i t y measures f o r open c u r v e s , \" P a t t e r n R e c o g n i t i o n L e t t e r s 1, pp. 129-134, 1983. [54] B. H. A r n o l d , \" I n t u i t i v e conceps i n t o p o l o g y , \" P r e n t i c e - H a l l , 1962. [55] A. N. S c h u r l e , \" T o p i c s i n t o p o l o g y , \" E l s e v i e r N o r t h H o l l a n d I n c . , 1979. [56] A. Shoukry and A. Amin, \" T o p o l o g i c a l and s t a t i s t i c a l a n a l y s i s of l i n e d r a w i n g s , \" P a t t e r n R e c o g n i t i o n L e t t e r s 1, pp. 365-374, 1983. [57] A. T B e r z t i s s , \"Data s t r u c t u r e s - Theory and p r a c t i c e , \" 2nd E d i t i o n , Academic P r e s s 1975. [58] A. V. Aho, J . E. H o p c r o f t and J . R. U l l m a n , \"Data s t r u c t u r e s and a l g o r i t h m s , \" A d i s s o n - W e s l e y , 1983. [59] N. Deo, \"Graph t h e o r y w i t h a p p l i c a t i o n s t o e n g i n e e r i n g and computer s c i e n c e , \" P r e n t i c e - H a l l , 1974. [60] W. H. T s a i , K. S. Fu, \" E r r o r - c o r r e c t i n g isomorphisms of a t t r i b u t e d r e l a t i o n a l graphs f o r p a t t e r n r e c o g n i t i o n , \" IEEE t r a n s , on SMC, V o l . SMC-9, No. 12, pp. 757-786, Dec. 1979. [61] M. A. E s h e r a and K. S. Fu, \"A graph d i s t a n c e measure f o r image a n a l y s i s , \" IEEE t r a n s , on SMC, V o l . SMC-14, No.3, pp. 398-408, May/June 1984. [62] A. T. B r e z t i s s , \"A b a c k t r a c k p r o c e d u r e f o r isomorphism of d i r e c t e d g r a p h s , \" J o u r n a l of ACM, V o l . 20, No. 3, pp. 365-377, J u l y 1973. "@en . "Thesis/Dissertation"@en . "10.14288/1.0096330"@en . "eng"@en . "Electrical and Computer Engineering"@en . "Vancouver : University of British Columbia Library"@en . "University of British Columbia"@en . "For non-commercial purposes only, such as research, private study and education. Additional conditions apply, see Terms of Use https://open.library.ubc.ca/terms_of_use."@en . "Graduate"@en . "Design of a realtime high speed recognizer for unconstrained handprinted alphanumeric characters"@en . "Text"@en . "http://hdl.handle.net/2429/25135"@en .