//#include "Rank.h"
#include
//#define N 10
#include
#include
#include
//#include"matlab.hpp"
using namespace cv;
using namespace std;
Mat Vec2Mat(vector> vec) //二维Vector转Mat
{
Mat m(vec.size(), vec[1].size(), CV_64F);
for (int i = 0; i < vec.size(); ++i)
m.row(i) = Mat(vec[i]).t();
return m;
}
int main()
{
vector> vec;
vec = { {1, 2, 3, 4},
{5, 6, 7, 8},
{9, 10, 11, 12},
{13, 14, 15, 16} };
int row = vec.size();
int col = vec[0].size();
Mat vec1(row, col, CV_32F);
vec1 = Vec2Mat(vec);
cout << vec1;
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)