当前位置:网站首页>【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
边栏推荐
猜你喜欢

P1586 solution to tetragonal theorem

Robocode教程8——AdvancedRobot

Solution to the trial of ycu Blue Bridge Cup programming competition in 2021

MySQL groups are sorted by a field, and the first value is taken
![[leetcode 59] spiral matrix II](/img/6e/58e600272797563129d2b325a054b5.png)
[leetcode 59] spiral matrix II

ArcGIS表转EXCEL超出上限转换失败

Installation and usage skills of idea

St table template

C#中?的这种形式

批量导出Arcgis属性表
随机推荐
日志
批量导出Arcgis属性表
Rust:单元测试(cargo test )的时候显示 println 的输出信息
[leetcode 290] word rules
类和对象的初始化(构造函数与析构函数)
selenium+webdriver+chrome实现百度以图搜图
Qthread simple test understanding
ArcGIS license错误-15解决方法
Robocode教程5——Enemy类
Robocode教程7——雷达锁定
如何安装jsonpath包
Understanding and installing MySQL
Doomsday (simple computational geometry)
Miscellaneous 1
Introduction to virtualization features
队列解决约瑟夫问题
[leetcode 54] spiral matrix
Explanation of the second I interval of 2020 Niuke summer multi school training camp
Storing inherited knowledge in cloud computing
Substring Inversion (Easy Version)