7-将sift特征保存到文档里

Posted yangyangthss

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了7-将sift特征保存到文档里相关的知识,希望对你有一定的参考价值。

1-

http://blog.csdn.net/woainiwss/article/details/49660393

2-

#include <opencv2/opencv.hpp> 

#include <opencv2/features2d/features2d.hpp>
#include<opencv2/nonfree/nonfree.hpp>
#include<opencv2/legacy/legacy.hpp>
#include<vector>
#include <fstream>

using namespace std;
using namespace cv;

int main()
{
//从文件中读入图像
Mat img = imread("1.jpg");

//如果读入图像失败
if (img.empty()){
fprintf(stderr, "Can not load image \\n");
return -1;
}
//显示图像
imshow("image before", img);

//sift特征检测
SiftFeatureDetector siftdtc;
vector<KeyPoint>kp;
siftdtc.detect(img, kp);
Mat outimg;
drawKeypoints(img, kp, outimg);
imshow("image keypoints", outimg);

SiftDescriptorExtractor extractor;//特征提取器
Mat descriptor;
extractor.compute(img, kp, descriptor);
ofstream file("./1.txt");
file << endl << descriptor << endl;

//此函数等待按键,按键盘任意键就返回
waitKey();
return 0;
}

 

3-

 

以上是关于7-将sift特征保存到文档里的主要内容,如果未能解决你的问题,请参考以下文章

Bag of words模型

SIFT/SURF

java怎么实现导出数据后放到word文档中,并且可以保存到本硬盘上(类似于百度文库里面的下载功能)

SIFT特征和图像分类?

Deep Learning 初识

如何将word文档内容直接复制到网页编辑器里?包括word文档内的图片,谢谢