保存提取的特征opencv

发布于 2024-12-08 19:37:12 字数 235 浏览 0 评论 0原文

我已经在 OpenCV 中提取了 SIFT 特征描述符。下一步是训练 SVM,但在此步骤之前,我认为我需要将提取的特征保存在文件中,以便训练这些特征...

所以我的问题是:1-如何保存这些矩阵? 2-我想知道如何处理这些特征,我提取了一张图像的特征,但我需要为一个对象(例如可乐)的不同姿势的许多图像提取特征并将它们保存在一个文件中

......你有什么想法,如何在 opencv 中做到这一点?

谢谢...

I have extracted the SIFT feature descriptors in OpenCV.. Next step to me is to train an SVM but before that step, I think I need to save the extracted features in a file, in order to train these features...

So my questions are: 1- how to save these matrices?
2- I would like to know what to do about the features, I extracted features for one image, but I need to extract features for many images in different pose for one object (e.g cola) and save them in one file...

Do you have any idea, how to do that in opencv?

Thank you...

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

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

发布评论

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

评论(1

墨小沫ゞ 2024-12-15 19:37:12
  1. 如果您想将 OpenCV Mat 保存到文件中,请查看 FileStorage 类。出于您的目的,它可能看起来像:

    FileStorage fs("features.yml", FileStorage::WRITE);
    
    Mat cola特点XYZ;
    
    // 将 SIFT 特征向量计算为 colaFeaturesXYZ;
    
    fs << “cola_pose_xyz”<<可乐特征XYZ;
    
  2. 如果您想将这些功能存储在数据库中以便以后搜索,您可以考虑查看bagofwords_classification.cpp OpenCV 提供的示例。这可能具有您正在寻找的所有功能。

  1. If you would like to save an OpenCV Mat to file have a look at the FileStorage class they provide. For your purposes it might look something like:

    FileStorage fs("features.yml", FileStorage::WRITE);
    
    Mat colaFeaturesXYZ;
    
    // compute SIFT features vectors to colaFeaturesXYZ;
    
    fs << "cola_pose_xyz" << colaFeaturesXYZ;
    
  2. If you want to store these features in a database for later searching you might consider having a look at the bagofwords_classification.cpp sample provided by OpenCV. This may have all the functionality you are looking for.

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