テンプレートマッチング

テンプレートマッチング[1] とは画像処理ないしコンピュータビジョンの一手法。デジタル画像処理で、テンプレート画像に一致する画像の小さな部分を見つける手法で特定のパターンを検出するための画像などを用意し、観測画像と照らしあわせて当該箇所を検出する。比較する方法はさまざまである。 これは、製造において品質管理の一部として[2]、移動ロボットをナビゲートする方法[3]、または画像内のエッジを検出する方法として使用が可能[4]

機能ベースのアプローチ 編集

 
非表示レイヤーは、画像に関する分類情報を保持するベクトルを出力し、テンプレートマッチングアルゴリズムで画像の特徴として使用されます

テンプレートベースのアプローチ 編集

モーショントラッキングとオクルージョン処理 編集

計算解剖学における変形可能なテンプレート 編集

相互相関または絶対差の合計を使用して説明されるテンプレートベースのマッチング 編集

実装 編集

minSAD = VALUE_MAX;

// loop through the search image
for ( size_t x = 0; x <= S_cols - T_cols; x++ ) {
  for ( size_t y = 0; y <= S_rows - T_rows; y++ ) {
    SAD = 0.0;

    // loop through the template image
    for ( size_t j = 0; j < T_cols; j++ )
      for ( size_t i = 0; i < T_rows; i++ ) {

        pixel p_SearchIMG = S[y+i][x+j];
        pixel p_TemplateIMG = T[i][j];
		
        SAD += abs( p_SearchIMG.Grey - p_TemplateIMG.Grey );
      }

    // save the best found position 
    if ( minSAD > SAD ) { 
      minSAD = SAD;
      // give me min SAD
      position.bestRow = y;
      position.bestCol = x;
      position.bestSAD = SAD;
    }
  }
  
}

プロセスの高速化 編集

マッチングの精度を向上させる 編集

同様の方法 編集

使用例 編集

関連項目 編集

参考文献 編集

  1. ^ R. Brunelli, Template Matching Techniques in Computer Vision: Theory and Practice, Wiley, ISBN 978-0-470-51706-2, 2009 ([1] TM book)
  2. ^ Aksoy, M. S.; Torkul, O.; Cedimoglu, I. H. (2004). “An industrial visual inspection system that uses inductive learning”. Journal of Intelligent Manufacturing 15 (4): 569–574. doi:10.1023/B:JIMS.0000034120.86709.8c. 
  3. ^ Kyriacou, Theocharis, Guido Bugmann, and Stanislao Lauria. "Vision-based urban navigation procedures for verbally instructed robots." Robotics and Autonomous Systems 51.1 (April 30, 2005): 69-80. Expanded Academic ASAP. Thomson Gale.
  4. ^ WANG, CHING YANG, Ph.D. "EDGE DETECTION USING TEMPLATE MATCHING (IMAGE PROCESSING, THRESHOLD LOGIC, ANALYSIS, FILTERS)". Duke University, 1985, 288 pages; AAT 8523046

外部リンク 編集