1 | initial version |
you can try :
vector<vector<double>> x = { {1.7,2.8,3.9},{4,5.1,6.2} };
Mat w(x[0]),a;
for (int i = 1; i < x.size(); i++)
w.push_back(Mat(x[i]));
w = w.reshape(x[0].size());
w.convertTo(a, CV_16U);
cout << w << "\n";
cout << a << "\n";
results :
[1.7, 2.8, 3.9;
4, 5.1, 6.2]
[2, 3, 4;
4, 5, 6]