C# 中的 SIFT 实现

发布于 2024-10-09 14:59:33 字数 279 浏览 0 评论 0原文

我想在 C# 中使用 sift 实现。

我找到了这个网站 http://user.cs.tu-berlin.de/ ~nowozin/libsift/ 但我很困惑没有主程序或项目文件。我无法理解如何在普通的 C# 控制台/窗口应用程序中使用它以及 GK# 的规则是什么。

有人可以给我一些有用的提示吗,或者有人知道 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#?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

戏蝶舞 2024-10-16 14:59:33

没有主程序,因为它显然是一个类库。使用您最喜欢的 IDE 创建项目并向其中添加源文件,或者打开终端窗口并使用包含的 Makefile 构建库。

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.

情何以堪。 2024-10-16 14:59:33

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

您可以在这里找到一个具有 Sift 类的实现。它基于 EmguCV 库。
sift_features(名称非常违反 C# 约定)返回一个具有 double[] 描述符成员的 Feature 对象列表。

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.

音盲 2024-10-16 14:59:33

此代码与 Surf 算法非常相似 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;
    }

记得添加库:

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

我比较了EmguCv和OpenCV SIFT算法。结果是一样的。在这两个示例中,特征数量完全相同。

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.

深海夜未眠 2024-10-16 14:59:33

命名约定遵循 UBC 发布的原始 C 代码,因为这只是一个测试来了解算法的执行情况。如果您需要任何帮助,我将很乐意提供帮助。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文