2016-07-05 3 views
0

Emgu CVのSURF機能を使用して、画像内の同様のオブジェクトを認識しています。 画像が描画され、両方の画像に見つかったすべてのキーポイントが表示されます。問題は、画像にも同様の点が見られることです。SURF機能で関心ポイントを保存する方法は?

これらのマッチポイントをデータベースに保存するにはどうすればよいですか?

答えて

0

まず、その中に次のコードを記述し、その後クラスSURF.csを作成します。

     SURF FindImageSURF = new SURF(); 

     string[] filePaths = Directory.GetFiles(@"E:\folderimages\"); 

     for (int i = 0; i < filePaths.Length; ++i) 
     { 
      string path = filePaths[i]; 
      using (Image<Gray, Byte> modelImage = new Image<Gray, byte>(path)) 
      { 
       FindImageSURF.FindSURF(modelImage); 
      } 
     } 
:以下のコードを記述 program.csで、その後

 public void FindSURF(Image<Gray, Byte> modelImage) 
    { 
     VectorOfKeyPoint modelKeyPoints; 
     SURFDetector surfCPU = new SURFDetector(500, false); 

     //extract features from the object image 
     modelKeyPoints = new VectorOfKeyPoint(); 
     Matrix<float> modelDescriptors = surfCPU.DetectAndCompute(modelImage, null, modelKeyPoints); 
    } 

関連する問題