Androidã¨OpenCVã§è©¦ãç¹å®ç©ä½èªè
6æ2æ¥ã«éå¬ãããDevLOVEさんと弊社の共同開催勉強会ã§ããAndroidÃComputerVisionãã¨ãããé¡ã§çºè¡¨ãã¦ãã¾ããã
è¦ã¯OpenCVãAndroidã¢ããªã«çµã¿è¾¼ãã§ç¹å®ç©ä½èªèã試ãããã¨ãããã®ã
è³æã¯ä»¥ä¸ã§ãã
ã½ã¼ã¹ã¯githubã§å
¬éãã¦ã¾ãã
https://github.com/thorikawa/AndroidObjectRecognition/
æ¦è¦
è³æã«ãè¨è¼ãã¦ãã¾ãããã«ã¡ã©ã®ãã¬ãã¥ã¼ç»åããSURFã®ç¹å¾´ç¹ãæ¤åºãã¦ãLSHã§åè¿åæ¤ç´¢âç¹å®ç©ä½èªèã¨ããã®ãæ¯ãã¬ã¼ã è¡ã£ã¦ãã¾ãã
ãç©ä½ãã¯CDã®ã¸ã£ã±ããç»åã5æã®å
ããèªèãã¦ãããããã®ç»åã«ãã£ãé³ãé³´ãããã¨ãããã¢ãè¡ãããã¾ãèªèãããã¨ãã§ãã¾ããã
æ§æã»ãã«ãæ¹æ³
ãã§ãã¯ã¢ã¦ãå¾ã®ã½ã¼ã¹ã¯
- OpenCVãAndroidããå©ç¨ããããããããã®OpenCVããã¸ã§ã¯ã(android-jni以ä¸)
- ã¢ããªã®ããã¸ã§ã¯ã(apps/ObjectRecognition以ä¸)
- æ¤åºå¯¾è±¡ã®ç»åããç¹å¾´ç¹ãæ¤åºãã¦ããã¦ã¼ãã£ãªãã£(dump_keypoints.cpp)
ã®3ã¤ããæ§æããã¦ãã¾ãã
ä¸è¨1çªã¯Androidã©ã¤ãã©ãªããã¸ã§ã¯ãã¨ãªã£ã¦ããã2çªããåç
§ããã¦ãããããEclipseã§ãã«ãããå ´åã¯ã両ããã¸ã§ã¯ããimportãã¦ããå¿
è¦ãããã¾ãã
ã¾ããæ¤åºå¯¾è±¡ã¨ãªãç©ä½ã®ç¹å¾´ãã¯ãã«ã¯apps/ObjectRecognition/assets/keypoints以ä¸ã«ããã¹ããã¡ã¤ã«ãé
ç½®ããã¦ãã¾ãã追å ãããå ´åã¯ãdump_keypointsã§ãã³ãããçµæãããã«è¿½å ãã2çªã®Javaã½ã¼ã¹ã§èªã¿è¾¼ãã§ããç®æãä¿®æ£ãã¦ã¿ã¦ãã ããã
ãã§ãã¯ã¢ã¦ãå¾ã®ã½ã¼ã¹ã«ã¯ããã«ãå¾ã®ãã¤ããªãå«ã¾ãã¦ãã¾ãããèªåã§ãã«ããããå ´åã
apps/ObjectRecognition
ã«ç§»åãã¦antã³ãã³ããå®è¡ãããã¨ã§Androidã¢ããªããã«ããããã¨ãã§ãã¾ãã
$ cd ${checkoutdir}/apps/ObjectRecognition $ ant debug
æ¹å¤æ¹æ³
ã½ã¼ã¹ãèªåã§ãããããå ´åãã¢ããªå´ã®Javaã½ã¼ã¹ã ããªããã§ãã¯ã¢ã¦ãå¾ã®ã½ã¼ã¹ããã®ã¾ã¾å¤æ´ãããã¨ãã§ãã¾ãã
c++é¨åã®ã½ã¼ã¹ããããããå ´åã¯ãAndroidãã¿ã¼ã²ããã«ãã¦OpenCVããã«ãã§ããç°å¢ãå¿
è¦ã§ãã
ã¾ã ç°å¢ãæ§ç¯ãã¦ããªã人ã¯ã
http://opencv.willowgarage.com/wiki/Android
ãåèã«ç°å¢æ§ç¯ãã¦ã¿ã¦ãã ããã
課é¡ã¨èå¯
SURFã®ç¹å¾´ç¹æ¤åºãã¨ã«ããé
ãã§ããæ¿æ·¡ã®å·®ãç´°ããæ¿ããç»åã ã¨ã1åã®æ¤åºå¦çã«ç´3secç¨ãããã¾ãã
OpenCVã¯ãä»ã«ãããã©ã«ãã§STARãFASTãªã©ã®ç¹å¾´ç¹æ¤åºã¢ã«ã´ãªãºã ãæè¼ãã¦ããããããã®æ¹ãSURFãããéãã®ã§ããã精度ã®ãã¥ã¼ãã³ã°ãéã«åããªãã£ããããSURFã§å®è£
ãã¦ãã¾ãã
å®ç¨åã«åãã¦ã¯ãé度ã¨ç²¾åº¦ã®ãã©ã³ã¹ãåã£ããã¥ã¼ãã³ã°ãè¡ãå¿
è¦ãããã¾ããï¼âãããããã ï¼
ã¾ããä»åã¯æ¯åLSHã«çªã£è¾¼ãç¹å¾´ãã¯ãã«ãæ¯åèªã¿è¾¼ãã§ããããã
- ç¹å¾´ãã¯ãã«ã®ãã¼ã¿ãè¨å¤§
- ç¹å¾´ãã¯ãã«ã®èªã¿è¾¼ã¿ã«æéãããã
ã¨ããåé¡ãããã¾ãã
åççã«ã¯è¨ç®ãããããã·ã¥å¤ã ãããã¼ã¿ã¨ãã¦æããã¦ããã°åè¿åã®è¨ç®ã¯ã§ããã¯ããªã®ã§ããã®é¨åã課é¡ã¨ãªãã¾ãã