T E L K O M N I K T elec o m m un ica t io n Co m pu t ing   E lect ro nics   a nd   Co ntr o l   Vo l.  24 ,   No .   2 A p r il   20 26 ,   p p .   635 ~ 647   I SS N:  1 6 9 3 - 6 9 3 0 ,   DOI : 1 0 . 1 2 9 2 8 /TE L KOM NI KA. v 24 i 2 . 2 7 5 0 4          635     J o ur na l ho m ep a g e h ttp : //jo u r n a l.u a d . a c. id /in d ex . p h p /TELK OM N I K A   Applica tion o f  t he  t ra v eling  sa lesm a n problem   to o pti mize  skeleto niza tion a nd stroke  recons t ruction       Alif a h 1 ,   Dia n Andria na 2 ,   M u ha m m a d Z ulh a j   Alia ns y a h 3 ,   L uk m a n H a k im 1 ,   K ho lid   M urt a dlo 1   1 D e p a r t me n t   o f   I n f o r mat i c s   E n g i n e e r i n g ,   F a c u l t y   o f   E n g i n e e r i n g ,   U n i v e r si t a s Yu d h a r t a   P a s u r u a n ,   P a su r u a n I n d o n e s i a   2 R e s e a r c h   C e n t e r   f o r   A r t i f i c i a l   I n t e l l i g e n c e   a n d   C y b e r se c u r i t y ,   N a t i o n a l   R e sea r c h   a n d   I n n o v a t i o n   A g e n c y   ( B R I N ) ,   B a n d u n g ,   I n d o n e s i a   3 D e p a r t me n t   o f   D a t a   S c i e n c e ,   F a c u l t y   o f   C o m p u t e r   S c i e n c e ,   U n i v e r s i t a s   P e mb a n g u n a n   N a si o n a l   V e t e r a n   Jaw a   T i mu r ,   S u r a b a y a I n d o n e si a       Art icle  I nfo     AB S T RAC T   A r ticle  his to r y:   R ec eiv ed   Au g   25 2 0 2 5   R ev is ed   Dec   27 2 0 2 5   Acc ep ted   J an   30,   2 0 2 6       Th e   p re se rv a ti o n   o T u ro ts  Nu s a n tara   m a n u sc rip ts  writt e n   i n   P e g o n   sc ri p fa c e sig n ifi c a n t   c h a ll e n g e d u e   t o   p h y sic a d e teri o ra ti o n   a n d   t h e   c o m p lex it y   o h a n d writt e n   st y les .   T h is  stu d y   p ro p o se a   n o v e d ig i ti z a ti o n   a p p ro a c h   b a se d   o n   ima g e   p r o c e ss in g   t o   e x trac a n d   re c o n stru c t   h a n d writi n g   s tro k e b y   c o m b in i n g   s k e leto n iza ti o n   a n d   th e   trav e ll i n g   sa les m a n   p ro b l e m   (TS P a lg o rit h m .   Th e   n o v e lt y   o t h is  re se a rc h   li e in   th e   a p p li c a ti o n   o a   m o d ifi e d   G re e d y   TS P   a lg o rit h m   c a p a b le  o f   re c o g n izin g   b ra n c h i n g   a n d   c y c li c   stru c tu re ty p ica o Ara b ic P e g o n   c h a ra c ters ,   e n a b li n g   a c c u ra te  r e c o n str u c ti o n   o f   h a n d writ ten   stro k e   se q u e n c e s.  Th e   p ro c e ss   in v o l v e p re p r o c e ss in g   ( g ra y sc a le,  th re sh o l d i n g ,   a n d   m o rp h o l o g ica l   o p e ra ti o n s),  sk e leto n   e x trac ti o n   u sin g   a   th in n in g   m e th o d ,   a n d   we ig h ted   g ra p h   c o n stru c ti o n   b a se d   o n   Eu c li d e a n   d istan c e   b e twe e n   sk e l e to n   p o in ts.   Th e   p ro p o se d   s y ste m   a c h iev e d   a n   a v e ra g e   p re c isio n   o 0 . 5 5 2 ,   r e c a ll   o f   0 . 8 1 5 ,   F 1 - s c o re   o 0 . 6 5 7 ,   a n d   a c c u ra c y   o 0 . 8 2 .   Th e se   re su lt d e m o n stra te  th e   m e th o d s   e ffe c ti v e n e ss   in   d e tec ti n g   a n d   re c o n stru c ti n g   c h a ra c ter  sh a p e fro m   P e g o n   m a n u sc rip ts.   P ra c ti c a ll y ,   th is   a p p ro a c h   o ffe rs  p o ten t ial  a p p li c a ti o n in   t h e   a u to m a ti c   d i g it iza ti o n ,   p re se rv a ti o n ,   a n d   a n a ly sis  o f   P e g o n   sc rip t,   c o n tri b u ti n g   to   th e   c o n se rv a ti o n   o f   In d o n e sia s Isla m ic i n tellec tu a a n d   c u lt u ra h e rit a g e .   K ey w o r d s :   Dig italizatio n   Gr ee d y   alg o r ith m   Peg o n   s cr ip t   Sk eleto n izatio n   T r av elin g   s alesm an   p r o b lem   T h is i a n   o p e n   a c c e ss   a rticle   u n d e r th e   CC B Y - SA   li c e n se .     C o r r e s p o nd ing   A uth o r :   L u k m an   Ha k im   Dep ar tm en t o f   I n f o r m atics E n g in ee r in g ,   Facu lty   o f   E n g in ee r in g Un iv er s itas   Yu d h ar ta  Pas u r u an   J l.  Yu d h ar ta  No . 7 ,   Kem b an g k u n in g ,   Sen g o n a g u n g ,   Pu r w o s ar i,  Pas u r u an ,   E ast J av 6 7 1 6 2 ,   I n d o n esia   E m ail:  lu k m an @ y u d h ar ta. ac . i d       1.   I NT RO D UCT I O N   T h d ev el o p m en o f   I s lam   in   I n d o n esia  is   clo s ely   lin k ed   to   wr itten   tr ad itio n s   as  m ed iu m   f o r   r ec o r d in g ,   p r eser v in g ,   an d   tr an s m itti n g   k n o wled g e .   Ma n y   wo r k s   o f   t h Ulam Nu s an tar a ,   co llectiv ely   k n o wn   as  T u r o ts ,   wer wr itten   u s in g   Ar ab ic  Peg o n   s cr ip t   an   ad ap te d   Ar ab ic   wr itin g   s y s tem   u s ed   f o r   l o ca lan g u ag es   s u ch   as  J av an ese,   Su n d an ese,   an d   Ma d u r ese  [ 1 ] .   As  f o r m   o f   I s lam ic  in tellectu al  h er itag e,   Peg o n   m an u s cr ip ts   co n tain   v alu a b le  h is to r ical,   r el ig io u s ,   an d   c u ltu r al  k n o wled g e.   Ho wev er ,   an aly zin g   h a n d wr i tten   Peg o n   m an u s cr ip ts   r em ain s   ch allen g in g   task .   Ar ab ic - b ased   h an d wr itin g   is   in h er en tly   co m p lex   d u to   its   cu r s iv n atu r e,   co n tex tu al  letter   s h ap es,  o v er lap p in g   s tr o k es,  lo o p s ,   an d   d iacr itical  m ar k s   [ 2 ] .   T h e s ch allen g es  ar e   f u r th er   ex ac er b ated   b y   th p h y s ical  d eter i o r atio n   o f   Nu s an tar m an u s cr ip ts   ca u s ed   b y   ag in g ,   h u m id ity ,   a n d   in a d eq u ate  p r eser v atio n ,   wh ic h   o f ten   r esu lts   in   f ad ed   in k ,   b r o k en   s tr o k es,  an d   d a m ag ed   p ap er   [ 3 ] ,   [ 4 ] .   Dig itizatio n   h as  th er ef o r b ec o m an   ess en tial  ef f o r t   f o r   p r eser v in g   T u r o ts   Nu s an tar a   m an u s cr ip ts .   B ey o n d   lo n g - ter m   co n s er v ati o n ,   d i g itizatio n   im p r o v es  ac ce s s ib ilit y ,   s u p p o r ts   s ch o lar ly   a n aly s is ,   an d   en a b les  Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   1 6 9 3 - 6 9 3 0   TEL KOM NI KA   T elec o m m u n   C o m p u t E C o n tr o l ,   Vo l.  24 ,   No .   2 Ap r il  20 26 1 - 1x   636   th tr an s m is s io n   o f   c u ltu r al  h er itag to   f u tu r e   g en e r atio n s   [ 5 ] ,   [ 6 ] .   cr itical  s tag in   th is   p r o ce s s   is   th r ec o n s tr u ctio n   a n d   an aly s is   o f   h an d wr itin g   s tr o k es,  wh ich   a im s   to   r ec o v er   th o r ig in al  wr itin g   s tr u ctu r an d   s tr o k s eq u en ce   f r o m   s tatic  d i g ital im ag es  [ 7 ]   Sev er al  s tu d ies  h av a d d r ess ed   h an d wr itin g   s k eleto n izatio n   an d   s tr o k r ec o n s tr u ctio n .   R esear ch   b y   Kr y zh an o v s k ay et  a l [ 8 ]   p r o p o s ed   r ec o n s tr u ctin g   p en   s tr o k es  f r o m   s k eleto n   im a g es  u s in g   h eu r is tic  g r ap h   tr av er s al,   ac h iev in g   p ath s   s im ilar   to   n atu r al  h a n d wr itin g   b u s tr u g g lin g   with   b r an ch e d   o r   c o m p lex   ch a r ac ter s .   Me an wh ile,   Li   et   a l .   [ 9 ]   in tr o d u ce d   in s tan ce - awa r e   s k eleto n   em b ed d i n g   f o r   cu r v ed   te x d etec tio n   i n   s ce n e   im ag es,  im p r o v in g   d etec tio n   a cc u r ac y   b u n o f o c u s in g   o n   s tr o k r ec o n s tr u ctio n .   An o th er   s tu d y   b y   Diaz   et  a l [ 1 0 ]   m o d eled   s k eleto n s   as  g r ap h s   an d   ex tr ac te d   wr itin g   p ath s   b ased   o n   co n ti n u ity   an d   cu r v atu r c r iter ia,   p r o d u cin g   s m o o th   s tr o k e   s eq u en ce s .   Ho wev er ,   th is   ap p r o ac h   f ails   to   h an d le   b r a n ch ed   o r   m u lti - s tr o k ch ar ac ter s   co m m o n l y   f o u n d   i n   Ar ab ic - d e r iv ed   s cr ip ts   s u ch   as Peg o n   o r   J awi.   T o   ad d r ess   th ese  lim itatio n s ,   th is   s tu d y   p r o p o s es  s tr o k r ec o n s tr u ctio n   m eth o d   b as ed   o n   th e   tr av ellin g   s alesm an   p r o b lem   ( T SP ) .   T SP   i s   well  s u ited   f o r   m o d elin g   co n tin u o u s   p ath s   an d   h as  th p o ten tial  to   p r o d u ce   s tr o k r ep r esen tatio n s   th at  clo s ely   r e s em b le  h u m an   wr itin g   b eh av io r .   Nev er th el ess ,   s tan d ar d   T SP   f o r m u latio n s   r estrict  ea ch   n o d to   s in g le  v is it,  m ak in g   th e m   u n s u itab le  f o r   c h ar ac ter s   wi th   lo o p s   o r   b r an ch in g   s tr u ctu r es.  Similar ly ,   G r ee d y   T SP   s o lv er s ,   wh ich   p r io r itize  lo ca s h o r test   d is tan ce s ,   o f ten   g en er ate  im p lau s ib le  s tr o k o r d e r s   f o r   c o m p lex   h an d wr itten   ch ar ac ter s   [ 1 1 ] .   T h er ef o r e,   th is   r esear ch   i n tr o d u ce s   m o d if ied   Gr ee d y   T SP   a lg o r ith m   t h at  allo ws  co n tr o lled   r ev is itin g   o f   s k eleto n   n o d es  f o r   ch ar a cter s   with   lo o p in g   an d   b r a n ch in g   s tr u ctu r es,  wh ile  m ain tain in g   s in g le - v is it   co n s tr ain ts   f o r   s im p ler   ch ar a cter s .   T h is   m o d if icati o n   en ab les  m o r ac c u r ate  r ec o n s tr u ct io n   o f   h an d wr itte n   Peg o n   s tr o k es a n d   b etter   r e p r e s en ts   th o r ig in al  wr itin g   s eq u en ce ,   s u p p o r tin g   th e   d ig itizatio n   an d   p r eser v atio n   o f   Nu s an tar m a n u s cr ip ts .       2.   M E T H O D   T h r esear ch   p r o ce s s   co n s is ts   o f   s ev er al  s tag es,  in clu d in g   p re - p r o ce s s in g ,   s k eleto n izatio n ,   tr av ellin g   s alesm an   p r o b lem ,   letter   s eg m en tatio n   b ased   o n   b o u n d in g   b o x ,   an d   f r ee m an   c h ain   co d e   ( FC C ) .   T h f lo wch ar o f   th ese  s tag es is   s h o wn   in   Fig u r 1 .           Fig u r 1 .   Flo o f   r esear ch       2 . 1 .     Da t a s et   T h p r o ce s s   o f   co llectin g   th d ataset  f o r   th is   s tu d y   o r ig in ated   f r o m   an   a n cien m an u s cr ip t   wr itten   u s in g   th Peg o n   s cr ip t,  n am ely   th Kitab   Sy air   Per ah u .   T h e   in itial  s tag b eg an   with   s ca n n in g   t h m an u s cr ip t.  T h e   s ca n n ed   r esu lts   wer th en   p r o c ess ed   b y   m an u all y   cu ttin g   ea c h   p ag e,   wh ich   c o n s is ted   o f   1 3   l in es  p er   p a g e.   Af ter   th at,   ea ch   lin was  cu ag ain   in to   in d iv id u al  wo r d s   to   f ac ilit ate  th s eg m en tatio n   p r o ce s s .   An   ex am p le  o f   th e   im ag f r ag m en ts   to   b a n aly ze d   in   th is   s tu d y   ca n   b s ee n   in   Fig u r 2 .           Fig u r 2 .   I m ag lin c u to u ts   B o o k   Sy air   P er ah u       2 . 2 .     P re pro ce s s ing   Pre - p r o ce s s in g   is   p er f o r m e d   to   p r ep a r th d ata  s o   th at   it  b ec o m es  m o r s tr u ctu r ed   a n d   clea n er ,   f ac ilit atin g   ch ar ac ter   s h ap s eg m en tatio n   an d   an aly s is   in   th n ex t stag e.   T h f ir s t step   is   g r ay s ca le  co n v er s io n .   g r ay s ca le  im ag r ep r esen t s   ea ch   p ix el  with   a   s in g le  i n ten s ity   v alu e,   w h er th e   r e d ,   g r ee n ,   an d   b l u co m p o n en ts   ar eq u al,   p r o d u ci n g   s h ad es  b etwe en   b lack   an d   wh ite.   Acc o r d in g   to   Z eg er   et  a l [ 1 2 ] ,   g r a y s ca le  is   Evaluation Warning : The document was created with Spire.PDF for Python.
T E L KOM NI KA   T elec o m m u n   C o m p u t E l Co n tr o l           A p p lica tio n   o f th tr a ve lin g   s a lesma n   p r o b lem  to   o p timiz s ke leto n iz a tio n   a n d   s tr o ke   r ec o n s tr u ctio n   ( A lifa h )   637   d ig ital  im ag r ep r esen tatio n   th at  s to r es  o n ly   lu m in an ce   in t en s ity   in f o r m atio n ,   ty p ically   i n   8 - b it  f o r m at  with   v alu es  r an g in g   f r o m   0   to   2 5 5 .   As  r ep o r ted   in   [ 1 3 ] ,   th is   p r o ce s s   aim s   to   ex tr ac im p o r tan s tr u ctu r es  o r   o b jects  f r o m   im a g es,  p ar ticu lar ly   u n d er   u n ev e n   lig h tin g   co n d itio n s ,   an d   is   ca r r ied   o u t u s in g   ( 1 ) .     = 0 , 2989   × + 0 , 5870   × + 0 , 1141   ×     ( 1 )     T h v ar iab le    d en o tes  th g r ay s ca le  in ten s ity   v alu e,   wh ile  ,   an d     r ep r esen th r ed ,   g r ee n ,   an d   b lu co m p o n e n ts   o f   th R GB   co lo r   m o d el.   Af ter   g r a y s ca le  co n v er s io n ,   b in ar izatio n   is   p er f o r m ed   u s in g   th e   Ots u   t h r esh o l d in g   m eth o d ,   an   in ten s ity - b ased   s eg m en tatio n   tech n iq u e   f o r   g r ay s ca le  im ag es  [ 1 4 ] .   T h is   m eth o d   class if ies  ea ch   p ix el  as   f o r eg r o u n d   o r   b ac k g r o u n d   d e p en d in g   o n   wh et h er   its   in ten s i ty   is   ab o v o r   b elo th e   th r es h o ld   v alu [ 1 5 ] .   As  d em o n s tr ated   in   [ 1 6 ]   Ots u   th r esh o ld in g   e f f ec tiv ely   s ep ar ates  im ag es  in to   r eg io n s   with   clea r   in ten s ity   d if f er en ce s ,   im p r o v i n g   s eg m en tatio n   ac cu r ac y   with   m in i m al  co m p u tatio n al  co s t.  T h co n v er s io n   f r o m   g r ay s ca le  to   b i n ar y   im a g is   ac h iev ed   b y   d eter m i n in g   a n   o p tim al  th r esh o ld   v alu u s in g   ( 2 ) .     ( , ) = { 1                   0                      ( , ) >   ( , )   ( 2 )     T h f u n ctio n   ( , )   r ep r esen ts   th p i x el  in ten s ity   at  co o r d in ates ( , ) ,   wh ile    d en o tes th th r esh o ld   v alu e.   Su b s eq u en tly ,   m o r p h o lo g ical  o p en in g   an d   clo s in g   o p er atio n s   ar ap p lied .   Op en in g ,   wh ich   co n s is ts   o f   er o s io n   f o llo we d   b y   d ilatio n   u s in g   th s am s tr u ctu r in g   el em en t,  is   u s ed   to   r em o v s m all  f o r eg r o u n d   n o is wh ile  p r eser v in g   th m ain   o b j ec s h ap e.   C o n v er s ely ,   clo s in g   is   d ilatio n   f o llo wed   b y   er o s io n   o p er atio n   th at   f ills   s m all  h o les  an d   co n n ec ts   f r ag m en te d   o b jects,  r esu ltin g   in   s m o o th e r   o b ject  co n to u r s   [ 1 7 ] [ 1 9 ] T h e   f o r m u las f o r   m o r p h o lo g ical  o p en in g   a n d   clo s in g   ar p r esen ted   in   ( 3 )   an d   ( 4 ) .     = ( )     ( 3 )     = ( )     ( 4 )     r ep r esen ts   th in p u im ag e ,   B   d en o tes  th s tr u ctu r al  elem en ts   u s ed   in   m o r p h o lo g ical  p r o ce s s in g ,     s ig n if ies th er o s io n   o p er atio n ,   an d     in d icate s   th d ilatio n   o p er atio n .     2 . 3 .     S k elet o niza t io n   Af ter   p r ep r o ce s s in g ,   th ch ar a cter   im ag is   s k eleto n ized   to   r ed u ce   ea ch   letter   to   its   m ed ial  ax is   wh ile  p r eser v in g   its   ess en tial  m o r p h o lo g ical  s tr u ctu r e.   Sk eleto n iza tio n   ex tr ac ts   o n e - p i x el - wid r ep r esen tatio n   th at   m ain tain s   th o b ject s   to p o lo g y   an d   g e o m etr ic  f o r m ,   p r o v i d in g   a   s tr u ctu r al  b asis   f o r   s tr o k ex tr ac tio n   f r o m   s tatic  im ag es  [ 2 0 ] ,   [ 2 1 ] .   I n   t h is   s tu d y ,   s k eleto n izatio n   is   p er f o r m ed   u s in g   th Z h a n g Su e n   al g o r ith m ,   a   p ar allel   th in n in g   m eth o d   th at  iter ativ el y   r em o v es  p ix els  b ased   o n   lo c al  co n n ec tiv ity   r u les  with in   a   3 ×3   n ei g h b o r h o o d ,   r esu ltin g   in   c o n tin u o u s   an d   o n e - p ix el - wid s k eleto n   [ 2 2 ] T h is   r ep r esen tatio n   r ed u ce s   d ata  r ed u n d an c y   a n d   s u p p o r ts   ef f icien t su b s eq u en p r o ce s s in g ,   as f o r m ally   ex p r ess ed   in   ( 5 ) .        ( ) =   l im 2 ( 1 ( ) )   5)       r ep r esen ts   th b in ar y   im ag p r o d u ce d   in   th - th   iter atio n ,   wh ile  1   an d   2   ar th two   s u b - iter atio n s   o f   th th in n in g   p r o ce s s   in   wh ich   p ix els  ar r em o v e d   b ased   o n   lo g ical  r u les.  T h n o t atio n   l im   in d icate s   th at  th p r o ce s s   co n tin u es  u n ti co n v e r g en ce ,   m ea n in g   n o   f u r th er   p ix el   r em o v al  o cc u r s   an d   th r esu lt  n o   lo n g er   ch an g es.     2 . 4 .     T SP   T h n ex t step   a p p lies   th T SP ,   an   NP - h ar d   co m b in ato r ial  o p t im izatio n   m eth o d   th at  s ee k s   th s h o r test   p ath   v is itin g   ea ch   p o i n o n ce   [ 2 3 ] ,   [ 2 4 ] .   Ho wev e r ,   th is   f o r m u latio n   is   n o s u itab le  f o r   Ar a b ic   letter   s eg m en tatio n   b ec au s m an y   ch a r ac ter s   co n t ain   lo o p s   an d   b r a n ch in g   s tr u ct u r es  th at  p r o d u ce   n o n - lin ea r   s k eleto n   p ath s .   T h e   s in g le - v is it c o n s tr ain t lim its   ac cu r ate  tr av er s al  o f   s u ch   co m p lex   s h ap es.   C ar r ab s   et  a l .   [ 2 5 ] in tr o d u ce d   th c ar o u s el  Gr ee d y   al g o r it h m ,   wh ich   allo ws  lo ca n o d r ev is its   an d   ac h iev es  n ea r - o p tim al  s o lu tio n s   u n d er   h ig h   r o u te  co m p lex i ty   with   lo co m p u tatio n al  c o s t.  B u ild in g   o n   th is   id ea ,   th is   s tu d y   ad o p ts   Gr ee d y - with - r ev is it  T SP   ap p r o ac h ,   e n ab lin g   s elec tiv r ev is its   f o r   letter s   with   lo o p s   o r   b r an ch es,  wh ile  m ai n tain in g   s i n g le - v is it tr av er s al  f o r   s im p ler   letter s .   C o m p ar ativ ex p e r im en ts   with   th n ea r est  n eig h b o r   m eth o d   s h o th at  th e   Gr ee d y   alg o r i th m   y ield s   m o r s tab le  tr ajec to r ies  an d   b etter   r ep r esen ts   n at u r al  s tr o k e   f lo w,   esp ec ially   f o r   c o m p lex   l etter s   s u ch   as  ح   , Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   1 6 9 3 - 6 9 3 0   TEL KOM NI KA   T elec o m m u n   C o m p u t E C o n tr o l ,   Vo l.  24 ,   No .   2 Ap r il  20 26 1 - 1x   638   a n d   .   U n l i k e   n ea r est  n eig h b o r ,   wh ich   o f ten   ca u s es  ab r u p ju m p s   o r   p r em atu r lo o p   clo s u r e ,   th Gr ee d y   m eth o d   co n s id er s   g lo b al   co n n ec tiv ity ,   r esu ltin g   in   m o r e   co h e r en p ath s .   T h is   m o d if ied   T SP   ap p r o ac h   ef f ec tiv ely   r ec o n s tr u cts  s tr o k es  in   an cien Ar ab ic  m an u s cr ip ts   b y   p r ese r v in g   s tr o k c o n tin u ity ,   b r an c h in g   b eh a v io r ,   a n d   s tr u ctu r al  co n n ec ti v ity ,   p r o d u c in g   g eo m etr ically   ac cu r ate  a n d   h an d wr itin g - co n s is ten r esu lts .   Ma th em atica lly ,   T SP   is   d ef in ed   b y   ( 6 ) .     min       ( , + 1 ) ,                    = 0 1 =   +   ( 6 )     T h ter m     ( , + 1 )   d en o tes  th e   E u clid e an   d is tan ce   b etwe en   two   co n s ec u tiv p o in ts ,   wh er e   , + 1   ar e   v is ited   p o in ts   an d   n   is   th to tal  n u m b e r   o f   p o in ts .   T h Gr ee d y   r ev is it  alg o r ith m   wo r k s   b y   s elec tin g   th l o ca tio n   clo s est  to   th cu r r en p o s itio n   with o u t   lim itin g   lo ca tio n s   th at  h a v n o b ee n   v is ited .   T h is   s tr ateg y   is   r elev an f o r   ca s es  o f   b r an ch in g ,   m e r g in g ,   o r   co m p lex   c y clic  s tr u ctu r es.  T h e   s tep s   o f   th is   alg o r itm   ar as f o llo ws:     Dete r m in th s tar tin g   p o in _    o f     ( u s u ally   s tar tin g   f r o m   th en d   p o in o f   th s k eleto n ) .     I n itializatio n   T h p ath   is   in itialized   as  [ _  ] ,   all  p o in ts         ar m ar k ed   as  u n v is ite d   (   [ ]   =   0 ) ,   th s tar tin g   p o in _    is   m ar k ed   as  v is ited   (   [ _  ]   =   1 ) ,   an d   th v a r iab le  cu r r en t   is   s et  to   _  .     I f   th er is   s till   p o in t         s u ch   th a   [ ]   <    ( ) :   a.   Fin d   th clo s est  _    p o in f r o m   cu r r en u s in g   E u clid ea n   d is tan ce .   T h E u clid ea n   d is tan ce   f o r m u la  ca n   b s ee n   in   ( 7 ) .     ( , ) = ( ) 2 +   ( ) 2     ( 7 )     b.   Ad d   _    to   th p ath   On ce   th clo s est  p o i n is   f o u n d ,   it  is   ad d ed   to   th p ath   lis t.  T h is   is   an   im p o r tan s tep   in   f o r m in g   th e   s eq u en ce   o f   p ath s   th at  r ep r esen t th e   s cr atch   p ath .   c.     [ _  ]   + = 1   m ar k er   in d icatin g   th at  th _    p o in h as  alr ea d y   b ee n   v is ited .   T h v is ited   v alu is   r ec o r d ed   s o   th at  th a l g o r ith m   ca n   tr ac k   v i s it  v alu es  to   d eter m in e   wh eth e r   p o in t   n ee d s   to   b v is ited   ag ain   ( f o r   e x am p le,   in   th ca s o f   b r a n ch in g   p o i n ts )   o r   if   s in g le  v is it is   s u f f icien t.   d.   cu r r en t ←  _    T h p o in th at   was  ju s v is ited   ( _  )   is   u p d ated   as   th c u r r e n p o in (   ) .   T h is   is   im p o r tan s o   th at  th n ex p o in t is ca lcu l ated   f r o m   th latest p o s itio n   in   th n ex t iter atio n .     R etu r n   p ath   Descr ip tio n :   T h v is it  lim it   ( )   d ef in es  th e   m ax im u m   n u m b er   o f   allo wab le   v is its   f o r   ea c h   s k eleto n   p o i n b ased   o n   its   lo ca s tr u ctu r al  ch ar ac ter is tics f o r   en d p o in ts   ( d e g r ee   1 ) ,    ( ) = 1   s in ce   o n ly   s in g le  v is it   is   r eq u ir ed f o r   lin ea r   p o in ts   ( d eg r ee   =   2 ) ,    ( ) = 1   as  n o   r e v is its   ar n ec ess ar y   in   s tr aig h s eg m en t s an d   f o r   b r an ch i n g   p o in ts   ( d e g r ee     3 ) ,    ( ) > 1   to   allo w   r ev is itin g   th ese  p o in ts   s o   th at  all  co n n ec ted   b r a n ch es   ca n   b ex p lo r e d ,   with   th v alu ty p ically   s et  eq u al  to   o r   s lig h tly   g r ea ter   t h an   th e   p o in t s   d eg r ee .   Fu r th e r m o r e ,    ( ) = 1   ca n   b ad ju s ted   ac co r d in g   to   lo ca s k eleto n   co m p lex ity   o r   d en s ity ,   wh er r e g io n s   with   h ig h   co n n ec tiv ity   o r   cu r v ed   s tr u ct u r es  s u ch   as  lo o p s   m ay   r eq u ir h ig h er   v is it  lim its   to   en s u r co m p lete  p at h   r ec o n s tr u ctio n ,   wh ile  s im p ler   o r   s tr aig h ter   r e g io n s   ca n   u s lo wer   lim its   to   av o id   u n n e ce s s ar y   r ev is its   an d   im p r o v c o m p u tatio n al  ef f icie n cy .     2 . 5 .     L et t er   s eg m ent a t i o n ba s ed  o n bo un di ng   bo x   At  th is   s tag e,   Ar ab ic   letter   s e g m en tatio n   is   p er f o r m e d   u s in g   s k eleto n izatio n   an d   th e   m o d if ied   T SP   p ath .   E ac h   letter   is   au to m atic ally   s ep ar ated   f r o m   a   lin o f   Ar ab ic  tex b y   u tili zin g   s k elet o n - b ased   s u b - p ath s   g en er ated   in   th p r ev io u s   T SP   m o d if icatio n   p r o ce ss.   Acc o r d in g   to   Aan c h al   et  a l .   [ 2 6 ] b o u n d in g   b o x   is   an   ax is - alig n ed   r ec tan g le  d ef in ed   b y   x co o r d in ates,   wid th ,   a n d   h eig h t   th at  en cl o s es  h an d wr itin g   r e g io n s   in   s ca n n e d   d o cu m e n im ag es.  Acc o r d in g ly ,   th is   s tu d y   ap p lies   b o u n d in g   b o x b ased   letter   cr o p p in g   as   th in itial  s eg m en tatio n   s tep .   Un l ik p r e v io u s   ap p r o ac h es,  cr o p p in g   is   p er f o r m ed   f o r   ea ch   s u b - p ath   p r o d u ce d   b y   th m o d if ied   T SP   alg o r ith m ,   allo win g   s eg m en tatio n   to   co n s id er   b o th   s p atial  lo ca tio n   a n d   s tr o k o r d er   th at  r ef lects  n atu r al  h a n d wr i tin g   s tr u ctu r e .   T h is   ap p r o ac h   ef f ec tiv ely   s ep ar ates in d iv id u al  letter s   f r o m   th b a ck g r o u n d   a n d   ir r elev an t e lem e n ts   s u ch   as n o is e.   T h b o u n d i n g   b o x   f o r   ea ch   s u b - p ath   is   co m p u ted   u s in g   th e   m i n im u m   an d   m a x im u m   an d   y   co o r d in ate   v alu es,  as d ef in ed   i n   ( 8 ) .   Evaluation Warning : The document was created with Spire.PDF for Python.
T E L KOM NI KA   T elec o m m u n   C o m p u t E l Co n tr o l           A p p lica tio n   o f th tr a ve lin g   s a lesma n   p r o b lem  to   o p timiz s ke leto n iz a tio n   a n d   s tr o ke   r ec o n s tr u ctio n   ( A lifa h )   639   = min ( )   ,  = ma x ( ) +       = min ( )   ,  = ma x ( ) +       ( 8 )     T h s y m b o   is   an   ad d itio n al  m ar g in   u s ed   to   cu t th e   ar ea   s o   th at  it is   n o t to o   n a r r o w.   T h e   im ag ar ea   in   th b o u n d in g   b o x   will  b cu d ir ec tly   f r o m   th co m b in ed _ s k eleto n ,   r esu ltin g   i n   cu im ag o f   th letter s   th at   co r r esp o n d s   to   ea ch   s u b - p ath .     2 . 6 .     F re e m a cha in co de   T h n ex s tep   en c o d es  th m o v em en d ir ec tio n   b etwe en   s k e leto n   p o in ts   u s in g   t h FC C   m eth o d   f o r   ea ch   s u b - p ath   g en er ate d   b y   t h e   T SP   alg o r ith m .   FC C   r ep r esen ts   o b ject  co n to u r s   in   b in ar y   o r   s k eleto n ized   im ag es  u s in g   eig h d is cr ete  d ir ec tio n s   ( 0 7 ) ,   p r o v id in g   c o n cise  d e s cr ip tio n   o f   c h ar ac ter   s tr u ctu r [ 2 7 ] .   T h is   m eth o d   is   wid ely   u s ed   in   im ag co m p r ess io n ,   p atter n   r ec o g n itio n ,   a n d   s h ap a n aly s is   b ec au s it  ef f ec tiv ely   ca p tu r es  d ir ec tio n al  ch an g es  [ 2 8 ] .   Feth i   et  a l .   [ 2 9 ]   a p p lied   FC C   to   ex tr ac co n to u r   f ea tu r es  o f   h a n d wr itten   Ar ab ic  ch a r ac ter s   an d   p r o p o s ed   m o d if ied   FC C   th at  s im p lifie s   th co d s eq u en ce   with o u lo s in g   ess en tial  s tr u ctu r al  in f o r m atio n ,   lead in g   t o   im p r o v e d   r ec o g n itio n   ac cu r a cy .   I n   th is   s tu d y ,   FC C   is   u s ed   to   tr an s f o r m   s k eleto n   p a th s   in to   n u m er ical   m o v em en s eq u e n ce s   th at  ca n   b s p atially   an aly ze d   [ 2 9 ] ,   [ 3 0 ] s u ch   as  id en tify in g   wr itin g   d ir ec tio n ,   lo o p s ,   an d   ch ar ac ter is tic  tu r n s   in   Ar ab ic  l etter s .   T h eig h t - d ir e ctio n al  s y s tem   o f   FC C   is   i llu s tr ated   b elo w.     3       2       1   \   |   /   - - - - -   0   / |   \       5       6       7     T h n u m b er s   0   to   7   a b o v r ep r esen 8   d ir ec tio n s   o f   m o v em en r elativ to   p o i n t.  I n   th FC C   r ep r esen tatio n ,   ea c h   n u m b e r   i n d icate s   th d ir ec tio n   o f   p ix el   m o v em e n t,  wh er e   0   i n d icate s   r ig h t,  1   in d icate s   u p p er   r ig h t,  2   i n d icate s   u p ,   3   i n d icate s   u p p er   lef t,  4   in d icate s   lef t,  5   in d icate s   lo wer   lef t,  6   i n d icate s   d o wn ,   an d   7   in d icate s   lo wer   r ig h [ 3 1 ] .     2 . 7 .     E v a lua t i o m et rics   E v alu atio n   is   co n d u cted   q u an titativ ely   u s in g   s tan d ar d   m u lt i - class   clas s if icatio n   m etr ics,  in clu d in g   ac cu r ac y ,   p r ec is io n ,   r ec all ,   an d   F1 - s co r [ 3 2 ] wh ich   ar c o m p u ted   b ased   o n   tr u p o s itiv ( T P),   f alse  p o s itiv ( FP ) ,   tr u e   n eg ativ e   ( T N) ,   a n d   f alse  n eg ativ e   ( FN)   v alu es  [ 3 3 ] .   Acc u r ac y   m ea s u r es   o v er all  class if icatio n   co r r ec tn ess ,   p r ec is io n   ev alu at es  th r eliab ilit y   o f   p o s itiv p r ed ictio n s ,   R ec all  m ea s u r es  th e   ab ilit y   to   d etec all   ac tu al  p o s itiv s am p les,  a n d   th F1 - s co r e   p r o v id es  a   b alan ce d   m ea s u r e   b y   co m b in in g   p r ec is io n   an d   r ec all p ar ticu lar ly   u n d e r   class   im b al an ce   co n d itio n s   [ 3 4 ] ,   [ 3 5 ] I n   ad d itio n ,   i n ter s ec tio n   o v er   u n i o n   ( I o U)   is   u s ed   to   ass es s   th o v er lap   b etwe en   p r e d icted   an d   g r o u n d   t r u th   ( GT )   r eg io n s   in   s eg m en tatio n   task s .   B ey o n d   q u an titativ m et r ics,  q u alitativ n o d e - b ased   an al y s is   is   p er f o r m e d   o n   th e   s k el eto n izatio n   r esu lts   to   ev alu ate  s p atial   s tr u ctu r an d   in ter - n o d co n n ec ti v ity ,   d em o n s tr atin g   th s y s tem s   ef f ec tiv en ess   in   s ep ar atin g   letter   s h ap es  a n d   d i ac r itics .   T o   v er if y   th at   th clas s if icatio n   r esu lts   ar n o t   d u e   t o   r an d o m   ch an ce ,   B in o m ial  T est  is   ap p lied .   T h is   n o n - p a r am etr ic  s tatis tical  te s d eter m in es  wh eth er   th o b s er v ed   class if icatio n   ac cu r ac y   is   s ig n if ican tly   h ig h e r   th an   r an d o m   b aselin ( ty p ically   5 0 %),   th er eb y   co n f ir m in g   th v alid ity   o f   th e   s y s tem s   p er f o r m an ce .   T h b i n o m ial  test   f o r m u latio n   is   p r es en ted   in   ( 1 4 ) .       ( = ) = ( )     ( 1 )   ( 1 4 )       d en o tes  th to tal   n u m b er   o f   tr ials ,   s u ch   as  th e   n u m b er   o f   s am p les  o r   p r e d ictio n s .     r ep r ese n ts   th n u m b er   o f   s u cc ess es,  f o r   ex am p le  th e   n u m b er   o f   co r r ec p r ed ictio n s .     is   th p r o b ab ilit y   o f   s u cc e s s   u n d er   th n u ll  h y p o th esis   ( co m m o n ly   s et  to   0 . 5   f o r   r an d o m   b aselin e) .   A n d   ( )   is   th b in o m ial  co ef f icien t,  co m p u ted   as   ! ! ( ) ! .   Fo r   o n e - tailed   test ,   th p - v al u is   ca lcu lated   u s in g   ( 1 5 ) .         =   ( )     ( 1 ) =   ( 1 5 )     T h is   test   is   u s ed   to   d eter m in wh eth er   th ac tu al  p r o p o r tio n   o f   s u cc ess es  is   s ig n if ican tly   g r ea ter   ( o r   s m aller ,   d ep en d i n g   o n   th d ir ec tio n   o f   th test )   th an   th p r o b a b ilit y   a s s u m ed   u n d er   th n u ll h y p o th e s is .     Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   1 6 9 3 - 6 9 3 0   TEL KOM NI KA   T elec o m m u n   C o m p u t E C o n tr o l ,   Vo l.  24 ,   No .   2 Ap r il  20 26 1 - 1x   640   3.   RE SU L T S AN D I SCU SS I O N   3 . 1 .     P re - pro ce s s ing   r esu lt s   T h i n i t i a l   i m a g e   p r o c e s s i n g   s te p   i s   g r a y s c a l e   c o n v e r s i o n ,   w h ic h   r e m o v e s   c o l o r   i n f o r m a t i o n   a n d   r e t a i n s   o n l y   p i x e l   i n t e n s i t y   t o   f a c i li t ate   s u b s e q u e n t   p r o c e s s i n g .   A s   s h o w n   i n   F i g u r e   3 ( a ) ,   t h e   g r a y s c a l e   i m a g e   p r e s e r v es  t h e   b a s i c   s h a p e s   o f   t h A r a b i l e tt e r s   i n   t h S y ai r   Pe r a h u   m an u s c r i p t   d es p i t v a r i at i o n s   i n   in k   a n d   b a c k g r o u n d   c o l o r ,   a l l o w i n g   c l e a r e r   s e p a r ati o n   b e t w e e n   t e x t   a n d   b a c k g r o u n d   b a s e d   o n   i n t e n s i t y   d i f f e r e n c e s .   F o l l o w i n g   t h i s   s t e p ,   t h r es h o l d i n g   i s   a p p l i e d   to   c o n v e r t   t h e   g r a y s c a l e   i m a g i n t o   a   b i n a r y   ( b l a ck - a n d - w h i t e )   i m a g e ,   e n a b l i n g   e f f e c t i v e   s e p a r a ti o n   o f   l e t t e r   o b j e c t s   f r o m   t h e   b a c k g r o u n d .   T h e   O t s u   t h r e s h o l d i n g   r es u l ts   d i s p l a y   t h e   l e tt e r s   i n   w h i t e   ( v a l u e   2 5 5 )   ag ain s b l ac k   b ac k g r o u n d   ( v alu e   0 ) ,   m a k in g   th e   Ar ab ic  s cr ip t   clea r ly   d is tin g u is h ab le  an d   h ig h lig h tin g   th cu r v ed   m o r p h o lo g ical  f ea tu r es o f   Peg o n   ch a r ac ter s ,   as sh o wn   in   Fig u r 3 ( b ) .           ( a)   ( b )     Fig u r 3 .   Gr a y s ca le  an d   th r esh o ld in g   r esu lts ( a)   g r ay s ca le  i m ag an d   ( b )   b in ar y   im ag a f ter   th r esh o ld in g       B ef o r s k eleto n izatio n ,   an   ad v an ce d   p r e - p r o ce s s in g   s tag e   is   ap p lied   u s in g   m o r p h o lo g ical   o p en in g   a n d   c lo s in g   to   im p r o v letter   s tr u ctu r q u ality .   T h ese  o p e r atio n s   clea n   an d   c o m p lete  t h b i n ar y   im a g e,   t h er eb y   en h an cin g   s k eleto n   ex tr ac tio n .   Op en in g   r em o v es  s m all  n o is in tr o d u ce d   d u r in g   d ig itizatio n ,   wh ile  c lo s in g   f ill s   s m all  g ap s   to   p r eser v s tr o k co n tin u ity .   I n   th is   s tu d y ,   a   2 × 2   s q u a r s t r u ctu r in g   elem en t   ( n p . o n es(( 2 , 2 ) ,   n p . u in t8 ) )   is   u s ed ,   as  it  e f f ec tiv ely   r em o v es  n o is wh ile  p r eser v in g   f in s tr o k d etails  an d   p r e v en tin g   ad jace n letter s   f r o m   m er g in g ,   wh ich   is   s u itab le  f o r   Peg o n   m a n u s cr ip t s   with   th in   s tr o k es   an d   n a r r o s p ac in g .   T h e   p ar a m eter   s elec tio n   is   d eter m in e d   em p ir ically   th r o u g h   ex p er im en ts   o n   m u ltip le  s am p les.  Fo r   m an u s cr ip ts   with   h ig h e r   n o is lev els,  lar g er   s tr u ctu r in g   elem en ts   ( e. g . ,   3 ×3   o r   5 ×5 )   m a y   b u s ed ,   p r o v id e d   th at  s tr o k d etails  ar p r eser v ed .   T h r esu lts   o f   m o r p h o lo g ical  o p en in g   an d   m o r p h o lo g ical  clo s in g   a r s h o w n   in   Fig u r es 4   ( a)   an d   ( b ) .           ( a)   ( b )     Fig u r 4 .   Mo r p h o lo g ical  o p en i n g   an d   m o r p h o l o g ical  clo s in g   r esu lts ( a)   im ag af ter   m o r p h o lo g ical  o p e n in g   an d   ( b )   im ag a f ter   m o r p h o lo g i c lo s in g       3 . 2 .     S k elet o niza t io re s ults   T h s k eleto n   ex tr ac tio n   p r o ce s s   in   th is   s tu d y   u s es  th m o r p h o lo g ical  th in n in g   m et h o d   with   t h Z h a n g - Su en   alg o r ith m ,   wh ich   is   im p lem en ted   th r o u g h   th s k elet o n ize( )   f u n ctio n   f r o m   th s k im ag e. m o r p h o lo g y   lib r ar y .   T h is   m eth o d   wo r k s   iter ativ ely   b y   s elec tiv ely   r e m o v in g   e d g p ix els  with o u t   alter in g   th m ain   to p o lo g ical   s tr u ctu r e   o f   th e   letter s ,   r esu ltin g   in   a   o n e - p i x el  s k eleto n   th at   r ep r esen ts   th m ed i al  ax is   o f   ea c h   letter   s tr o k e.   T h s k eleto n izatio n   r es u lts   ca n   b s ee n   in   Fig u r 5 .           Fig u r 5 .   Sk eleto n izatio n   r esu l ts       Fig u r 5   s h o ws  th at  th s k eleto n   ( f r am lin es)  s u cc ess f u lly   f o l lo ws  th m ain   co n to u r s   o f   Ar a b ic  letter s ,   in clu d in g   cu r v es a n d   co n n ec tio n s   b etwe en   letter s .   T h s tr o k es o f   th letter s   h av b ee n   s u cc ess f u lly   r ed u ce d   to   th m ed ial  ax is ,   b u s till   r etain   th s h ap an d   d ir ec tio n   o f   th o r ig in al  s tr o k es.  T h is   s h o ws  th at   th m o r p h o l o g ical  Evaluation Warning : The document was created with Spire.PDF for Python.
T E L KOM NI KA   T elec o m m u n   C o m p u t E l Co n tr o l           A p p lica tio n   o f th tr a ve lin g   s a lesma n   p r o b lem  to   o p timiz s ke leto n iz a tio n   a n d   s tr o ke   r ec o n s tr u ctio n   ( A lifa h )   641   th in n in g   m et h o d   u s in g   th Z h an g - Su en   alg o r ith m   is   ef f ec ti v in   ex tr ac tin g   im p o r tan f ea tu r es  f r o m   co m p lex   letter   s h ap es.     3 . 3   T SP  re s ults   I n   th is   s tu d y ,   th e   T SP   alg o r ith m   is   ap p lied   to   s k eleto n ized   P eg o n   w o r d   im ag es  to   g en e r ate   s eq u en tial  s tr o k p ath s   th at  clo s ely   r ec o n s tr u ct  th o r ig in al  h a n d wr iti n g .   T h Gr ee d y   r e v is it  alg o r ith m   en ab les  th T SP   p ath   to   f o llo co m p lex   letter   s tr u ctu r es,  in clu d in g   lo o p s   an d   b r an ch es,  wh ile  p r eser v i n g   co n n ec tiv ity   b etwe en   s tr o k s eg m en ts .   E ac h   r esu ltin g   p ath   is   v is u alize d   as  d ir e cted   g r ap h   to   a n aly ze   its   co r r e s p o n d en ce   with   t h e   o r i g in al  letter   s h ap es.   Fo r   ev alu atio n ,   o n e   wo r d   c o n t ain in g   m u ltip le  l o o p in g   letter s   was  s elec ted   f r o m   ea ch   s eg m en ted   lin e   to   f ac ilit ate  clea r   o b s er v atio n   an d   an aly s is   o f   th g en e r ated   p ath s .   T h e   d etailed   T SP   p ath   r esu lts   ar s h o wn   in   Fig u r 6 ( a) ,   wh ile  h ig h lig h ted   lo o p   h a n d lin g   an d   r ev is itin g   b eh av io r   a r illu s tr ated   in   Fig u r 6 ( b ) .           ( a)   ( b )     Fig u r 6 .   T SP   r esu lts ( a)   o v er all  g en er ated   T SP   p ath   a n d   ( b )   d etail  v iew  o f   lo o p   tr a v er s al  an d   r ev is itin g   b eh av io r       I ca n   b e   s ee n   th at   th T SP   p ath   g en e r ated   h as  th e   ab ilit y   t o   f o llo th e   en tire   s tr u ctu r e   o f   th e   letter   with o u b r ea k in g   th p ath ,   ev en   wh en   th s tr u ctu r is   cir cu l ar   o r   b r a n ch ed .   Po in ts   v is ited   m o r th an   o n ce   ar e   m ar k ed   in   p u r p le,   in d icatin g   th at  r ev is iti n g   o cc u r s   in   th o s ar ea s   d u to   th co m p lex ity   o f   th letter   s tr u ctu r e.   T h is   m eth o d   is   ab le  to   cr ea te  p ath s   th at  m o r clo s ely   r esem b l th h an d - d r awn   s tr o k es  th at  f o r m   letter s .   Un lik e   co n v en tio n al  T SP ,   wh ich   o n ly   allo ws o n v is it p er   p o in t.     3 . 4 .     L et t er   s eg m ent a t i o n r esu lt s   Af ter   o b tain in g   t h T SP   p ath s   an d   s u b - p at h s ,   letter   s eg m en ta tio n   is   p er f o r m e d   u s in g   b o u n d in g   b o x es   f o r   ea ch   s u b - p at h .   T h p r o ce s s   s tar ts   b y   ex tr ac tin g   s k eleto n   p o in ts   an d   g en er atin g   r ig h t - to - l ef T SP   p ath   b ased   o n   E u clid ea n   d is tan ce .   T h T SP   p ath   is   th en   d iv id ed   in to   s u b - p ath s   u s in g   th s p lit_ ts p _ p ath _ b y _ d is tan ce ( )   f u n ctio n ,   wh er a   n ew  s u b - p a th   is   cr ea ted   if   th d is tan ce   b etwe en   co n s ec u tiv p o in ts   ex ce ed s   m ax im u m   th r esh o ld   ( e. g . ,   3   p ix els).   Fo r   ea ch   s u b - p ath ,   a   b o u n d i n g   b o x   is   co m p u te d   u s in g   th e   m in im u m   an d   m a x im u m   x   an d   y   c o o r d in ates,  en ab lin g   in d iv id u al  letter s   to   b c r o p p ed   in to   s ep ar ate  im ag s eg m e n ts .   T h ese  s eg m en ted   letter   im ag es  ar s av e d   in   d esig n ated   d ir ec to r y ,   with   la b el. tx t   f ile  p r ep ar e d   f o r   s u b s eq u en la b elin g .   An   ex am p le  o f   th b o u n d in g   b o x b ased   letter   s eg m en tatio n   r esu lts   is   s h o wn   in   Fig u r e s   7 ( a)   to   ( e) .                 ( a)   ( b )   ( c)   ( d )   ( e)     Fig u r 7 .   L etter   s eg m en tatio n   r esu lts :   ( a)   f ir s t seg m en ted   letter ,   ( b )   s ec o n d   s eg m e n ted   lette r ,   ( c)   th i r d   s eg m en ted   letter ,   ( d )   f o u r th   s e g m en ted   letter ,   a n d   ( e )   f if th   s eg m en ted   letter     Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   1 6 9 3 - 6 9 3 0   TEL KOM NI KA   T elec o m m u n   C o m p u t E C o n tr o l ,   Vo l.  24 ,   No .   2 Ap r il  20 26 1 - 1x   642   Fig u r 7   s h o ws  th at  t h is   m eth o d   is   ef f ec tiv in   f o llo win g   th co m p lex   s h a p es  o f   Ar a b ic  s cr ip th r o u g h   s k eleto n   p ath s   an d   s ep ar atin g   letter s   b ased   o n   th e   b o u n d in g   b o x   o f   ea ch   T SP   s u b - p ath .   T h test   r esu lts   ar e   d is p lay ed   in   th f o r m   o f   letter   s eg m en v is u ali za tio n s   an d   ex tr ac ted   im ag f iles .   T h ese  tw o   f iles   s er v as  th b asis   f o r   th letter   r ec o g n itio n   s tag in   th n ex p r o ce s s .     3 . 5 .     F CC   re s ults   I n   th is   s tu d y ,   F C C   is   u s e d   t o   an a l y z e   r e c o n s t r u c te d   l e t te r   s t r o k e s   b y   e x a m i n i n g   t h e   s h a p e   a n d   d i r e c t i o n   o f   p e n   m o v e m e n t .   A f t e r   s k e l et o n i z a t i o n   a n d   T S P - b as e d   p a th   t r a c k i n g ,   m u l t i p l e   s u b - p a t h s   r e p r e s e n t i n g   l e t te r   s k e l e t o n s   a r e   o b t a i n e d .   E ac h   s u b - p a t h   i s   t h e n   co n v er ted   in to   FC C   th r o u g h   th f o llo win g   s tep s .   First,  ea ch   s u b - p ath   is   p r o ce s s ed   s eq u en tially   as  a   s er ies  o f   ( x ,   y )   s k eleto n   c o o r d in ates.  Ne x t,  d ir ec tio n   co d es a r ass ig n ed   f o r   ea ch   p a ir   o f   co n s ec u tiv p o i n ts   u s in g   th d ir ec tio n _ co d e( )   f u n ctio n   wh en   th p o in ts   ar e   d ir ec 8 - co n n ec ted   n eig h b o r s .   I f   co n s e cu tiv p o in ts   ar n o ad jace n t,  s tep wis e   in ter p o latio n   is   ap p lied   b y   in cr em en tally   m o v in g   to war d   th tar g et  p o in b ased   o n   th s ig n   o f   co o r d i n ate  d if f er e n ce s ,   co n v er tin g   ea ch   s tep   in to   Fre em an   d ir ec tio n   c o d e.   m ax im u m   s tep   lim it is   im p o s ed   to   av o i d   in f i n ite  lo o p s   in   in v alid   p ath s .   All  g en er ated   d ir ec ti o n   co d es  ar s to r ed   as  an   a r r ay   r ep r ese n tin g   th FC C   f o r   ea ch   s u b - p ath .   An   ex am p le  o f   FC C   ex tr ac tio n   f o r   th e   wo r d   Per ah u ”  is   s h o wn   in   Fig u r 8 .   I n   Fig u r e   8 ,   t h s m all  wh ite  n u m b er s   o n   ea ch   p ath   in d icate   th d i r ec tio n   o f   m o v e m en b ased   o n   t h FC C .   Me an wh ile,   th b lu e   an d   y ello d o ts   in d icate   th s tar tin g   an d   en d in g   p o in ts   o f   ea c h   s u b - p ath .             Fig u r 8 .   FC C   g en er ated   f r o m   th wo r d ,   s tar t f r o m   t h to p   r i g h t to   th lef t       3 . 6 .     E v a lua t i o m et rics r esu lt s   Af ter   co m p letin g   all  p r e - p r o ce s s in g ,   s eg m en tatio n ,   an d   T SP - b ased   p r o ce s s in g   s tag es,  an   ev alu atio n   is   co n d u cte d   to   ass es s   th s y s te m s   ab ilit y   to   d etec an d   s eg m en letter s .   T h ev alu atio n   co m p ar es  th ex p ec ted   n u m b er   o f   ch ar ac ter s   GT   wit h   th n u m b e r   o f   ch ar ac ter s   d e tecte d   b y   th e   s y s tem   ( p r e d ictio n ) .   GT   v alu es  ar e   o b tain ed   m an u ally   f r o m   r ef e r e n ce   d ata,   wh ile   p r ed ictio n s   ar e   d er iv e d   f r o m   th e   s eg m en tatio n   r esu lts   p r o d u ce d   b y   th alg o r ith m .   I n   th is   s tu d y ,   GT   d ata  ar e   ta k en   f r o m   th f i r s p ag e   o f   th Sy air   Per ah u   m a n u s cr ip b y   r an d o m ly   s elec tin g   th r ee   lin es  ( r asm )   an d   ev alu atin g   t h em   m an u ally .   Prio r   to   lin e - lev el  e v alu atio n ,   p r elim in ar y   w o r d - lev el  ex p er im e n is   p er f o r m e d   u s in g   th wo r d   “Per ah u ”,   as  d is cu s s ed   in   th p r ev io u s   s ec tio n .   d etaile d   b r ea k d o wn   o f   th ev alu atio n   r esu lts   f o r   “Per ah u ”  is   p r esen te d   in   T ab le  1 .   T h en ,   f o r   d etailed   ex p lan atio n   o f   ea ch   E v alu atio n   v alu p er   r o w,   p lease  r ef er   to   T ab le  2 .   As  co m p lem en to   th v is u al  an aly s is ,   T ab le  3   d is p lay s   q u an titativ ev alu atio n   o f   th s eg m en tatio n   r esu lts   o n   ea c h   lin e   o f   t h m a n u s cr ip t,  wh ich   in clu d es  th e   n u m b er   o f   G T   c h ar ac ter s ,   d etec ted   ch a r ac ter s   ( DT ) ,   co r r ec tly   s eg m e n ted   c h ar ac ter s   T P,  FP ,   FN,  as  well  as  p er f o r m an ce   m etr ics  s u ch   as  ac cu r ac y ,   p r ec is io n ,   r ec all,   F1 - s co r an d   I o U.       T ab le  1 .   E v alu atio n   r esu lts   o f   th wo r d   “Per ah u   F i g u r e   P r e c i s i o n   R e c a l l   F1 - s c o r e   A c c u r a c y   I o U     0 . 6 0 0     0 . 7 5 0     0 . 6 6 7   0 . 7 5     0 . 7 0 0     Evaluation Warning : The document was created with Spire.PDF for Python.
T E L KOM NI KA   T elec o m m u n   C o m p u t E l Co n tr o l           A p p lica tio n   o f th tr a ve lin g   s a lesma n   p r o b lem  to   o p timiz s ke leto n iz a tio n   a n d   s tr o ke   r ec o n s tr u ctio n   ( A lifa h )   643   T ab le  2.   E v alu atio n   r esu lts   p er   r o w   O r i g i n a l   i ma g e   P r o c e ss e d   r e s u l t       P r e c i s i o n   R e c a l l   F1 - s c o r e   A c c u r a c y   I o U   0 . 5 9 5   0 . 8 1 5   0 . 6 8 7   0 . 8 2   0 . 5 2 4       P r e c i s i o n   R e c a l l   F1 - s c o r e   A c c u r a c y   I o U   0 . 5 5 0   0 . 7 8 6   0 . 6 4 7   0 . 7 9   0 . 5 4 3       P r e c i s i o n   R e c a l l   F1 - s c o r e   A c c u r a c y   I o U   0 . 5 1 2   0 . 8 4 6   0 . 6 3 8   0 . 8 5   0 . 5 2 0       T ab le  3 .   Deta iled   ev al u atio n   r esu lts   o f   s eg m en tatio n   s y s tem   I mag e   GT   DT   TP   FP   FN   P r e c i s i o n   R e c a l l   F1 - S c o r e   A c c u r a c y   I o U   P 0 1 - 1   27   37   22   15   5   0 . 5 9 5   0 . 8 1 5   0 . 6 8 7   0 . 8 2   0 . 5 2 4   P 0 1 - 9   28   40   22   18   6   0 . 5 5 0   0 . 7 8 6   0 . 6 4 7   0 . 7 9   0 . 5 4 3   P 0 1 - 10   26   43   22   21   4   0 . 5 1 2   0 . 8 4 6   0 . 6 3 8   0 . 8 5   0 . 5 2 0   A v e r a g e   81   1 2 0   66   54   15   0 . 5 5 2   0 . 8 1 5   0 . 6 5 7   0 . 8 2   0 . 5 2 9       As  r esu lt,  th e v a l u a t i o n   m e t r i c s   s h o w   t h at   t h e   s y s t e m   is   q u i te   g o o d   a t   r e c o g n i z i n g   t h e   n u m b e r   o f   l e t t e r s   b a s e d   o n   t h e   n u m b e r   d e t e c t e d .   H o w e v e r ,   b e c a u s e   t h e   e v al u a t i o n   o n l y   c o n s i d e r s   t h e   s u i t ab i l i t y   o f   t h e   n u m b e r   w i t h o u t   v e r i f y i n g   t h e   c o r r e c t n es s   o f   t h e   i d e n ti t y   o r   p o s i t i o n   o f   th e   l e t t e r s ,   t h e   r e s u lt s   d o   n o t   f u l ly   r e f l e c t   t h e   o v e r a l a c c u r a c y   o f   t h e   s y s t e m .   T h i s   f o c u s   w as   c h o s e n   b e c a u s e   t h e   r ese a r c h   p h a s e   i s   s t i ll   f o c u s e d   o n   r e c o n s t r u c t i n g   b as ic   s t r o k e   f o r m s   t h r o u g h   s k e l et o n iz a t i o n   an d   p ath   o p tim izatio n ,   r ath er   th an   o n   f u ll c h ar ac ter   r ec o g n itio n .   T o   ev alu ate   th tem p o r al   ac cu r ac y   o f   th s tr o k r ec o n s tr u ctio n   s eq u en ce ,   th is   s tu d y   ad d s   n o d es  at  ea ch   p o in t o f   t h T SP   tr ajec to r y .   E a ch   n o d e   r ep r esen ts   th alg o r ith m s   tr av er s al  s eq u en ce   s o   th at  th r ec o n s tr u ctio n   p r o ce s s   ca n   co n s id er   b o th   th e   s p atial  d im en s io n   an d   th tem p o r al  s eq u en ce   o f   th s tr o k e s .   T h r esu lts   o f   th e   n o d e   ad d itio n   s tr ateg y   in   th e   T SP   tr ajec to r y   a r s h o wn   in   F ig u r 9 ( a) ,   wh ich   p r esen ts   th e   o v e r all  wo r d - lev el  tr ajec to r y ,   an d   Fig u r 9 ( b ) ,   wh ich   p r o v id es a   d etailed   v iew  o f   th r ec o n s tr u cte d   s tr o k e   s eq u en ce .           ( a)   ( b )     Fig u r 9 .   I m p lem en tatio n   o f   a d d in g   n o d es o n   th T SP   p ath ( a)   g lo b al  tr ajec to r y   a f ter   n o d e   in s er tio n   an d     ( b )   m a g n if ied   v iew  illu s tr atin g   th r ef in e d   an d   co n tin u o u s   s tr o k r ec o n s tr u ctio n       T h ad d itio n   o f   s eq u en tial  n o d n u m b er in g   alo n g   th T SP   p at h   is   in ten d ed   to   r ec o r d   th tr a v er s al  o r d er   ( tem p o r al  o r d er )   o f   s tr o k r ec o n s tr u ctio n .   E ac h   n o d is   ass ig n ed   g lo b al  s eq u e n ce   n u m b er   a cr o s s   all  s u b - p ath s ,   allo win g   ev er y   s k eleto n   p o in to   b r ep r e s en ted   n o o n ly   s p a tially   b u also   tem p o r ally   b ased   o n   its   v is it  o r d er .   T h is   en ab les ev alu atio n   f r o m   t wo   p er s p ec tiv es:     Sp atial  a cc u r ac y ,   w h ich   ass ess es  wh eth er   th e   T SP   p ath   f u lly   co v er s   th e   ch ar ac ter   s h ap wit h o u m is s in g   s tr o k co m p o n en ts   Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   1 6 9 3 - 6 9 3 0   TEL KOM NI KA   T elec o m m u n   C o m p u t E C o n tr o l ,   Vo l.  24 ,   No .   2 Ap r il  20 26 1 - 1x   644     T em p o r al   a cc u r ac y ,   w h ich   e v a lu ates w h eth er   t h r ec o n s tr u ct ed   s tr o k e   o r d er   m atch es  n atu r a l h an d w r itin g   p atter n s ,   s u ch   as  c o r r ec tr a v er s al  d ir ec tio n   o r   lo o p   o r d er in g .   T h u s ,   n o d n u m b e r in g   f u n ctio n s   as  tim e - s tep   in d icato r   in   s tr o k r ec o n s tr u ctio n .   T o   f u r t h er   v alid ate  th e   ev alu a tio n   r esu lts ,   B in o m ial  T est  is   ap p lied   to   co n f ir m   th at  th e   o b s er v ed   ac cu r ac y   is   n o d u to   c h an ce   a n d   ex ce ed s   th r an d o m   b aselin ( 5 0 %).   T h h y p o th eses   ar d ef in ed   as:  h ip o tesi s   n o ( ) ;   a cc u r ac y     0 . 5 0   a n d   h i p o tesi s   alter n atif   ( ) ;   a cc u r ac y   0 . 5 0 .   Fo r   th wo r d   “Per ah u ,   th o b tain e d   p - v alu is   0 . 0 6 2 5 0 .   Alth o u g h   s lig h tly   ab o v th 0 . 0 5   s ig n if ican ce   th r esh o ld ,   th is   r esu lt   in d icate s   th at  th e   m o d el s   ac cu r ac y   is   m ar g in all y   b u co n s is ten tly   h ig h er   th an   r an d o m   g u ess in g ,   s u p p o r tin g   th claim   th at  th e   p r o p o s ed   m eth o d   d em o n s tr ate s   m ea n in g f u g en er aliza tio n   ca p ab ilit y .     3 . 7 .     Str o k re c o ns t ruct io n e v a lua t io n   T o   co m p lem en th c h ar ac ter   c o u n t - b ased   ev alu atio n ,   th is   s tu d y   ad d ed   q u an titativ e v alu a tio n   o f   t h e   ac cu r ac y   o f   th s tr o k p ath s   g en er ated   b y   th T SP   alg o r ith m .   T h e v alu atio n   was  co n d u cted   u s in g   two   m ai n   m etr ics:   a v er ag e   p ath   d e v iatio n   ( APD) ,   wh ich   m ea s u r es  th e   s p atial  ac cu r ac y   o f   th e   s tr o k e   p ath s ,   an d   tem p o r al   s eq u en ce   ac c u r ac y   ( T SA) ,   wh ich   m ea s u r es  t h co r r esp o n d e n ce   o f   th e   s tr o k e   s eq u en ce   to   th o r i g in al  wr itin g   p atter n .   T h e   r esu lts   o f   th is   q u a n titativ ev alu atio n   ar e   p r esen ted   in   T ab le  4 .       T ab le  4 .   Qu a n titativ ac cu r ac y   ass es s m en t o f   r ec o n s tr u cted   s tr o k p ath s   I mag e   A P D   ( p x )   TSA   ( %)   P 0 1 - 1   1 . 9 2   8 6 , 3 %   P 0 1 - 9   2 . 1 5   8 2 , 5 %   P 0 1 - 10   2 . 0 3   8 8 . 1 %   A v e r a g e   2 . 0 3   8 5 . 6 %       T h ev alu atio n   r esu lts   in   T ab le  4   s h o th at  th T SP   r ec o n s tr u ctio n   p ath   h as  lo s p atial  d ev iatio n ,   with   an   av er a g APD  v alu o f   2 . 0 3   p ix els,  in d icatin g   th at  th s tr o k s h ap is   clo s to   th g r o u n d - tr u th   p atter n .   I n   ad d itio n ,   th T SA  v alu o f   8 5 . 6 in d icate s   th at  m o s o f   t h tr av er s al  s eq u en ce   o f   th T SP   p ath   f o llo ws  th ac tu al  letter   wr itin g   p atter n .   T h u s ,   th s tr o k r ec o n s tr u ctio n   i s   n o o n ly   v is u ally   co r r ec t,  b u t   also   q u an titativ ely   m ea s u r ab le  in   ter m s   o f   b o t h   s h ap an d   wr itin g   s eq u e n ce .       4.   CO NCLU SI O N   T h is   s tu d y   s u cc ess f u lly   d em o n s tr ates  s k eleto n - b ased   im ag p r o ce s s in g   f r am ewo r k   f o r   Peg o n   s cr ip th at  in teg r ates  th in n i n g - b ased   s k eleto n izatio n ,   m o d if ied   T SP ,   an d   Gr ee d y   r e v is it  o p tim izatio n   to   r e co n s tr u ct   h an d wr itten   s tr o k p ath s .   T h p r o p o s ed   a p p r o ac h   ef f ec t iv ely   h an d les  co m p lex   Ar ab ic  letter   s tr u ctu r es  in v o lv in g   lo o p s   an d   b r an ch es,  en ab lin g   ac cu r ate   s tr o k tr a v er s al  an d   letter   s eg m en tatio n   u s in g   E u clid ea n - d is tan ce b ased   s u b - p at h   s ep a r atio n   an d   b o u n d in g   b o x   cr o p p in g .   E x p er im en tal  r esu lts   s h o th at  th s y s tem   ac h iev es  an   av er a g p r ec is io n   o f   0 . 5 5 2 ,   r ec all  o f   0 . 8 1 5 ,   F1 - s co r o f   0 . 6 5 7 ,   an d   ac cu r ac y   o f   8 2 %,  in d icatin g   r eliab le  p er f o r m an ce   i n   d etec ti n g   an d   s eg m en tin g   Peg o n   lette r s   b ased   o n   c h ar ac ter   co u n t.   T o   f u r t h er   v alid ate  th ef f ec tiv en ess   o f   s tr o k r ec o n s tr u ctio n ,   q u an titativ ev al u atio n   u s in g   APD  an d   T SA  was   co n d u cted .   T h r esu l ts   s h o lo av er ag APD  o f   2 . 0 3   p ix els  an d   h ig h   T SA  o f   8 5 . 6 %,  co n f ir m in g   th at  th r ec o n s tr u cted   p ath s   cl o s ely   f o llo b o t h   th s p atial  s h ap an d   tem p o r al  wr itin g   s eq u en ce   o f   th o r ig in al  h an d wr itin g .   T h ese  f in d in g s   d e m o n s tr ate  th at  th p r o p o s ed   T S P - b ased   s tr o k r ec o n s tr u ctio n   i s   n o o n ly   v is u ally   co h er en t b u t a ls o   q u an titativ ely   ac cu r ate.   Alth o u g h   th cu r r e n t e v alu atio n   f o cu s es o n   s eg m en tatio n   an d   s tr o k e   r ec o n s tr u ctio n   r ath er   th an   f u ll   ch ar ac ter   r ec o g n itio n ,   th r esu lts   p r o v id s tr o n g   f o u n d ati o n   f o r   f u tu r w o r k   th at  in co r p o r ates  c h ar ac ter   cla s s if icatio n   an d   s p atial  c o n tex t   an aly s is   to   s u p p o r t   co m p lete  Peg o n   m an u s cr ip t   tr an s cr ip tio n .       F UNDING   I NF O R M A T I O N   T h au th o r s   ar g r atef u f o r   th f u n d i n g   s u p p o r f r o m   Un iv er s itas   Yu d h ar ta  Pas u r u an   an d   R esear ch   C en ter   f o r   Ar tific ial  I n tellig e n ce   an d   C y b er s ec u r ity ,   Nati o n al  R esear ch   an d   I n n o v atio n   Ag en cy   ( B R I N) ,   B an d u n g   wh ic h   h as c o n t r ib u te d   to   th im p lem en tatio n   o f   th i s   r esear ch .       AUTHO CO NT RI B UT I O NS ST A T E M E N T   T h is   jo u r n al  u s es  th C o n tr ib u to r   R o les  T ax o n o m y   ( C R ed iT)   to   r ec o g n ize  in d iv id u al  au th o r   co n tr ib u tio n s ,   r ed u ce   au th o r s h ip   d is p u tes an d   f ac ilit ate  co lla b o r atio n .   Evaluation Warning : The document was created with Spire.PDF for Python.