2015-07-11 309 views
2

我希望代码根据SIFT关键点匹配两张图片。如何匹配两幅图像的EMGU CV SIFT关键点?

我有以下代码为SIFT

public static Image<Bgr, Byte> siftFunction(Bitmap sourceBitmap) 
    { 
     Image<Gray, Byte> modelImage = new Image<Gray, byte>(sourceBitmap); 
     SIFTDetector siftCPU = new SIFTDetector(); 
     VectorOfKeyPoint modelKeyPoints = new VectorOfKeyPoint(); 
     MKeyPoint[] mKeyPoints = siftCPU.DetectKeyPoints(modelImage, null); 
     modelKeyPoints.Push(mKeyPoints); 
     ImageFeature<float>[] reulst = siftCPU.ComputeDescriptors(modelImage, null, mKeyPoints); 
     Image<Bgr, Byte> result = Features2DToolbox.DrawKeypoints(modelImage, modelKeyPoints, new Bgr(Color.Red), Features2DToolbox.KeypointDrawType.DEFAULT); 
     return result; 
    } 

回答

0

一个解决方案是使用物体检测的所提供的示例,并且然后比较检测的区域。如果整个观察图像对应于模型图像 - 图像匹配。

其他解决方案 - 请不要使用描述符,而只是选择关键点。然后比较两张图片的关键点阵列,并在相等的情况下考虑图像匹配。

第一个解决方案以某种方式更可靠,而第二个解决方案更快更简单。