当前位置:网站首页>[opencv] use filestorage to read and write eigenvectors
[opencv] use filestorage to read and write eigenvectors
2022-04-23 06:38:00 【mightbxg】
In their own cpp Add the following code to :
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
And then it can be like cv::Point_<T>
、cv::Point3_<T>
Use like that cv::FileStorage
Read and write Eigne::Vector2f
、Eigen::Vector3d
Other types , Include related sequence types std::vector<...>
and std::vector<std::vector<...>>
版权声明
本文为[mightbxg]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230546583703.html
边栏推荐
猜你喜欢
随机推荐
定位器
【UDS统一诊断服务】四、诊断典型服务(6)— 输入输出控制单元(0x2F)
Robocode教程8——AdvancedRobot
Make your own small program
【学习一下】HF-Net 训练
拷贝构造函数
[ThreadX] h743zi + lan8720 + ThreadX + netx duo transplantation
Cross domain issues - allow origin header contains multiple values but only one is allowed
安全授信
【UDS统一诊断服务】一、诊断概述(4)— 基本概念和术语
C语言的浪漫
Jeu de devinettes
vs中的多字节与unicode
Rust的闭包类型(Fn, FnMut, FnOne的区别)
相机标定:关键点法 vs 直接法
Object array and object pointer
File viewing commands and user management commands
Class inheritance and derivation
Static member
C语言实现2048小游戏方向合并逻辑