ç»åã®ã»ã°ã¡ã³ãåãšãšããžæ€åº ïŒ ãšããžæ€åº ïŒã¯ã ã³ã³ãã¥ãŒã¿ãŒããžã§ã³ã·ã¹ãã ã§éèŠãªåœ¹å²ãæãããã·ãŒã³ã®èªèãšãªããžã§ã¯ãã®éžæïŒå®çŸ©ïŒã«äœ¿çšãããŸãã æŠããŠãããã¯ãããšãã°é«ã¬ãã«ã®ã¿ã¹ã¯ã解決ããããã«èšèšããã䞊ã¹æ¿ããšåãããŒã«ã§ãã ãããã£ãŠããã®ã¯ã©ã¹ã®ã¢ã«ãŽãªãºã ã®èšèšãç解ããããšã¯ããã®ãããªã·ã¹ãã ãæ§ç¯ãããšãã«ãèŠä»¶ïŒå質/ããã©ãŒãã³ã¹ã®ç¹ã§ïŒãšã¿ã¹ã¯ã®è©³çŽ°ãèæ ®ããŠäžèŠã§ã¯ãããŸããã
ãã®èšäºã§ã¯ ã2004幎ã«å ¬éãããPedro F. Felzenszwalb ïŒ MIT ïŒããã³Daniel P. Huttenlocher ïŒ Cornell University ïŒã«ããå¹ççãªã°ã©ãããŒã¹ã®ç»åã»ã°ã¡ã³ããŒã·ã§ã³ã¢ã«ãŽãªãºã ã«ã€ããŠç°¡åã«èª¬æããŸãã ã¯ããã¢ã«ãŽãªãºã ã¯æ¯èŒçå€ãã§ãããããã«ãããããããããã¯ãŸã éåžžã«äººæ°ããããããã©ãŒãã³ã¹ã®é¢ã§è¯ãçµæã瀺ããŠããŸãã
ã«ããã®äž-åçãšããã¹ãã®å€§èŠæš¡ãªæ··åç©ãäž»é¡ã®çŸåšã®ã¬ãã«ã®ç¥èãèŠæ±ããŸããã 奜å¥å¿ã¯å€§æè¿ã§ãã
æåã«ãç»ååŠçãšã¯ã»ãšãã©é¢ä¿ã®ãªãã°ã©ãã«ã€ããŠãäžèŠã¢ã«ãŽãªãºã ã説æããŸãã ãã ããå°ãåŸã«ç»åã®ã»ã°ã¡ã³ããŒã·ã§ã³ã«é¢é£ããŠè§£éãè¡ãããŸãã
ã¯ã©ã¹ã«ã«ã¢ã«ãŽãªãºã
Kraskalã¢ã«ãŽãªãºã ïŒ wiki ïŒã¯ãã¯ã€ã€ãã¬ãŒã ïŒç¹å®ã®ã°ã©ãã®æå°ã¹ããã³ã°ããªãŒïŒãæ§ç¯ããŸãã 次ã«ãè±èªã®ç¥èªMST ïŒæå°ã¹ããã³ã°ããªãŒïŒã䜿çšãããŸãã
ç®çïŒãããäžã«ã¯ããã€ãã®éèœãããïŒè€æ°ã®é£çµ¡å ãããŒãäžã«ãããŸãïŒããããããã¹ãŠçžäºã«æ¥ç¶ããŠãéè·¯ïŒã¯ã€ã€ïŒã®å šé·ãæå°ã«ãªãããã«ããå¿ èŠããããŸãã
* ã¯ãããã®ãããªå®åŒåã®ã¿ã¹ã¯ã¯éåžžãã·ã¥ã¿ã€ããŒåé¡ãïŒ èšäº ïŒãšåŒã°ããããã解決ããŠãéœåžãããã«å®ãæ¥ç¶ããããšãã§ããŸãã ããããæçµçã«ã¯ãã¢ã¹ãã¡ã«ããèè£ ããªãã§ãã ãã... =ïŒ
ããã解決ããã«ã¯ã次ã®ãã®ãå¿ èŠã§ãã
- ã°ã©ã ïŒãããäœã§ããããã³ãŒãã§ã©ã®ããã«è¡šããããã«ã€ããŠç°¡åã«èª¬æããŸããããHabréã§æ¢ã«è¿°ã¹ãããŠããŸãïŒ èšäº ïŒ
- Kraskalã®ã¢ã«ãŽãªãºã ïŒ wiki ïŒïŒãã®å®åŒåã®åé¡ã解決ããããã®äž»èŠãªããšã³ãžã³ãã ããã¯ãLeysersonã®èæžãã¢ã«ãŽãªãºã ïŒæ§ç¯ãšåæãïŒ æ¬ ïŒã®Cormenã«éåžžã«ããèšè¿°ãããŠããŸãã
- Disjoint-set data structure ïŒ wiki ïŒïŒäžèšã®ã¢ã«ãŽãªãºã ãå¹ççã«å®è¡ããããã«å¿ èŠãªè¿œå ã®æ§é ã ã©ã®ããã«æ©èœãããã¯åãèæžã§èª¬æãããŠããŸãããååã¯å°ãç°ãªããŸãïŒ ã¡ã¢ãªãå€æŽããªãå ŽåïŒUnion Find-Setãªã© ïŒ
åé¡ã®çŸåšã®ã¹ããŒãã¡ã³ãã§ã¯ãã°ã©ãã®é ç¹ïŒv i ïŒ -éœåžãè¡šãããšããžeïŒv i ãv j ïŒ -éœåžéã®éè·¯ãè¡šããŸãã éœåžã®ãã¢ïŒv i ãv j ïŒéã®è·é¢ãç¥ã£ãŠããŸã-ããã¯ãšããžwïŒeïŒviãvjïŒïŒã®éã¿ã§ãã MSTãèŠã€ããå¿ èŠããããŸãã ã°ã©ãå ã®ãã®ãããªããªãŒïŒãµã€ã¯ã«ãªãïŒäœåãªéè·¯ã建èšããçç±ïŒã«ããããšããžã®åèšãæå°ã«ãªãããã¹ãŠã®é ç¹ã«å°éã§ããŸãã
æåã¯ãåé ç¹ïŒéœåžïŒèªäœãã察å¿ããã»ããG 1 ãG 2 ã... G N ïŒé ç¹ã®æ°ã«ããïŒã®å¯äžã®èªãé«ã代衚ã§ãã 圌女ãMSTãçµæãããšèããªããã¿ãŸãããã ã¢ã«ãŽãªãºã ã®éçšã§ããããã®ç°çš®éåãã¹ãŠãå¹ççãã€å€äº€çã«çµã¿åãããŠåäžã®Gã«ããããã«å«ãŸããé ç¹ãMSTã圢æããããã«ããŸãã ãããè¡ãã«ã¯ïŒ
- ã°ã©ãå ã®ãã¹ãŠã®ãšããžããé·ãã®å¢å é ã«äžŠã¹ãŸãïŒéè·¯ïŒ
- rib骚ã«æ²¿ã£ãŠé·ãã®æé ã«èµ°ããrib骚ã®ç«¯e =ïŒaãbïŒãèŠãŸãïŒ
- é ç¹ïŒ aããã³b ïŒãåãã»ããã«å±ããŠããå Žå ïŒãã®ããããããã¯ãã§ã«ãµãMSMSã®äžéšã®æè²ããããµãã»ããã«åå ããŠããããããšããžã®åèšã¯ãã§ã«æå°ã«ãªã£ãŠããŸãã ãã®ãããªãšããžã¯ã¹ããããããŸã-ç§ãã¡ã¯ãããå¿ èŠãšããŸãã ããã§ãªããã°ãããã¯æšã«ãµã€ã¯ã«ã圢æããã¢ã¹ãã¡ã«ããç¡é§ã«ããŸã
- é ç¹ïŒ aããã³b ïŒã micro-MSTã®ç°ãªããµãã»ããã«å±ããŠããå Žå ïŒçµåããå¿ èŠããããŸãã äž¡æ¹ã®ãµãã»ããã1ã€ã«çµåïŒããŒãžïŒãããæå°é·ã®ãšããžïŒéè·¯ïŒãèŠã€ãããŸããã ããçãé·ãã®ãã¹ãŠã®ãªãã¯ãã§ã«èæ ®ãããŠããããã®ãªããããå®ãããããçµåããããšã¯ã§ããŸããã ãã®ãããªãšããžã¯ãMSTããªãŒã®æ§ç¯ã«äœ¿çšããããšããžã®ãªã¹ãã«èšé²ãããã»ããã¯1ã€ã«çµåãããŸã
- ã°ã©ãã®ãã¹ãŠã®é ç¹ãååšããç®çã®MSTã«çããåäžã®ã»ãããååŸãããŸã§ãçµåãµã€ã¯ã«ãç¶ããŸã
- åäžã®é ç¹ã»ãã ïŒMSTïŒãšããããçµåããããã«äœ¿çšããããšããžã®ãªã¹ããååŸããŸã ãããã¯ããã¹ãŠã®é ç¹ãçµåããæå°å šé·ã®ããªãŒã§ãã
ã°ãã°ãã®ããŒã¿æ§é
Kraskalã¢ã«ãŽãªãºã ã§ãã»ãããã®æŠå¿µãå®è£ ããã«ã¯ã Disjoint-setããŒã¿æ§é ã䜿çšãããŸãã ããã䜿çšããäœæ¥ã¯ã2ã€ã®åºæ¬æäœãå®è¡ããããã«æé©åãããŠããŸãã
- çŸåšå±ããŠããé ç¹ãèŠã€ããŸã
- ãããã®ã»ããããã°ãã1ã€ã«ãŸãšãã
ã¢ã«ãŽãªãºã ã®ç¹å®ã®ã¹ãããã§ã2ã€ã®é£æ¥ãããã¯ã»ã«ãæ¥ç¶ãããšããžãæ¥ç¶ããããšä»®å®ããŸãããšããžã®äžæ¹ã®ç«¯ã§ã¯ããã¯ã»ã«ã¯ããªã¬ã³ãžãã§ãããäžæ¹ã¯ãèµ€ãã§ãã ãšããžã®é·ãã¯ããã¯ã»ã«éã®ãè²å·®ããšããŠå®çŸ©ãããŸãã çãé·ãã®ãªãïŒé¡äŒŒã®è²ïŒã¯ãã¹ãŠæ¢ã«çµåãããŠããŸãããããžãŒã®ãªã¬ã³ãžãšèµ€ã®ã»ã°ã¡ã³ãã¯ããããããã§ã«åŒ·èª¿è¡šç€ºãããŠããŸãã ã¢ã«ãŽãªãºã ã«åŸã£ãŠãçŸåšã®ããªã¬ã³ãžããã¯ã»ã«ãšãèµ€ããã¯ã»ã«ãåãã»ã°ã¡ã³ãã«ãããã©ããã調ã¹ãå¿ èŠããããŸããïŒ ããããç°ãªã£ãŠããŠãã»ã°ã¡ã³ãã®è²ã䌌ãŠãããšæãããå Žåã¯ããããã1ã€ã«çµã¿åãããŠæ§ç¯ãç¶ããŸã...äžè¬ã«ããã¯ã»ã«ã®ã¿ã§åãã¯ã©ã¹ã«ã«ã¢ã«ãŽãªãºã ã
ãããã®æäœã«äœ¿çšãããæ§é ã¯ãããªãŒã«éåžžã«äŒŒãŠããŸãïŒãã ããã€ã³ããã¯ã¹ã®é åã«ãã£ãŠå®è£ ãããŸãïŒã ãã®äžã§ãåãã¯ã»ã«ã«å¯ŸããŠãç¥å ã瀺ãããŠããŸãã åãã»ã°ã¡ã³ãã«ããåæ§ã®è²ã®ãã¯ã»ã«ãžã®ãã€ã³ã¿ãŒïŒã€ã³ããã¯ã¹ïŒã åºæ¬æäœïŒ
- ãã¯ã»ã«ãxãã® ã»ã°ã¡ã³ããæ€çŽ¢ããŸã ãå ç¥ã«æ²¿ã£ãŠæäžéšã«ç§»åããŸãã äžçªäžã®ãã¯ã»ã«ã¯ããªãŒã®ã«ãŒãã§ãããçŸæç¹ã§ã¯ãã®ã»ã°ã¡ã³ãã®ã代衚ãã§ãã
- ã»ã°ã¡ã³ãã®çµå ã ãã¯ã»ã«ãç°ãªãã代衚ããæã€å Žåããããã¯ç°ãªãã»ã°ã¡ã³ãã«å±ããŸããããã§ãªããã°ã1ã€ã®ã«ãŒãããããŸãã ããããçµåããããã«ãããªãŒã®é«ããå¢ãããªãããã«ãããäœãé«ãïŒæãé ããã¯ã»ã«ããã«ãŒããŸã§ïŒã®ã»ã°ã¡ã³ãã®ã代衚è ãããããé·ãã代衚è ãã«åç §ãããŸãã ããã§ãå ±éã®ä»£è¡šè ãå«ãçµåã»ã°ã¡ã³ããäœæãããŸããã
- 次åãã¯ã»ã«ããã«ãŒããŸã§é ããŸã§èµ°ããªãããã«ãã代衚ããæ£åžžã«æ€åºãããåŸããã¯ã»ã«ããçŽæ¥ãªã³ã¯ã確ç«ããŸãã ããã¯ã次ã®æ€çŽ¢ã®ãã¹ãççž®ããã ãã¹å§çž® ããšåŒã°ããŸãã
ããŠããã¯ã»ã«åäœã§ã»ã°ã¡ã³ããå¹ççã«æ€çŽ¢ããŠçµåããKraskalã¢ã«ãŽãªãºã ã䜿çšããŠMSTãæ§ç¯ã§ããããã«ãªããŸããã 2ã€ã®é åãçµåãŸãã¯åé¢ãã決å®ãã©ã®ããã«è¡ããããã調ã¹ãæãæ¥ãŸããã
åå²ããŠåŸæãã
ã»ã°ã¡ã³ããŒã·ã§ã³ã¢ã«ãŽãªãºã ã¯ã1ã€ã®ã»ã°ã¡ã³ããçµäºããå¥ã®ã»ã°ã¡ã³ããéå§ããå Žæãæ確ã«æ±ºå®ããå¿ èŠããããŸãã ååãšããŠãå¢çç·ã¯ããªããžã§ã¯ãã®èæ¯ãé£è¡æ©ã®åœ±ããªãŠã ã®æµ·ããã§ã³ã¹ã®ç¢æã®é åã§èŠãããæããããã³/ãŸãã¯è²åãã®ç¹åŸŽçãªéãã§ã...ãããŠãå·®ããããã€ãã®ããããå€ãïŒãããå€ïŒããã倧ããå Žåãããã¯ãããããç°ãªãã»ã°ã¡ã³ãã§ããããšã«åŸãå¿ èŠããããŸãã ããããå°ããªåé¡ããããŸããéãã¯ãªããžã§ã¯ãããšã«å€§ããç°ãªããäžæã«å®çŸ©ãããïŒå®æ°ïŒãããå€ïŒãããå€ïŒã§ã»ã°ã¡ã³ãããåé¢ãããããšã¯å°é£ã§ãã ããŒãã«ã®è¡šé¢ãå£ã«æ¥ããŠããå ŽåïŒããŒãã«ã®è¡šé¢ïŒå£ïŒã«æ²¿ã£ãé£æ¥ãããã¯ã»ã«éã®å·®ã¯æ¯èŒçå°ãããªããŸãããããŒãã«ãšå£ã®å¢çã§ã¯ãã»ã°ã¡ã³ããåé¢ãããžã£ã³ãããããŸãã ããã¯æããã§ãã ãããŠãæµ·ã®èæ¯ã«ãªãŠã ããããšãããïŒ åœŒèªèº«ã¯éåžžã«ãéå€ãã§ããã®äžã«ã¯æµ·ããããããåé¢ãããããã«åŒ·åºŠã«å€§ããªéãããããŸãïŒç·èµ€é»âŠïŒãå¥ã®ãéŸå€ãïŒéŸå€ïŒãå¿ èŠã§ãã ãããŠåŸã ã«ãé£æ¥ããã»ã°ã¡ã³ãããäžç·ã«éåœã¥ããããŠããªãããšå€æãããããå€ã¯ãããŒã«ã«ã€ã³ãžã±ãŒã¿ã ãã§ãªãã1ã€ã®ãšããžïŒé£æ¥ãããã¯ã»ã«ãæ¥ç¶ããïŒã«æ²¿ã£ã匷床差ã ãã§ãªãããããã®ã»ã°ã¡ã³ãèªäœãäŸåããå¿ èŠããããšããçµè«ã«éããŸãããèªäœã¯æ»ããïŒè²ã®ç¹ã§ïŒãŸãã¯ãã«ã©ãã«ãã§ãã
ç°è²ã®åç
æ¬æ Œçãªã«ã©ãŒç»åã®åŠçã«é²ãåã«ãç»åãã°ã¬ãŒã¹ã±ãŒã«ãããªãã¡ ç»åè¡åã®åã»ã«ã«ã¯ããã¯ã»ã«ã®æãããè¡šãæ°å€ãéé[0 ... 1]ã«æ ŒçŽãããŸãã
å¹ççãªã°ã©ãããŒã¹ã®ç»åã»ã°ã¡ã³ããŒã·ã§ã³
åç»åãã¯ã»ã«ã¯ãã°ã©ãã®é ç¹ã§è¡šãããŸãã ãããŠãé£æ¥ããé ç¹ãæ¥ç¶ãããšããžã®éã¿ïŒé·ãïŒã¯ã次ã®åŒã§è¡šãããŸããwïŒv i ãv j ïŒ= | IïŒp i ïŒ-IïŒp j ïŒ| ããã§ã IïŒp i ïŒã¯ãã¯ã»ã«p iã®åŒ·åºŠïŒæããïŒã§ãã
Kraskalã¢ã«ãŽãªãºã ã®å®è¡äžã«ãäžé段éã§ããã€ãã®ç°ãªãã»ã°ã¡ã³ãïŒãã¯ã»ã«ã®ãµãã»ããïŒããããå éšã®ãšããžã®åèšééãæå°ã«ãªããŸããã»ã°ã¡ã³ãã¯æå°é·ã®ãšããžã§çµåãããŸãã é£æ¥ãããã¯ã»ã«éã®ã匷床ã®å·®ãã¯æå°éã§ãã ãããã£ãŠãåãã»ã°ã¡ã³ãå ã®é£æ¥ãããã¯ã»ã«ã®è²ã¯äŒŒãŠããŸãã ããããæ倧rib骚ã®ç¹å®ã®å€ïŒåŒ·åºŠå·®ïŒãŸã§ã®ã¿...
ãããŠ...çŸåšã®ã¹ãããã§æå°ã®ãšããžãåããŸããã ãã®ãšããžã®é£æ¥ããé ç¹ã§ãã2ã€ã®ãã¯ã»ã«ã«ã€ããŠã1ã€ã®ïŒæ¢ã«æ§ç¯ãããïŒã»ã°ã¡ã³ããã決å®ããŸããïŒ
- ã¯ã ã1ã€ã®ã»ã°ã¡ã³ãããïŒã¢ã«ãŽãªãºã ã®å®è¡ãç¶ç¶ããŸãã
- ãã ã»ã°ã¡ã³ããç»åå ã®åããªããžã§ã¯ãã®äžéšãè¡šãã®ããããããçµåããå¿ èŠãããã®ãââããŸãã¯ãããã®åŒ·åºŠããå€§å¹ ã«ãç°ãªãã®ããå€æããå¿ èŠããããŸããïŒ
åå¥ã«æ€çŽ¢ããå¿ èŠã¯ãããŸãããããµãã»ã°ã¡ã³ããã®ã³ã³ããŒãã³ããçµåãããšãã«è¿œå ããããšããžã®é·ããä¿åããã ãã§ãã å®éãå䜵æã«ã¯ãè¿œå ããããšããžã®é·ãã¯ãåããµãã»ã°ã¡ã³ããã®æ¢ã«æ§ç¯ãããMSTãããé·ããªããŸããã ãšããžã¯æé ã§åŠçãããŸãã
ã»ã°ã¡ã³ãC 1 ãC 2ã®è¿äŒŒæ±ºå®ã«ãŒã«ãååŸããŸãã
çç¶ïŒãããã®ã»ã°ã¡ã³ããåºå¥ããå¿ èŠããããŸããïŒ | |
2ã€ã®ç°ãªãã»ã°ã¡ã³ããæ¥ç¶ããæå°é·ã®çŸåšã®ãšããž | |
èæ ®ãããã»ã°ã¡ã³ãã®1ã€å ã®ããå°ããïŒå€§ããããïŒåŒ·åºŠå·® |
ã»ã°ã¡ã³ãããçµåãããããã«ã¯ããããã®å¢çã§ã®åŒ·åºŠã®å·®ã¯ãçµåãããåã»ã°ã¡ã³ãå ã®æ倧差ãããå°ãããªããã°ãªããŸããã
ããªããæ¢ããŠããŸã
ç»åããã°ã©ããäœæããæ¹æ³ã¯ïŒ ã©ã®ãã¯ã»ã«ãé£æ¥ããŠããŸããïŒ è¡šé¢ã«ã¯2ã€ã®äž»ãªã¢ãããŒãããããŸãã
- 4-connected ïŒåãã¯ã»ã«ã¯ãäž/äž/å·Š/å³ããé£æ¥ãããã¯ã»ã«ã«æ¥ç¶ãããŸãã ãã®ãããªæ§é ã¯ãã°ã©ãå ã®ãšããžã®æ°ãæå°éã§ãããšããç¹ã§é åçã§ãã
- 8-connected ïŒåã®ãªãã·ã§ã³ã«å ããŠãåãã¯ã»ã«ãæãã«äœçœ®ããé£æ¥ãã¯ã»ã«ã«æ¥ç¶ããŸãã ãããã£ãŠãã°ã©ãã«ã¯ããå€ãã®ãšããžããããã¢ã«ãŽãªãºã ã®å®è¡ã¯ããé ããªããŸãã ããããçµæã®ã»ã°ã¡ã³ããŒã·ã§ã³ã¯ããè¯ãã¯ãã§ã-ãã¯ã»ã«éã®ããå€ãã®é¢ä¿ãèæ ®ãããããã§ãã
ãã®ã¢ã«ãŽãªãºã ã¯ã8é£çµã°ã©ãã§ã¯ããè¯ãçµæãããããã¯ãã§ããã4é£çµã°ã©ãã§ã¯éåžžã«åãå ¥ããããçµæãåŸããããšåæã«ãã¯ããã«é«éã«å®è¡ãããŸãã ãããŠãã«ã©ãŒç»åãåŠçããããã®ãè·é¢ããšããŠãã¢ã«ãŽãªãºã ã®äœæè ã«ãã£ãŠå®è£ ãããããŸãã«ãã®ãããªåçŽãªãã¯ã»ã«ã®è²ã®éããåãããšãã§ããŸãã
ãã ãããã®ãããªè·é¢ã®å®åŒåã«ã¯æ¬ ç¹ããããŸãã å±æçã«é£æ¥ãããã¯ã»ã«éã®ã匷床ã®éãããèæ ®ãããšã次ã®åçã®ç©ºã¯ã¯ã€ã€ãŒã暪åã2ã€ã®å¥ã ã®ã»ã°ã¡ã³ãã«åå²ãããŸãããŸãã¯ãã°ãªããã®èæ¯ã«å¯ŸããŠèçãåŠçãããšãããã«æªãçµæãåŸãããŸãã
èçã®åãã©ã°ã¡ã³ãã¯åå¥ã®ã»ã°ã¡ã³ããšããŠããŒã¯ãããŸãããããã¯1ã€ã®ãªããžã§ã¯ãã§ãïŒ
ãããã£ãŠã代æ¿ã®å®æœåœ¢æ ã§ã¯ãèè ã¯ãè¿ãã®ãã¯ã»ã«ã ãã§ãªããç»åã®å±æç¹æ§ïŒããè¿ãã«ãããã¯ã»ã«ïŒãèæ ®ããŠããã¯ã€ã€ãŒãé£ã³è¶ããïŒåçãåç §ïŒãäžå®ã®è·é¢ã«ããã»ã°ã¡ã³ãã®ç¶ãã«æã䌞ã°ãããšããããšãææ¡ããŸãã ãããè¡ãã«ã¯ããã¯ã»ã«ã®äœçœ®ïŒxãyïŒãšãã®è²ïŒrãgãbïŒã®äž¡æ¹ã«å¿ããŠããšããžé·ãšããŠãŠãŒã¯ãªããè·é¢ãéžæããããšããå§ãããŸãã
ç©ççã«ããçšåºŠã®è·é¢ã«ããå Žåã§ãããã¯ã»ã«ãè¿ãã«ããå ŽåããŸãã¯é¡äŒŒã®è²çžãæã€å Žåããã¯ã»ã«ã¯ãé£æ¥ããšèŠãªãããŸãã ã°ã©ããäœæããããã«ãèè ã¯ãåãã¯ã»ã«ã10ïŒ20ã30ïŒãæãè¿ããæ¥ç¶ããããšãææ¡ããŠããŸãã ããã«ãããã»ã°ã¡ã³ããŒã·ã§ã³ãæ¹åãããŸãããããå€ãã®ã³ã³ãã¥ãŒãã£ã³ã°ãªãœãŒã¹ãå¿ èŠã«ãªããŸãã
å£çµããŠãããŒã ïŒ
æåã«æ»ããŸãã ããããããããã¹ãŠã®ãã¯ã»ã«ãæçåããããšãé£æ¥ãããã¯ã»ã«éã§åŒ·åºŠã®ææå·®ã芳å¯ããããããã®ããŒãžã劚ããããŸããã åãã¯ã»ã«ãåé¢ããå¿ èŠã®ããé¡åŸ®é¡åçãäžããããå¯èœæ§ã¯ã»ãšãã©ãããŸãããããããããããã¯äœããã®å€§ããªãªããžã§ã¯ãïŒãªãŠã ïŒã®äžéšã§ãã ããŒãã£ã·ã§ã³ã®æ£ç¢ºæ§ãããéèŠã§ããããã§ã«æ§ç¯ãããŠãã倧ããªã»ã°ã¡ã³ãããããããŒãžãïŒããŒãžïŒã®çšåºŠã倧ããããã決å®ã«ãŒã«ã§æ§ç¯ãããã»ã°ã¡ã³ãã®ãµã€ãºã«å¿ããŠå€ãè¿œå ããŸãã ã©ã| C | åé¡ã®ã»ã°ã¡ã³ãã®ãã¯ãŒïŒçŸæç¹ã§ã®ãã¯ã»ã«æ°ïŒã§ããã kã¯æ¢ã«æåã§èšå®ãããã»ã°ã¡ã³ããŒã·ã§ã³ãã©ã¡ãŒã¿ãŒã§ãã 決å®ã«ãŒã«ã®åæ§ã®ä¿®æ£ã«ãããåŒã䜿çšãããŸãã
ãä¿®æ£ãã¯ãã»ã°ã¡ã³ãã®æé·ã«å¿ããŠåŸã ã«å¹³æºåãããŸãïŒå¢å | C | ïŒ...
å®éããã®ãããªã¿ã¹ã¯Tã®ä»£ããã«ãåŠçãããç»åã®è©³çŽ°ãèæ ®ããå¥ã®é¢æ°ãéžæã§ããŸãïŒã»ã°ã¡ã³ãã®åœ¢ç¶ãåçå ã®äœçœ®ãç¹å®ã®è²åã...
ã¬ãŠã¹ãŒãã
éåžžã«ãéå€ãªãåçã«æ»ãïŒ
ã匷床ã®å·®ããªã©ã®å®çŸ©ã§ãã¯ã»ã«éã®è·é¢ã決å®ãããšãããéå€ãã®ãã¯ã»ã«ã¯ãåäžã®ãªããžã§ã¯ãã§ãã£ãŠãã1ã€ã®ãªããžã§ã¯ãã«çµåããã®ã«éåžžã«æè»ã§ã¯ãªãããšã¯æããã§ãã ãã€ãº/ã¢ãŒãã£ãã¡ã¯ãã®çµåãšé€å»ãããã調æŽãããããã«ãéåžžãç¹å®ã®ååŸïŒæšæºåå·®ïŒ ã·ã°ãã®ã¬ãŠã¹ãã£ã«ã¿ãŒïŒhttp://habrahabr.ru/blogs/webdev/43895/ïŒãç»åã«é©çšãããŸãã ããã¯ããã¯ã»ã«ã®è²æåã®ãçžäºæµžéããåŒãèµ·ããããã¯ã»ã«ã¯ããç©æ¥µçã«æ¥è§ŠããŸãã
åèš
ã»ã°ã¡ã³ããŒã·ã§ã³ã«ã¯å€ãã®æ¹æ³ããããŸããããŸããŸãªã¢ãããŒãã«ã€ããŠã¯ã èšäº ãç»åã®ã»ã°ã¡ã³ããŒã·ã§ã³æ¹æ³ïŒèªåã»ã°ã¡ã³ããŒã·ã§ã³ãã§è©³ãã説æãããŠããŸã ã ããããæŠããŠãã»ã°ã¡ã³ããŒã·ã§ã³ã¯é«å質ãŸãã¯çç£çã§ããå¿ èŠããããéããããã°ãäžåºŠã«ãã¹ãŠãè¡ãå¿ èŠããããŸãã äžèšã®æ¹æ³ã¯ãåãªãçç£çãªãªãã·ã§ã³ã§ãã
ãã®ã»ã°ã¡ã³ããŒã·ã§ã³ã®æ¹æ³ã§ã¯ãæãæéã®ãããããã»ã¹ã¯ã OïŒe logâ¡eïŒã«å¯ŸããŠå®è¡ããããã¹ãŠã®ãšããžã®ãœãŒãã§ããããã§ã eã¯ã°ã©ãå ã®ãšããžã®æ°ã§ãã ãããã£ãŠãNxMç»åã®å Žåããšããžã®ãã¯ã»ã«ã¯æ¬¡ã®ããã«ãªããŸãïŒ | e | = 4 * N * M
ã¢ã«ãŽãªãºã ã®ãœãŒã¹ã³ãŒãã¯ããã®ãªã³ã¯ããå ¥æã§ããŸãã
ããããOpenCVã¯ã©ãã§ããããïŒ
誰ãã奜ããªOpenCVã©ã€ãã©ãªïŒ wiki ïŒã«ã¯ãã cvPyrSegmentation ãã¡ãœããããããŸãã ãã©ãããç»åã»ã°ã¡ã³ããŒã·ã§ã³æ³ã é 眮ãå€å°ç°ãªããŸãã ãããã£ãŠã圌ã®èª¬æã«ã¯å¥ã®èšäºãã€ãŸãåçãå¿ èŠã§ãã ã»ã°ã¡ã³ãã¯ã¬ã€ã€ãŒïŒã¬ãã«ïŒã«çµã¿èŸŒãŸããåæ§ã®è²ã®ãã¯ã»ã«ã1ã€ïŒã¬ã€ã€ãŒã®äžã«ããïŒã«çµåãããã¹ããããã®äžã®æ¬¡ã®ã¬ãã«ïŒã¬ãã«ïŒã«ããã¬ã€ã€ãŒãé çªã«åŠçããŸãã
2006幎ããã©ã¬å€§åŠïŒã¹ãã€ã³ïŒã§ãããã€ãã®ãã©ãããåã¢ã«ãŽãªãºã ãæ¯èŒããããã®çµæã次ã®èšäºã«ç€ºãããŠããŸãã
èè ã¯ã8ã€ã®æ¹æ³ã®ãã¡3ã€ã泚ç®ã«å€ãããšããçµè«ã«éããŸããããã®ãããç»åããªããžã§ã¯ãã«åå²ããããã«ããªãé«å質ã®çµæãåŸãããŸãã ãã ãããã©ãããåã¢ã«ãŽãªãºã ã®å®è¡æéã¯0.5ç§ããã§ãã æ倧4.5ç§ ïŒPentium 766 MHzã§256x256ãã¯ã»ã«ïŒãã å¹ççãªã°ã©ãããŒã¹ã®ç»åã»ã°ã¡ã³ããŒã·ã§ã³ ãã¯ãã1ç§æªæº ãã®èè ã«ãããšå®è¡ãããŸãã ç§ãã¡ã§ã¯ã 1024x768ã®åçã¯ããå ¥ãå人圢ãå ã§0.5ç§ ïŒU9400 2 x 1.4GHzïŒã§ããŸããããŸããïŒVMWare-Matlab-mexïŒC ++ïŒã äžè¬ã«ããã©ãããå-å質ãèšäºã§èª¬æãããŠããã°ã©ã-é床ã ã©ã¡ãã«ãçåœæš©ããããŸãã =ïŒ
æãç±å¿ãªèªè ã«ã¯ããéæ³ã®æ³¡ãã®ç§å¯ãæããã«ããŸããåçã«ã¯ã©ã®ãããªæ°åã衚瀺ãããŸããïŒ ãããã¯ã ã»ã°ã¡ã³ããŒã·ã§ã³ïŒã·ã°ããkãæå°ïŒ ãã¡ãœããã®ãã©ã¡ãŒã¿ãŒã§ããããã®ãã¡2ã€ã¯ãã§ã«ããç¥ã£ãŠããŸãã3çªç®ã®ã æå° ãã¯åŒ·å¶çãªæå°ã»ã°ã¡ã³ããµã€ãºã§ããããå°ããªãã»ã°ã¡ã³ãã¯ãããŸããã
é 匵ã£ãŠ
PSããŸã蹎ããªãããã«ãé¡ãããŸããããã¯ãHabréã®9åç®ã®æçš¿ã§ãã