Javascript¤ÇºÙÀþ²½
¥×¥í¥°¥é¥à¥á¥â | 2013/10/19 Sat 21:49
| £²ÃͲ½²èÁü¤Î¥é¥¤¥ó¤òºÙÀþ²½¤¹¤ë¥¢¥ë¥´¥ê¥º¥à¤ÏÂô»³¤¢¤ê¤Þ¤¹¤¬¡¢
¥ë¡¼¥×²ó¿ô¤¬¤É¤¦¤·¤Æ¤â¿¤¯¤Ê¤ë¤Î¤Ç¡¢javascript¤Ç¤Î¼ÂÁõÎã¤Ï¾¯¤Ê¤¤¤Ç¤¹¡£
¤³¤³¤Ç¤Ï¡¢Èæ³ÓŪ¹â®¤ÊZhang-Suen, NWG¤È¡¢Åļ¤ÎÊý¼°¤ò¼ÂÁõ¤·¤Æ¤ß¤Þ¤¹¡£
¼Â¹Ô¥µ¥ó¥×¥ë¤Ï¤³¤Á¤é
Zhang-Suen¤Î¥¢¥ë¥´¥ê¥º¥à¤Ï¡¢Èæ³ÓŪñ½ã¤Ç¤¢¤ë¤Î¤Ç¼ÂÁõ¤·°×¤¤¤Ç¤¹¡£
¥é¥¹¥¿¥¹¥¥ã¥ó¤Ë¤è¤ê²èÁǾðÊó¤òÆɤ߹þ¤ß¡¢
Ä´ºº²èÁǤò´Þ¤à¡¢3x3pix¤Î²èÁÇÃͤËÂФ·¡¢3¼ï¤Î¾ò·ï¤òËþ¤¿¤·¤Æ¤¤¤ì¤Ð¡¢
Ä´ºº²èÁǤòÇò(1)¤«¤é¹õ(0)¤ËÃÖ¤´¹¤¨¤Þ¤¹¡£
Ä´ºº²èÁÇ(P1)¤ò´Þ¤à¡¢3x3pix¤Î²èÁǤ˼¡¤Î¤è¤¦¤ËÈÖ¹æ¤ò¿¶¤ë¡£
¾ò·ï£±¡¥
¾ò·ï£²¡¥
¾ò·ï£³(1)¡¥
¾ò·ï£³(2)¡¥
¤Þ¤º¡¢¾ò·ï£±¡¥£²¡¥£³(1)¤ÎȽÄê¤ò¹Ô¤¤¡¢¾ò·ï¤òËþ¤¿¤·¤¿¾ì¹ç¡¢³ºÅö²èÁǤò½üµî¥ê¥¹¥È¤ËÄɲ乤롣
Á´²èÁÇÄ´ºº¸å¡¢½üµî¥ê¥¹¥È¤Ë²èÁǤ¬¤¢¤ì¤Ð¡¢¤½¤Î²èÁǤòÁ´¤Æ¹õ(0)¤ËÊѤ¨¤ë¡£¤Ê¤±¤ì¤Ð½ªÎ»¤¹¤ë¡£
¼¡¤Ë¡¢¾ò·ï£±¡¥£²¡¥£³(2)¤ÎȽÄê¤ò¹Ô¤¤¡¢Æ±ÍͤνèÍý¤ò³¤±¤ë¡£
°Ê¹ß¡¢¾ò·ï£³(1)(2)¤òÀÚ¤êÂؤ¨¤Ê¤¬¤é¡¢¾ò·ï¤òËþ¤¿¤¹²èÁǤ¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç¡¢·«¤êÊÖ¤·¹Ô¤¦¡£
NWG (Nagendraprasad-Wang-Gupta)¤Ë¤Ä¤¤¤Æ ¤Ï¡¢Zhang-Suen¤ÈÈó¾ï¤Ë»÷¤¿½èÍý¤Ç¤¢¤ë¤¿¤á¡¢
ÀâÌÀ¤Ï³ä°¦¤·¤Þ¤¹¡£
¾ÜºÙ¤Ï¡¢¥½¡¼¥¹¥³¡¼¥É¤«¡¢
A note on the Nagendraprasad-Wang-Gupta thinning algorithm ¤ò¤´Í÷¤¯¤À¤µ¤¤¡£
Zhang-Suen¤Î¥¢¥ë¥´¥ê¥º¥à¤¬¼ç¤Ë·×»»¤Ë¤è¤ëȽÄê¤ò¹Ô¤¦¤Î¤ËÂФ·¡¢
Åļ¤Î¥¢¥ë¥´¥ê¥º¥à¤Ï¡¢¿Þ·Á¤Î¥Þ¥Ã¥Á¥ó¥°¤òÍøÍѤ·¤Þ¤¹¡£
Âç¤Þ¤«¤Ê½èÍý¤È¤·¤Æ¤Ï¡¢
2¼ïÎà¤Î¥Ñ¥¿¡¼¥ó¤¬¤¢¤ê¡¢¤½¤ì¤¾¤ì¤Î¥Ñ¥¿¡¼¥ó¤Ï¡¢
3x3¤Î½üµî¥Ñ¥¿¡¼¥ó¤È3x3¤ÎÈó½üµî¥Ñ¥¿¡¼¥ó¤Ëʬ¤«¤ì¤ë¡£
¡Ê¤³¤³¤Ç¸À¤¦½üµî¤Ï¡¢Çò¤«¤é¹õ¤Ø¤ÎÊѹ¹¤ò°ÕÌ£¤¹¤ë¡£¡Ë
¥é¥¹¥¿¥¹¥¥ã¥ó¤Ë¤è¤ê²èÁǾðÊó¤òÆɤ߹þ¤ß¡¢
³Æ²èÁǤˤĤ¤¤Æ3x3¤Î¥Ñ¥¿¡¼¥ó¥Þ¥Ã¥Á¥ó¥°¤ò¹Ô¤¦¡£
¥Ñ¥¿¡¼¥ó¤Ë¤Ï¼¡¤Î¤â¤Î¤¬¤¢¤ë¡£
¡Ú½èÍý³µÍסÛ
¡ ¥Ñ¥¿¡¼¥ó£±¤Î½üµî¥Ñ¥¿¡¼¥ó¤Ç¥Þ¥Ã¥Á¥ó¥°¤¹¤ì¤Ð¢¤Ø¡¢°ìÃפ·¤Ê¤±¤ì¤Ð¼¡²èÁǤء£
¢ ¥Ñ¥¿¡¼¥ó£±¤ÎÈó½üµî¥Ñ¥¿¡¼¥ó¤Ç¥Þ¥Ã¥Á¥ó¥°¤¹¤ì¤Ð¼¡²èÁǤء¢°ìÃפ·¤Ê¤±¤ì¤Ð£¤Ø¡£
£ ³ºÅö²èÁǤò½üµî¥ê¥¹¥È¤ËÄɲä·¡¢¼¡²èÁǤء£
¤ ¡¡Á£¤Î½èÍý¤òÁ´²èÁǤËÂФ·¤Æ¹Ô¤¦¡£
¥ ½üµî¥ê¥¹¥È¤Ë²èÁǤ¬¤¢¤ì¤Ð¡¢¤½¤Î²èÁǤòÁ´¤Æ¹õ(0)¤ËÊѤ¨¤ë¡£¤Ê¤±¤ì¤Ð½ªÎ»¡£
¦ ¥Ñ¥¿¡¼¥ó£²¤Î½üµî¥Ñ¥¿¡¼¥ó¤Ç¥Þ¥Ã¥Á¥ó¥°¤¹¤ì¤Ð§¤Ø¡¢°ìÃפ·¤Ê¤±¤ì¤Ð¼¡²èÁǤء£
§ ¥Ñ¥¿¡¼¥ó£²¤ÎÈó½üµî¥Ñ¥¿¡¼¥ó¤Ç¥Þ¥Ã¥Á¥ó¥°¤¹¤ì¤Ð¼¡²èÁǤء¢°ìÃפ·¤Ê¤±¤ì¤Ð¨¤Ø¡£
¨ ³ºÅö²èÁǤò½üµî¥ê¥¹¥È¤ËÄɲä·¡¢¼¡²èÁǤء£
© ¦¡Á¨¤Î½èÍý¤òÁ´²èÁǤËÂФ·¤Æ¹Ô¤¦¡£
ª ½üµî¥ê¥¹¥È¤Ë²èÁǤ¬¤¢¤ì¤Ð¡¢¤½¤Î²èÁǤòÁ´¤Æ¹õ(0)¤ËÊѤ¨¤ë¡£¤Ê¤±¤ì¤Ð½ªÎ»¡£
« ¡¤ËÌá¤ë¡£
¡Ú¥Þ¥Ã¥Á¥ó¥°¥³¡¼¥ÉÎã¡Û
ÀâÌÀ¤Î°Ù¤Ë¡¢3x3pix¤Çɽ¸½¤µ¤ì¤ë£±¤Ä¤Î¥Ñ¥¿¡¼¥ó¤ËP0¡ÁP8¤ÎÈÖ¹æ¤ò¿¶¤ê¤Þ¤¹¡£
P0¡ÁP8¤ò³Æ2bit¤Çɽ¤¹¤â¤Î¤È¤·¡¢
Çòbit:10, ¹õbit:01, ¤É¤Á¤é¤Ç¤âÎɤ¤¤â¤Î¤Ïbit:00¡¡¤È¤·¤Þ¤¹¡£
³ÆÎó¤ÎÀèƬ2bit¤Ë00¤òÉղä·¡¢£±¥Ð¥¤¥È/Îó¤Çɽ¸½¤¹¤ë¤È¡¢
£±¥Ñ¥¿¡¼¥ó¤Ï£³¥Ð¥¤¥È¤Ë¤Ê¤ê¤Þ¤¹¡£
Î㤨¤Ð¡¢¥Ñ¥¿¡¼¥ó£±¤Î½üµî¥Ñ¥¿¡¼¥ó¤Ç¤¢¤ì¤Ð¡¢
¤³¤³¤Ç¡¢¤¢¤ë²èÁǤò´Þ¤à3x3pix¤Î¾õÂÖ¤¬¼¡¤ÎÍͤˤʤäƤ¤¤ë¤È¤¹¤ë¤È
¤³¤ì¤Ï¡¢¥Ñ¥¿¡¼¥ó£±¡¦Èó½üµî¥Ñ¥¿¡¼¥ó¤Î6ÈÖÌܤȥޥåÁ¤·¤Þ¤¹¡£
Èó½üµî¥Ñ¥¿¡¼¥ó(6)¤Ï¡¢P = 0x040A04¤Çɽ¸½¤µ¤ì¤ë¤Î¤Ç
G AND P = P ¤¬À®¤êΩ¤Ä¡£
¤³¤ÎÏÀÍý¼°¤¬À®¤êΩ¤Ä¾ì¹ç¤Ë¡¢¥Ñ¥¿¡¼¥ó¥Þ¥Ã¥Á¤ÈǧÄê¤Ç¤¤Þ¤¹¡£
Åļ¤ÎÊý¼°¤Ç¤Ï¡¢¤½¤ì¤Û¤É¥Ñ¥¿¡¼¥ó¤¬Â¿¤¯¤Ê¤¤¤Î¤Ç¡¢
³ä¤È´Êñ¤Ê¥³¡¼¥Ç¥£¥ó¥°¤ÇºÑ¤ß¤Þ¤¹¡£
ÀâÌÀ¤Ç¤Ïºï½ü¥ê¥¹¥È¤ò»È¤Ã¤Æ¤¤¤Þ¤¹¤¬¡¢¸µ¥Ç¡¼¥¿¤òTypedArray(Uint8Array)¤Ë¥³¥Ô¡¼¤·¤¿Êý¤¬Áᤫ¤Ã¤¿¤Î¤Ç¡¢
¼ÂÁõ¤Ç¤Ï¡¢ÊѤ¨¤Æ¤¤¤Þ¤¹¡£(ÆâÍÆŪ¤ËÊѤï¤ë¤â¤Î¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£)
Zhang-Suen,NWG,Åļ¤Ç¡¢¤É¤ÎÊýË¡¤¬Îɤ¤¤«¤Ï¡¢ÆþÎϲèÁü¤Ë¤è¤Ã¤ÆÊѤï¤ë¤Î¤Ç°ì³µ¤Ë¤Ï¸À¤¨¤Þ¤»¤ó¡£
¥µ¥ó¥×¥ë¤òÆ°¤«¤¹¤È¤ï¤«¤ê¤Þ¤¹¤¬¡¢½èÍý»þ´Ö¤Ë´Ø¤·¤Æ¤Ï¡¢NWG¤è¤ê¡¢Zhang-Suen¤ÎÊý¤¬Áᤤ¤Ç¤¹¡£
NWG¤Ï¡¢Zhang-Suen¤Î²þÎÉÈǤǤ¢¤ë¤¿¤á¼ã´³½èÍý¤¬Áý¤¨¤Æ¤¤¤ë¤¿¤á¤Ç¤¹¡£
¿Í´Ö¤ÎÌܤǸ«¤ë¤È¶Ï¤«¤Ê°ã¤¤¤Ç¤¹¤¬¡¢NWG¤ÎÊý¤¬åºÎï¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤è¤¦¤Ç¤¹¡£
Åļ¤Ë´Ø¤·¤Æ¤Ï¡¢¥µ¥ó¥×¥ë¤Î²èÁü£±¡¦²èÁü£²¤Ç¤Ï®ÅÙ¤¬Îô¤ê¤Þ¤¹¤¬¡¢²èÁü£³¤Ç¤Ï°µÅÝŪ¤ËÁᤤ¤Ç¤¹¡£
ʸ»ú·Ï¤Ç¤Ï̯¤Ê¤Ò¤²¤¬½Ð¤ä¤¹¤¤¤Ç¤¹¤¬¡¢¼Ì¿¿Åù¤Î¥¨¥Ã¥¸Ãê½Ð²èÁü¤ËÂФ·¤Æ¤ÏÎɤ¤·ë²Ì¤¬½Ð¤Æ¤¤¤Þ¤¹¡£
(ÏÀʸȯɽ½ç¤Ç¤Ï¡¢¡ÚHilditch(1968)¡Û¢ª¡ÚÅļ(1978)¡Û¢ª¡ÚZhang-Suen(1984)¡Û¢ª¡ÚNWG(1989)¡Û)
º£²ó¼ÂÁõ¤·¤Æ¤¤¤Þ¤»¤ó¤¬¡¢
Hilditch¤ÎÊýË¡¤ÏºÙÀþ²½½èÍý¤Î¸µÁĤȤâ¸À¤¨¤Þ¤¹¤¬¡¢½½Ê¬¤Ê·ë²Ì¤¬ÆÀ¤é¤ì¤Ê¤¤¾ì¹ç¤¬¤¢¤ë¤é¤·¤¤¡£
Rosenfeld¤Ï¡¢Zhang-Suen,NWG,Åļ¤ËÈæ¤Ù¡¢¤«¤Ê¤ê½èÍý¤¬½Å¤¯¤Ê¤ë¤é¤·¤¤¡£
¡Ê»²¹Í¡§ Comparing Hilditch, Rosenfeld, Zhang-Suen,and Nagendraprasad - Wang-Gupta Thinning ¡Ë
¼Â¹Ô¥µ¥ó¥×¥ë¤Ï¤³¤Á¤é
IE10/Chrome/FF/Android¤Ç¡¢³Îǧ¤·¤Æ¤¤¤Þ¤¹¡£
IE9¤Ï¡¢TypedArray(Uint8Array)¤ËÂбþ¤·¤Æ¤¤¤Ê¤¤¤Î¤Ç¡¢ºï½ü¥ê¥¹¥È¤ò»È¤¦Êý¼°¤Ë½¤Àµ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
IE10¤Ç¤â¡¢Uint8ClampedArray¡Ê˰ϱ黻ÉÕ¤8bit¡Ë¤Ë¤ÏÂбþ¤·¤Æ¤¤¤Ê¤¤¤Î¤Ç¡¢
¤³¤Î¥µ¥ó¥×¥ë¤Ç¤Ï¡¢Uint8Array¤ò»È¤Ã¤Æ¤¤¤Þ¤¹¡£
(Chrome,FF¤Ç¤Î¡¢ImageData.data¤Î·¿¤ÏUint8ClampedArray¤Ç¤¹¡£)
¤³¤Î¥ë¡¼¥×¿ô¤Ë¤Ê¤ë¤ÈChrome¤äFF¤Ï®¤¤¤Ç¤¹¤¬¡¢IE¤À¤È¤«¤Ê¤êÃÙ¤¤¤Î¤Ç¡¢
²èÁü¥µ¥¤¥º¤Ë¤è¤Ã¤Æ¤Ï¡¢Web Workers¤Ë¤è¤ë¥Þ¥ë¥Á¥¹¥ì¥Ã¥É²½¤ò¸¡Æ¤¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
⤷¡¢IE¤Ç¤ÏImageData.data¤Î·¿(CanvasPixelArray)¤¬°Û¤Ê¤ë¤Î¤Ç¡¢Ãí°Õ¤¬É¬ÍפǤ¹¡£
--------------- ʸ¸¥ ---------------
¡ÚÅļ¤ÎÊý¼°¡Û
H. Tamura: A comparison of line thinning algorithms from digital geometry viewpoint, Proc. 4th Int. Joint Conf. on Pattern Recognition, pp. 715 - 719 (1978.11)
¡ÚZhang-Suen¤ÎÊý¼°¡Û
Zhang, T. Y. and Suen, Ching Y., ¡ÈA Fast Parallel Algorithms ForThinning Digital Patterns¡É,Communication of the ACM,Vol 27, No. 3,Maret 1984, pp.236-239.
¡ÚNWG¤ÎÊý¼°¡Û
P.S.P. Wang and Y.Y. Zhang (1989). A fast and flexible thinning algo-rithm. IEEE Transactions on Computation C-38, 741–745
Tags: ¥×¥í¥°¥é¥à¥á¥â
¥ë¡¼¥×²ó¿ô¤¬¤É¤¦¤·¤Æ¤â¿¤¯¤Ê¤ë¤Î¤Ç¡¢javascript¤Ç¤Î¼ÂÁõÎã¤Ï¾¯¤Ê¤¤¤Ç¤¹¡£
¤³¤³¤Ç¤Ï¡¢Èæ³ÓŪ¹â®¤ÊZhang-Suen, NWG¤È¡¢Åļ¤ÎÊý¼°¤ò¼ÂÁõ¤·¤Æ¤ß¤Þ¤¹¡£
¼Â¹Ô¥µ¥ó¥×¥ë¤Ï¤³¤Á¤é
Zhang-Suen¤Î¥¢¥ë¥´¥ê¥º¥à¤Ï¡¢Èæ³ÓŪñ½ã¤Ç¤¢¤ë¤Î¤Ç¼ÂÁõ¤·°×¤¤¤Ç¤¹¡£
¥é¥¹¥¿¥¹¥¥ã¥ó¤Ë¤è¤ê²èÁǾðÊó¤òÆɤ߹þ¤ß¡¢
Ä´ºº²èÁǤò´Þ¤à¡¢3x3pix¤Î²èÁÇÃͤËÂФ·¡¢3¼ï¤Î¾ò·ï¤òËþ¤¿¤·¤Æ¤¤¤ì¤Ð¡¢
Ä´ºº²èÁǤòÇò(1)¤«¤é¹õ(0)¤ËÃÖ¤´¹¤¨¤Þ¤¹¡£
Ä´ºº²èÁÇ(P1)¤ò´Þ¤à¡¢3x3pix¤Î²èÁǤ˼¡¤Î¤è¤¦¤ËÈÖ¹æ¤ò¿¶¤ë¡£
¾ò·ï£±¡¥
¡¡³°¼þ°ì¼þ¤òį¤á¤¿»þ¡¢
¡¡(P2->P3->P4->P5->P6->P7->P8->P9->P2)
¡¡¹õ¢ªÇò¤È¤Ê¤ëʤӤ¬°ì¤Ä¤À¤±¤Ç¤¢¤ë¤³¤È¡£
¡¡(±Ñʸ:A(P1)=number of 0,1 patterns(transitions from 0 to 1) in the ordered sequence of P2,P3,P4,P5,P6,P7,P8,P9,P2.
¡¡Condition: A(P1) = 1 )
¾ò·ï£²¡¥
¡¡³°¼þ¤Î²Ã»»(Çò¤Ê¤é+1)¤Î·ë²Ì(B)¤¬¡¢2<= B <=6¡¢¤òËþ¤¿¤¹¡£
¡¡(±Ñʸ:B(P1)=P2+P3+P4+P5+P6+P7+P8+P9 (number of nonzero neighbords of P1.)
¡¡Condition: 2 <= B(P1) <= 6 )
¾ò·ï£³(1)¡¥
¡¡P2 x P4 x P6 = 0 ¤«¤Ä¡¢P4 x P6 x P8 = 0 ¤òËþ¤¿¤¹¡£
¾ò·ï£³(2)¡¥
¡¡P2 x P4 x P8 = 0 ¤«¤Ä¡¢P2 x P6 x P8 = 0 ¤òËþ¤¿¤¹¡£
¤Þ¤º¡¢¾ò·ï£±¡¥£²¡¥£³(1)¤ÎȽÄê¤ò¹Ô¤¤¡¢¾ò·ï¤òËþ¤¿¤·¤¿¾ì¹ç¡¢³ºÅö²èÁǤò½üµî¥ê¥¹¥È¤ËÄɲ乤롣
Á´²èÁÇÄ´ºº¸å¡¢½üµî¥ê¥¹¥È¤Ë²èÁǤ¬¤¢¤ì¤Ð¡¢¤½¤Î²èÁǤòÁ´¤Æ¹õ(0)¤ËÊѤ¨¤ë¡£¤Ê¤±¤ì¤Ð½ªÎ»¤¹¤ë¡£
¼¡¤Ë¡¢¾ò·ï£±¡¥£²¡¥£³(2)¤ÎȽÄê¤ò¹Ô¤¤¡¢Æ±ÍͤνèÍý¤ò³¤±¤ë¡£
°Ê¹ß¡¢¾ò·ï£³(1)(2)¤òÀÚ¤êÂؤ¨¤Ê¤¬¤é¡¢¾ò·ï¤òËþ¤¿¤¹²èÁǤ¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç¡¢·«¤êÊÖ¤·¹Ô¤¦¡£
NWG (Nagendraprasad-Wang-Gupta)¤Ë¤Ä¤¤¤Æ ¤Ï¡¢Zhang-Suen¤ÈÈó¾ï¤Ë»÷¤¿½èÍý¤Ç¤¢¤ë¤¿¤á¡¢
ÀâÌÀ¤Ï³ä°¦¤·¤Þ¤¹¡£
¾ÜºÙ¤Ï¡¢¥½¡¼¥¹¥³¡¼¥É¤«¡¢
A note on the Nagendraprasad-Wang-Gupta thinning algorithm ¤ò¤´Í÷¤¯¤À¤µ¤¤¡£
Zhang-Suen¤Î¥¢¥ë¥´¥ê¥º¥à¤¬¼ç¤Ë·×»»¤Ë¤è¤ëȽÄê¤ò¹Ô¤¦¤Î¤ËÂФ·¡¢
Åļ¤Î¥¢¥ë¥´¥ê¥º¥à¤Ï¡¢¿Þ·Á¤Î¥Þ¥Ã¥Á¥ó¥°¤òÍøÍѤ·¤Þ¤¹¡£
Âç¤Þ¤«¤Ê½èÍý¤È¤·¤Æ¤Ï¡¢
2¼ïÎà¤Î¥Ñ¥¿¡¼¥ó¤¬¤¢¤ê¡¢¤½¤ì¤¾¤ì¤Î¥Ñ¥¿¡¼¥ó¤Ï¡¢
3x3¤Î½üµî¥Ñ¥¿¡¼¥ó¤È3x3¤ÎÈó½üµî¥Ñ¥¿¡¼¥ó¤Ëʬ¤«¤ì¤ë¡£
¡Ê¤³¤³¤Ç¸À¤¦½üµî¤Ï¡¢Çò¤«¤é¹õ¤Ø¤ÎÊѹ¹¤ò°ÕÌ£¤¹¤ë¡£¡Ë
¥é¥¹¥¿¥¹¥¥ã¥ó¤Ë¤è¤ê²èÁǾðÊó¤òÆɤ߹þ¤ß¡¢
³Æ²èÁǤˤĤ¤¤Æ3x3¤Î¥Ñ¥¿¡¼¥ó¥Þ¥Ã¥Á¥ó¥°¤ò¹Ô¤¦¡£
¥Ñ¥¿¡¼¥ó¤Ë¤Ï¼¡¤Î¤â¤Î¤¬¤¢¤ë¡£
¡Ú½èÍý³µÍסÛ
¡ ¥Ñ¥¿¡¼¥ó£±¤Î½üµî¥Ñ¥¿¡¼¥ó¤Ç¥Þ¥Ã¥Á¥ó¥°¤¹¤ì¤Ð¢¤Ø¡¢°ìÃפ·¤Ê¤±¤ì¤Ð¼¡²èÁǤء£
¢ ¥Ñ¥¿¡¼¥ó£±¤ÎÈó½üµî¥Ñ¥¿¡¼¥ó¤Ç¥Þ¥Ã¥Á¥ó¥°¤¹¤ì¤Ð¼¡²èÁǤء¢°ìÃפ·¤Ê¤±¤ì¤Ð£¤Ø¡£
£ ³ºÅö²èÁǤò½üµî¥ê¥¹¥È¤ËÄɲä·¡¢¼¡²èÁǤء£
¤ ¡¡Á£¤Î½èÍý¤òÁ´²èÁǤËÂФ·¤Æ¹Ô¤¦¡£
¥ ½üµî¥ê¥¹¥È¤Ë²èÁǤ¬¤¢¤ì¤Ð¡¢¤½¤Î²èÁǤòÁ´¤Æ¹õ(0)¤ËÊѤ¨¤ë¡£¤Ê¤±¤ì¤Ð½ªÎ»¡£
¦ ¥Ñ¥¿¡¼¥ó£²¤Î½üµî¥Ñ¥¿¡¼¥ó¤Ç¥Þ¥Ã¥Á¥ó¥°¤¹¤ì¤Ð§¤Ø¡¢°ìÃפ·¤Ê¤±¤ì¤Ð¼¡²èÁǤء£
§ ¥Ñ¥¿¡¼¥ó£²¤ÎÈó½üµî¥Ñ¥¿¡¼¥ó¤Ç¥Þ¥Ã¥Á¥ó¥°¤¹¤ì¤Ð¼¡²èÁǤء¢°ìÃפ·¤Ê¤±¤ì¤Ð¨¤Ø¡£
¨ ³ºÅö²èÁǤò½üµî¥ê¥¹¥È¤ËÄɲä·¡¢¼¡²èÁǤء£
© ¦¡Á¨¤Î½èÍý¤òÁ´²èÁǤËÂФ·¤Æ¹Ô¤¦¡£
ª ½üµî¥ê¥¹¥È¤Ë²èÁǤ¬¤¢¤ì¤Ð¡¢¤½¤Î²èÁǤòÁ´¤Æ¹õ(0)¤ËÊѤ¨¤ë¡£¤Ê¤±¤ì¤Ð½ªÎ»¡£
« ¡¤ËÌá¤ë¡£
¡Ú¥Þ¥Ã¥Á¥ó¥°¥³¡¼¥ÉÎã¡Û
ÀâÌÀ¤Î°Ù¤Ë¡¢3x3pix¤Çɽ¸½¤µ¤ì¤ë£±¤Ä¤Î¥Ñ¥¿¡¼¥ó¤ËP0¡ÁP8¤ÎÈÖ¹æ¤ò¿¶¤ê¤Þ¤¹¡£
P0¡ÁP8¤ò³Æ2bit¤Çɽ¤¹¤â¤Î¤È¤·¡¢
Çòbit:10, ¹õbit:01, ¤É¤Á¤é¤Ç¤âÎɤ¤¤â¤Î¤Ïbit:00¡¡¤È¤·¤Þ¤¹¡£
³ÆÎó¤ÎÀèƬ2bit¤Ë00¤òÉղä·¡¢£±¥Ð¥¤¥È/Îó¤Çɽ¸½¤¹¤ë¤È¡¢
£±¥Ñ¥¿¡¼¥ó¤Ï£³¥Ð¥¤¥È¤Ë¤Ê¤ê¤Þ¤¹¡£
Î㤨¤Ð¡¢¥Ñ¥¿¡¼¥ó£±¤Î½üµî¥Ñ¥¿¡¼¥ó¤Ç¤¢¤ì¤Ð¡¢
¤³¤³¤Ç¡¢¤¢¤ë²èÁǤò´Þ¤à3x3pix¤Î¾õÂÖ¤¬¼¡¤ÎÍͤˤʤäƤ¤¤ë¤È¤¹¤ë¤È
¤³¤ì¤Ï¡¢¥Ñ¥¿¡¼¥ó£±¡¦Èó½üµî¥Ñ¥¿¡¼¥ó¤Î6ÈÖÌܤȥޥåÁ¤·¤Þ¤¹¡£
Èó½üµî¥Ñ¥¿¡¼¥ó(6)¤Ï¡¢P = 0x040A04¤Çɽ¸½¤µ¤ì¤ë¤Î¤Ç
G AND P = P ¤¬À®¤êΩ¤Ä¡£
¤³¤ÎÏÀÍý¼°¤¬À®¤êΩ¤Ä¾ì¹ç¤Ë¡¢¥Ñ¥¿¡¼¥ó¥Þ¥Ã¥Á¤ÈǧÄê¤Ç¤¤Þ¤¹¡£
Åļ¤ÎÊý¼°¤Ç¤Ï¡¢¤½¤ì¤Û¤É¥Ñ¥¿¡¼¥ó¤¬Â¿¤¯¤Ê¤¤¤Î¤Ç¡¢
³ä¤È´Êñ¤Ê¥³¡¼¥Ç¥£¥ó¥°¤ÇºÑ¤ß¤Þ¤¹¡£
ºÙÀþ²½¥µ¥ó¥×¥ë
²èÁü¤òÁª¤ó¤Ç¤«¤é¡¢Åļ or Zhang-Suen oe NWG ¤ò¥¯¥ê¥Ã¥¯¡ª
¡ÊChrome,FireFox¤À¤È0.5ÉÃÄøÅ٤Ǥ¹¤¬¡¢IE10¤À¤ÈÊÑ´¹¤Ë5ÉÃÄøÅٳݤê¤Þ¤¹¡£¡Ë
ÀâÌÀ¤Ç¤Ïºï½ü¥ê¥¹¥È¤ò»È¤Ã¤Æ¤¤¤Þ¤¹¤¬¡¢¸µ¥Ç¡¼¥¿¤òTypedArray(Uint8Array)¤Ë¥³¥Ô¡¼¤·¤¿Êý¤¬Áᤫ¤Ã¤¿¤Î¤Ç¡¢
¼ÂÁõ¤Ç¤Ï¡¢ÊѤ¨¤Æ¤¤¤Þ¤¹¡£(ÆâÍÆŪ¤ËÊѤï¤ë¤â¤Î¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£)
Zhang-Suen,NWG,Åļ¤Ç¡¢¤É¤ÎÊýË¡¤¬Îɤ¤¤«¤Ï¡¢ÆþÎϲèÁü¤Ë¤è¤Ã¤ÆÊѤï¤ë¤Î¤Ç°ì³µ¤Ë¤Ï¸À¤¨¤Þ¤»¤ó¡£
¥µ¥ó¥×¥ë¤òÆ°¤«¤¹¤È¤ï¤«¤ê¤Þ¤¹¤¬¡¢½èÍý»þ´Ö¤Ë´Ø¤·¤Æ¤Ï¡¢NWG¤è¤ê¡¢Zhang-Suen¤ÎÊý¤¬Áᤤ¤Ç¤¹¡£
NWG¤Ï¡¢Zhang-Suen¤Î²þÎÉÈǤǤ¢¤ë¤¿¤á¼ã´³½èÍý¤¬Áý¤¨¤Æ¤¤¤ë¤¿¤á¤Ç¤¹¡£
¿Í´Ö¤ÎÌܤǸ«¤ë¤È¶Ï¤«¤Ê°ã¤¤¤Ç¤¹¤¬¡¢NWG¤ÎÊý¤¬åºÎï¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤è¤¦¤Ç¤¹¡£
Åļ¤Ë´Ø¤·¤Æ¤Ï¡¢¥µ¥ó¥×¥ë¤Î²èÁü£±¡¦²èÁü£²¤Ç¤Ï®ÅÙ¤¬Îô¤ê¤Þ¤¹¤¬¡¢²èÁü£³¤Ç¤Ï°µÅÝŪ¤ËÁᤤ¤Ç¤¹¡£
ʸ»ú·Ï¤Ç¤Ï̯¤Ê¤Ò¤²¤¬½Ð¤ä¤¹¤¤¤Ç¤¹¤¬¡¢¼Ì¿¿Åù¤Î¥¨¥Ã¥¸Ãê½Ð²èÁü¤ËÂФ·¤Æ¤ÏÎɤ¤·ë²Ì¤¬½Ð¤Æ¤¤¤Þ¤¹¡£
(ÏÀʸȯɽ½ç¤Ç¤Ï¡¢¡ÚHilditch(1968)¡Û¢ª¡ÚÅļ(1978)¡Û¢ª¡ÚZhang-Suen(1984)¡Û¢ª¡ÚNWG(1989)¡Û)
º£²ó¼ÂÁõ¤·¤Æ¤¤¤Þ¤»¤ó¤¬¡¢
Hilditch¤ÎÊýË¡¤ÏºÙÀþ²½½èÍý¤Î¸µÁĤȤâ¸À¤¨¤Þ¤¹¤¬¡¢½½Ê¬¤Ê·ë²Ì¤¬ÆÀ¤é¤ì¤Ê¤¤¾ì¹ç¤¬¤¢¤ë¤é¤·¤¤¡£
Rosenfeld¤Ï¡¢Zhang-Suen,NWG,Åļ¤ËÈæ¤Ù¡¢¤«¤Ê¤ê½èÍý¤¬½Å¤¯¤Ê¤ë¤é¤·¤¤¡£
¡Ê»²¹Í¡§ Comparing Hilditch, Rosenfeld, Zhang-Suen,and Nagendraprasad - Wang-Gupta Thinning ¡Ë
¼Â¹Ô¥µ¥ó¥×¥ë¤Ï¤³¤Á¤é
IE10/Chrome/FF/Android¤Ç¡¢³Îǧ¤·¤Æ¤¤¤Þ¤¹¡£
IE9¤Ï¡¢TypedArray(Uint8Array)¤ËÂбþ¤·¤Æ¤¤¤Ê¤¤¤Î¤Ç¡¢ºï½ü¥ê¥¹¥È¤ò»È¤¦Êý¼°¤Ë½¤Àµ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
IE10¤Ç¤â¡¢Uint8ClampedArray¡Ê˰ϱ黻ÉÕ¤8bit¡Ë¤Ë¤ÏÂбþ¤·¤Æ¤¤¤Ê¤¤¤Î¤Ç¡¢
¤³¤Î¥µ¥ó¥×¥ë¤Ç¤Ï¡¢Uint8Array¤ò»È¤Ã¤Æ¤¤¤Þ¤¹¡£
(Chrome,FF¤Ç¤Î¡¢ImageData.data¤Î·¿¤ÏUint8ClampedArray¤Ç¤¹¡£)
¤³¤Î¥ë¡¼¥×¿ô¤Ë¤Ê¤ë¤ÈChrome¤äFF¤Ï®¤¤¤Ç¤¹¤¬¡¢IE¤À¤È¤«¤Ê¤êÃÙ¤¤¤Î¤Ç¡¢
²èÁü¥µ¥¤¥º¤Ë¤è¤Ã¤Æ¤Ï¡¢Web Workers¤Ë¤è¤ë¥Þ¥ë¥Á¥¹¥ì¥Ã¥É²½¤ò¸¡Æ¤¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
⤷¡¢IE¤Ç¤ÏImageData.data¤Î·¿(CanvasPixelArray)¤¬°Û¤Ê¤ë¤Î¤Ç¡¢Ãí°Õ¤¬É¬ÍפǤ¹¡£
--------------- ʸ¸¥ ---------------
¡ÚÅļ¤ÎÊý¼°¡Û
H. Tamura: A comparison of line thinning algorithms from digital geometry viewpoint, Proc. 4th Int. Joint Conf. on Pattern Recognition, pp. 715 - 719 (1978.11)
¡ÚZhang-Suen¤ÎÊý¼°¡Û
Zhang, T. Y. and Suen, Ching Y., ¡ÈA Fast Parallel Algorithms ForThinning Digital Patterns¡É,Communication of the ACM,Vol 27, No. 3,Maret 1984, pp.236-239.
¡ÚNWG¤ÎÊý¼°¡Û
P.S.P. Wang and Y.Y. Zhang (1989). A fast and flexible thinning algo-rithm. IEEE Transactions on Computation C-38, 741–745
Tags: ¥×¥í¥°¥é¥à¥á¥â
author : HUNDREDSOFT | - | -