1

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<>。我正在查找 ImageFeature<> 的功能我找不到它请帮助我。

4

1 回答 1

1

ImageFeature[] 结果由多个样本组成,具体取决于图像,每个样本由关键点和描述符(128)组成,即您正在寻找的特征。您可以通过例如说 result[x].Descriptor[j] 来访问它,x 具有样本数的最大值,j 具有最大值 128。

于 2016-05-15T03:26:39.583 回答