3æ¥ã§ä½ãé«éç¹å®ç©ä½èªèã·ã¹ãã (2) SIFTç¹å¾´éã®æ½åº
3æ¥ã§ä½ãé«éç¹å®ç©ä½èªèã·ã¹ãã (1) ç©ä½èªèã¨ã¯ï¼2009/10/18ï¼ã®ç¶ãã§ãã
ä»åã¯ãç»åããSIFT (Scale-Invariant Feature Transform) ã¨ããå±æç¹å¾´éãæ½åºããã¨ãããä½ã£ã¦ã¿ããã¨æãã¾ãã
SIFTç¹å¾´éã®æ½åº
ã¾ãã¯ãå±æç¹å¾´éã®ä»£è¡¨ã¨ããããSIFTã試ãã¦ã¿ã¾ããOpenCVã«ã¯SIFTãæ½åºããé¢æ°ããªãã£ãã®ã§Rob Hessæ°ãCè¨èªã§å®è£ ããã©ã¤ãã©ãªã試ãã¦ã¿ã¾ããå é¨ã§OpenCVã使ã£ã¦ããã®ã§äºåã«OpenCVã®ã¤ã³ã¹ãã¼ã«ãå¿ è¦ã§ããå®è£ ã¯OpenCV 1.1ã§ããã¦ããã¿ããã§ããã2.0ã§ãã¡ãã£ã¨æç´ãããã¨åãã¾ãããRob Hess氏のホームページããSIFT Feature Detectorã®zipçãè½ã¨ãã¾ãã
ï¼æ³¨ï¼Hessæ°ã®ãµã¤ããæ´æ°ãããããã§ç¾å¨ã¯GitHubä¸ã®OpenSIFTã¨ããããã¸ã§ã¯ãã§å ¬éããã¦ãã¾ãã
解åããã¨ãããããã¡ã¤ã«ãã§ãã¾ãããSIFTãæ½åºããã®ã«æä½éå¿ è¦ãªã®ã¯ã
siftfeat.c - ã¡ã¤ã³é¢æ° sift.c sift.h - SIFTæ½åºç¨é¢æ° imgfeatures.c imgfeatures.h - SIFTç¹å¾´éãæç»ãä¿åããé¢æ° utils.c utils.h - ã¦ã¼ãã£ãªãã£é¢æ° beaver.png - ãã¹ãç»å
ã§ããããããèªåã®ããã¸ã§ã¯ãã«è¿½å ãã¾ããOpenCV2.0ã§ã³ã³ãã¤ã«ããã¨ããã¤ãã¨ã©ã¼ãåºã*1ã®ã§ç´ãã¾ããimgfeatures.cã®373è¡ç®ã
cvEigenVV( &M, &V, &E, DBL_EPSILON, 0, 0 );
siftfeat.cã®28, 29è¡ç®ã
char* img_file_name = "beaver.png"; char* out_file_name = "beaver.sift";
åãã72è¡ç®ã
cvSaveImage( out_img_name, img, 0);
ã«ä¿®æ£ãã¾ããã¾ã ããããè¦åã¯åºã¾ããã¨ããããã³ã³ãã¤ã«ã§ãã¾ããbeaver.pngã¨ããç»åã§å®è¡ããã¨ä¸ã®ãããªç»åã表示ããã¾ãã
ç¢å°ã®å§ç¹ã¯ãã¼ãã¤ã³ãã®ä½ç½®ãç¢å°ã®é·ãã¯ã¹ã±ã¼ã«ãç¢å°ã®åãã¯å¾é 強度ããã£ã¨ãå¼·ãåãã表ãã¦ããããã§ããSIFTã®è¡¨ç¤ºæ¹æ³ã¯ãã¼ãã¤ã³ãã®ç¹ã ã表示ãç¢å°ã§è¡¨ç¤ºãåã§è¡¨ç¤ºãªã©ããããããã¿ããã§ãããã¹ã±ã¼ã«ãå¾é 強度ãä½ãæå³ãã¦ãããã¯ããå°ã調æ»ãå¿ è¦ã§ããå½é¢ã¯ãSIFTã®ãã¼ãã¤ã³ãã®ä½ç½®ã¨ããããã®ç¹ã128次å ã®ç¹å¾´ãã¯ãã«ã§è¡¨ãããã¨ã ããããã¨ãã°ããããªï¼
ããããã®ãã¼ãã¤ã³ãã®128次å ãã¯ãã«ã¯ãbeaver.siftã¨ãããã¡ã¤ã«ã«ä¿åããã¦ãã¾ããç¢å°1æ¬ã«ã¤ã128åã®æ°å¤ï¼128次å ãã¯ãã«ï¼ã§ããä¸ã®ãããªãã¡ã¤ã«ã§ãã
114 128 <--- ãã¼ãã¤ã³ãã®æ°ã¨ç¹å¾´ãã¯ãã«ã®æ¬¡å æ° 101.350182 136.130755 40.169879 0.771085 <--- 1ã¤ããã¼ãã¤ã³ãã®X座æ¨, Y座æ¨, ã¹ã±ã¼ã«, åã 0 0 0 0 3 1 0 0 2 23 46 15 18 3 0 0 6 20 13 1 <--- ã¤ã³ãã³ãããã¦ããæ°åã128次å ãã¯ãã«ï¼20åã§æ¹è¡ãå ¥ãï¼ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 36 0 0 81 95 57 47 185 114 2 7 185 155 19 6 19 6 1 22 22 0 0 0 0 0 0 1 0 0 0 0 37 8 0 0 91 12 0 1 185 144 11 35 185 50 0 0 23 28 8 95 40 1 0 0 0 0 0 4 0 0 0 0 0 0 0 0 11 5 0 0 4 2 0 0 49 20 0 0 1 0 0 1 0 0 0 0 0 0 0 0 127.871536 71.100579 15.768590 -2.024589 <--- 2ã¤ãã®ãã¼ãã¤ã³ã 1 2 2 72 63 12 1 1 133 93 1 4 2 7 4 44 133 115 0 0 0 0 0 20 9 4 0 0 0 0 0 0 23 0 1 9 107 20 1 8 133 5 0 0 0 1 5 133 132 14 0 0 0 0 8 133 14 1 0 0 0 0 0 8 26 0 0 0 126 37 8 22 133 47 0 0 0 0 3 52 131 41 0 0 0 0 2 36 1 0 0 0 0 0 0 2 2 0 0 0 34 105 80 24 111 15 0 0 0 1 55 66 79 21 0 0 0 0 0 5 0 0 0 0 0 0 0 0
ä¸ã®ç»åã®å ´åã128次å ãã¯ãã«114æ¬ã«ãã£ã¦è¡¨ãããã£ã¦ãã¨ã§ããããã®128次å ãã¯ãã«114æ¬ãç©ä½ã¢ãã«ãã¼ã¿ãã¼ã¹ã«ç»é²ãã¦ãããã¨ã«ãªãã¾ãããã£ããè¨å¤§ãªæ°å¤ã§ãããã®ãã¡ã¤ã«ããã観å¯ããã¨ã©ããããã¼ãã¤ã³ãã¯ã¹ã±ã¼ã«ã®å¤§ããªé ï¼ç¢å°ãé·ãé ï¼ã«ä¸¦ãã§ãããã¨ããããã¾ããããã¾ãã¾ã ããããã£ã¦ãªãã®ã§ãããã¹ã±ã¼ã«ã大ãããã¼ãã¤ã³ãã»ã©éè¦ã¨è§£éãã¦ããã®ã§ããããï¼ãã詳ããæ¹ããããã¢ããã¤ã¹ãã ããã
ãã¼ãã¤ã³ããç¹ã§æç»
ããã§ã¡ãã£ã¨æ¹é ãã¦ã¿ã¾ãããã¼ãã¤ã³ããç¢å°ã§ã¯ãªãç¹è¡¨ç¤ºã«ããSIFTãã¡ã¤ã«ã1è¡ã§1åã®ãã¼ãã¤ã³ãæ å ±ã表ãããã«ãã¾ããimgfeature.cã®595è¡ç®ãããã
// cvLine( img, start, end, color, 1, 8, 0 ); // cvLine( img, end, h1, color, 1, 8, 0 ); // cvLine( img, end, h2, color, 1, 8, 0 ); cvCircle(img, cvPoint(start_x, start_y), 2, cvScalar(0,255,255,255), -1, 0, 0);
ã¨ããåããã¡ã¤ã«ã®523è¡ç®ãããï¼æ°å20åããã«æ¹è¡ãå ¥ããé¨åï¼ãã³ã¡ã³ãã¢ã¦ããã¾ãã
// if( j % 20 == 0 ) // fprintf( file, "\n" );
ããããã¨ä¸ã®ããã«ãã¼ãã¤ã³ããç¹ã«ãªãã¾ããbeaver.siftã1ã¤ã®ãã¼ãã¤ã³ãã®æ å ±ã1è¡ã«ã¾ã¨ã¾ãã¾ããã¹ã¯ãªããã§å¦çããã¨ãã¯ãã£ã¡ã®æ¹ã楽ã ã¨æãã¾ãã
ããã¤ãã®ç»åã§SIFTãã¼ãã¤ã³ããæç»ãã¦ã¿ã¾ããSIFTãç»åã®ã©ãããã¨ããããã¼ãã¤ã³ãã¨ãã¦ãã大ä½æ³åã¤ãã¾ãããé°é½ãã¼ã¯ã¿ããã«ãã¾ã模æ§ããªãç»åã§ã¯ãã¼ãã¤ã³ããå°ãªããªããã¡ã¿ããã§ãã
SIFTã®è©³ç´°
SIFTã®ãã¼ãã¤ã³ãã¯ãç»åã®ç¹å¾´ããã表ãã¦ããå ´æã£ã¦ãã¨ã¯ãããã¾ãããã§ã¯ãã©ãããæ ¹æ ã«åºã¥ãã¦ãã®ç¹ãé¸ã°ããã®ãï¼128次å ãã¯ãã«ãã©ããã風ã«æ±ããããã®ãï¼ã¯ã¢ã«ã´ãªãºã ã®è©³ç´°ã詳ãã調ã¹ãå¿ è¦ãããã¾ããSIFTã¯çµæ§è¤éãªãã¨ããã£ã¦ãã¦ãã¬ã¦ã·ã¢ã³å¹³æ»åãã£ã«ã¿ãDifference of Gaussian (DoG)ãå±å¤æ¤åºãç»åã®å¾®åã強度å¾é ãªã©ç»åå¦çã®çè«ãããã£ã¦ããªãã¨ç解ãé£ããã»ã»ã»ç§ãã¾ã ãã¼ããã«çå±ãããã£ã¦ããç¨åº¦ã§ãã
1ã¤æãéãããã¦ãã®ã¯ãSIFTã¯è²æ å ±ã使ã£ã¦ãªãã£ã¦ãã¨ããªãå®éãã°ã¬ã¼ã¹ã±ã¼ã«ç»åããæ½åºãã¦ã¾ããããã¤ãåèã«ããæç®ãæãã¦ããã¾ããããããåèã«ãã®ãã¡C++çã®SIFTãä½ã£ã¦ã¿ããã¨æãã¾ãã
3æ¥ã§ä½ãé«éç¹å®ç©ä½èªèã·ã¹ãã (3) SURFã®æ½åºï¼2009/10/30ï¼ã¸ã¤ã¥ãã¾ãã
- SIFTチュートリアル - è¤åå çã«ããSIFTã®è§£èª¬è³æãå³ãè±å¯ã§ããããããã
- SIFTを1から組むブログ - æé ã追ã£ã¦å°ããã¤å®è£ ãã¦ããã®ã§ãããããããéä¸ã§ãããâªã£ã¦ãã¾ããã¦ããã©ï¼ç¬ï¼
- Rob Hess氏のSIFT特徴量抽出モジュールつかってみる - Rob Hessæ°ã®ããã°ã©ã ã®å®è¡æ¹æ³ã§ãã
- SIFT++ - å¥ã®å®è£ ããã£ã¡ã試ãã¦ã¿ããã
- SIFT for Matlab - Matlabã«ããå®è£ ã
- Scale-invariant feature transform - Wikipediaã®è¨äºã
- Keypoint detector - SIFTã®ææ¡è Loweæ°ã®ãã¢ã
- D. G. Lowe: Object recognition from local scale-invariant features (PDF), Proc. of IEEE Intl. Conf. on Computer Vision (ICCV), pp.1150-1157 (1999) - SIFTã®åè«æ
- D. Lowe: Distinctive imagefeatures from scale-invariant keypoints (PDF), Proc. of Intl. Journal of Computer Vision (IJCV), 60(2), pp.91-110 (2004) - SIFTã®åè«æ
ãã®ã·ãªã¼ãºã®è¨äºä¸è¦§
- 3æ¥ã§ä½ãé«éç¹å®ç©ä½èªèã·ã¹ãã (1) ç©ä½èªèã¨ã¯ï¼2009/10/18ï¼
- 3æ¥ã§ä½ãé«éç¹å®ç©ä½èªèã·ã¹ãã (2) SIFTç¹å¾´éã®æ½åºï¼2009/10/24ï¼
- 3æ¥ã§ä½ãé«éç¹å®ç©ä½èªèã·ã¹ãã (3) SURFã®æ½åºï¼2009/10/30ï¼
- 3æ¥ã§ä½ãé«éç¹å®ç©ä½èªèã·ã¹ãã (4) ç¹å¾´ç¹ã®ãããã³ã°ï¼2009/11/2ï¼
- 3æ¥ã§ä½ãé«éç¹å®ç©ä½èªèã·ã¹ãã (5) ç©ä½ã¢ãã«ãã¼ã¿ãã¼ã¹ã®ä½æï¼2009/11/14ï¼
- 3æ¥ã§ä½ãé«éç¹å®ç©ä½èªèã·ã¹ãã (6) ç·å½¢æ¢ç´¢ãç¨ããç¹å®ç©ä½èªèï¼2009/11/22ï¼
- 3æ¥ã§ä½ãé«éç¹å®ç©ä½èªèã·ã¹ãã (7) æè¿åæ¢ç´¢ã®é«éåï¼2009/12/12ï¼
*1:MinGWã使ã£ã¦ã¾ããVisual C++ãªãåºãªãã®ããªï¼