Opencv error unspecified error incorrect element name operator <<
来源:互联网 发布:部落冲突矿工升级数据 编辑:程序博客网 时间:2024/05/22 14:04
1.问题描述
今天在用opencv的FileStorage类进行xml文件读写操作的时候报了个错。
源代码如下所示:
#include <opencv2\opencv.hpp>#include <vector>#include <iostream>using namespace std;using namespace cv;typedef pair<Point, double> PointTemper;int main(){ vector<PointTemper> a; a.push_back(make_pair(Point(1, 1), 2.5)); a.push_back(make_pair(Point(2, 2), 3.4)); FileStorage fs("a.yml", FileStorage::WRITE); if (!fs.isOpened()) { cout << "cannot open xml file to write" << endl; getchar(); return 0; } fs << "a_size" << (int)(a.size()); fs << "1-th" << "["; fs << "{" << "point_x" << a[0].first.x << "point_y" << a[0].first.y << "temper" << a[0].second << "}"; fs << "{" << "point_x" << a[1].first.x << "point_y" << a[1].first.y << "temper" << a[1].second << "}"; fs << "]"; fs.release(); }
报错信息如下所示:
2.解决方法
错误信息的意思应该是说FileNode里面的key名字不能以数字开头,改成其他的命名就解决问题了。
0 0
- Opencv error unspecified error incorrect element name operator <<
- OpenCV Error: Unspecified error "..., 321OpenCV Error: Unspecified error (The function is not implem
- Error 80004005 Unspecified Error
- OpenCV Error: Unspecified error (The function is not implemented...
- OpenCV Error: Unspecified error (The function is not implemented...
- 【Ubuntu-Opencv】Ubuntu14.04 Opencv3.3.0 使用中出现OpenCV Error: Unspecified error
- OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows,
- cudaSafeCall() Runtime API error : unspecified driver error
- "Incorrect table name" instead of "Identifier too long" error when table name > 64 Characters
- ERROR 1366 (HY000): Incorrect string value: '\xC6\xF4\xD3\xC3' for column 'name' at row 1
- ERROR 1366 (HY000): Incorrect string value: '\xE7\x9A\x84' for column 'name' at row 1
- ERROR 1366 (HY000): Incorrect string value: '\xC6\xF4\xD3\xC3' for column 'name' at row 1
- MySQL Error : Incorrect date value
- magento incorrect ip format error
- Error : Truncated incorrect DOUBLE value
- Unmarshalling Error: unexpected element
- Cannot open volume for direct access +++ Can unspecified error occurred
- error C2593: “operator +=”不明确
- Java字符串数组初始化和赋值
- Java集合之List遍历找到匹配元素删除方法总结
- [BZOJ2303][Apio2011]方格染色(数学相关+加权并查集)
- 提高篇项目2-二分法解方程
- bzoj 2303: [Apio2011]方格染色 (并查集)
- Opencv error unspecified error incorrect element name operator <<
- G
- 极光推送步骤!!!
- 2017-04-28(读入问题)
- SSH中文乱码
- 最大子串和
- Android中Crash收集
- Linux中atexit()在有多个自定义函数时对函数的调用顺序验证
- [iOS MQTT消息订阅] MQTTClient框架