您的位置:首页 > 其它

使用EMGU.CV对图像进行SIFT和SURF特征提取

2014-05-15 22:12 603 查看
using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Drawing;

using Emgu.CV;

using Emgu.CV.Features2D;

using Emgu.CV.Structure;

using Emgu.CV.Util;

namespace ConsoleApplication_test

{

    class Program

    {

        static void Main(string[] args)

        {

            //SURF特征

            /*

            Image<Gray, Byte> image = new Image<Gray, byte>("E:\\lena.jpg");

            SURFDetector detector = new SURFDetector(1000, false);

            VectorOfKeyPoint keyPoints;

            keyPoints = detector.DetectKeyPointsRaw(image, null);

            Matrix<float> descriptors = detector.ComputeDescriptorsRaw(image, null, keyPoints);

            Console.WriteLine(descriptors.Rows + "\t" + descriptors.Cols);

            */

            //SIFT特征

            Image<Gray, Byte> image = new Image<Gray, byte>("E:\\lena.jpg");

            SIFTDetector detector = new SIFTDetector();

            

            VectorOfKeyPoint keyPoints;

            keyPoints = detector.DetectKeyPointsRaw(image, null);

            Matrix<float> descriptors = detector.ComputeDescriptorsRaw(image, null, keyPoints);

            Console.WriteLine(descriptors.Rows + "\t" + descriptors.Cols);

            Console.ReadKey();

        }

    }

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: