当前位置:网站首页>【OpenCV】使用 FileStorage 读写 Eigen 向量
【OpenCV】使用 FileStorage 读写 Eigen 向量
2022-04-23 05:48:00 【mightbxg】
在自己的 cpp 中加入以下代码:
namespace cv {
template <typename _Scalar, int _Dim>
class DataType<Eigen::Matrix<_Scalar, _Dim, 1>> {
public:
typedef Eigen::Matrix<_Scalar, _Dim, 1> value_type;
typedef Eigen::Matrix<typename DataType<_Scalar>::work_type, _Dim, 1> work_type;
typedef _Scalar channel_type;
enum {
generic_type = 0,
channels = _Dim,
fmt = traits::SafeFmt<channel_type>::fmt + ((channels - 1) << 8)
};
typedef Vec<channel_type, channels> vec_type;
};
} //namespace cv
然后就可以像 cv::Point_<T>、cv::Point3_<T> 那样使用 cv::FileStorage 来读写 Eigne::Vector2f、Eigen::Vector3d 等类型,包括相关序列类型 std::vector<...> 和 std::vector<std::vector<...>>
版权声明
本文为[mightbxg]所创,转载请带上原文链接,感谢
https://blog.csdn.net/mightbxg/article/details/117950625
边栏推荐
猜你喜欢
随机推荐
Definition of C class and method
Import of data
Explanation of login page
多线程爬取马可波罗网供应商数据
安装pyshp库
NVIDIA Jetson: GStreamer 和 openMAX(gst-omx) 插件
从源代码到可执行文件的过程
Conversion between JS object and string
St table template
大学概率论与数理统计知识点详细整理
Qthread simple test understanding
Easy to use data set and open source network comparison website
线程和进程的关系和区别是什么
H. Are You Safe? Convex hull naked problem
The onnx model of yolov5 removes the transfer layer
Linux 用rpm的方式安装mysql(超简单)
scikit-learn sklearn 0.18 官方文档中文版
7-21日错题涉及知识点。
[leetcode 19] delete the penultimate node of the linked list
SVN简单操作命令





![[leetcode 19] delete the penultimate node of the linked list](/img/ba/3c73fba8c4b4e3de7e506670144890.png)



