本文介绍了如何将dlib中的矩阵转换为std :: vector的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在dlib中定义了colume矢量。如何将其转换为std :: vector?
I have a colume vector defined in dlib. How can I convert it to std::vector?
typedef dlib::matrix<double,0,1> column_vector; column_vector starting_point(4); starting_point = 1,2,3,4; std::vector x = ??谢谢
推荐答案有很多方法。您可以通过for循环将其复制。或使用采用迭代器的std :: vector构造函数: std :: vector< double> x(starting_point.begin(),starting_point.end())。
There are many ways. You could copy it via a for loop. Or use the std::vector constructor that takes iterators: std::vector<double> x(starting_point.begin(), starting_point.end()).
更多推荐
如何将dlib中的矩阵转换为std :: vector
发布评论