OpenCV杂记08---typedef,CV_VERSION,FileStorage

来源:互联网 发布:酒店管理系统数据库 编辑:程序博客网 时间:2024/05/06 08:53

typedef声明是为现有类型创建一个新的名字,类型别名。

typedef SURF SurfFeatureDetector;  typedef SURF SurfDescriptorExtractor;  

这就表示,SURF类忽然同时有了两个新名字SurfFeatureDetector以及SurfDescriptorExtractor。
也就是说,我们平常使用的SurfFeatureDetector类和SurfDescriptorExtractor类,其实就是SURF类,他们三者等价。

CV_VERSION,返回当前opencv的版本值,如2.4.8。

将mat类型的数据写入xml数据文件。

    FileStorage fs("D:\\TestImage\\Rename\\1.xml", FileStorage::WRITE);    fs<<"points"<<descriptors1;    fs.release();    cout<<"图像1特征描述矩阵大小:" << descriptors1.size() << endl;    cout<<"特征向量个数:" << descriptors1.rows <<endl;    cout<<"维数:"<< descriptors1.cols <<endl; 
0 0
原创粉丝点击