开发者

SIFT implementation in C#

I want to use sift implementation in C#.

I found this website http://user.cs.tu-berlin.de/~nowozin/libsift/ but I am confused that there is no main program or project file. I couldn't understand how can I use it in normal C# console/window application and what is rule of GK# is.

开发者_开发问答

Could some one give me some useful hints, or does anybody know another implementation in C#?


There is no main program because it is obvisouly a class library. Either create a project using your favorite IDE and add the source files to it, or open a terminal window and build the library using the included Makefile.


https://sites.google.com/site/btabibian/projects/3d-reconstruction/code

You can find one implementation here which has a Sift class. Its based on EmguCV library. The sift_features (name is very against C# conventions) returns you a list of Feature object which has a double[] descriptor member.


This code is very similar to Surf algorithm http://www.emgu.com/wiki/index.php/SURF_feature_detector_in_CSharp .

    public Image<Bgr, Byte> PutFeaturesOnImage(string file)
    {
        Image<Gray, Byte> modelImage = new Image<Gray, byte>(file);
        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> image = Features2DToolbox.DrawKeypoints(modelImage, modelKeyPoints, new Bgr(Color.Red), Features2DToolbox.KeypointDrawType.DEFAULT);
        return image;
    }

Remember to add librarys:

using Emgu.CV;
using Emgu.CV.Features2D;
using Emgu.CV.Util;
using Emgu.CV.Structure;
using System.Drawing;

I compared EmguCv and OpenCV SIFT algorithms. The results are the same. In both examples are exactly the same number of features.


The naming convention follows the original C code publish by UBC, since it was only a test to see how the algorithm performs. I will be happy to help if you need any.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜