在C#中使用SIFT比较描述符

时间:2015-01-14 11:45:03

标签: compare emgucv sift feature-descriptor

Image My_Image = new Image(Openfile.FileName);

            pictureBox1.Image = My_Image.ToBitmap();
            Image<Gray, Byte> modelImage = My_Image.Convert<Gray, byte>();
            SIFTDetector siftCPU = new SIFTDetector();
            VectorOfKeyPoint modelKeyPoints = new VectorOfKeyPoint();


            MKeyPoint[] mKeyPoints = siftCPU.DetectKeyPoints(modelImage, null);
            modelKeyPoints.Push(mKeyPoints);
            ImageFeature<float>[] results = siftCPU.ComputeDescriptors(modelImage, null, mKeyPoints);
            Image<Bgr, Byte> image = Features2DToolbox.DrawKeypoints(modelImage, modelKeyPoints, new Bgr(Color.Red), Features2DToolbox.KeypointDrawType.DEFAULT);
            pictureBox1.Image = image.ToBitmap();

这个程序只在一个图像中找到SIFT描述符。我想与Image进行比较,但我不知道哪个ImageFeature&lt;&gt;我会用的。我正在查找ImageFeature的功能&lt;&gt;我找不到它 请帮我。

1 个答案:

答案 0 :(得分:1)

ImageFeature []结果包含许多样本,具体取决于图像,每个样本由关键点和描述符(128)组成,这是您要查找的功能。 您可以通过例如说result [x] .Descriptor [j]来访问它,x具有样本编号的最大值,j具有最大值128.