1 | initial version |
vector<uchar> v2 = { 2, 3, 9, 6 };
mat.push_back(v2);
there is a conversion operator to Mat for your vector, but it makes a single column (4 rows) of it, while you would need a single row (the transposed version of it) for push_back:
mat.push_back(Mat(v2).t());
vector<vector<uchar>> v1 = { { 5, 77, 0, 4 },{ 2, 3, 9, 6 } };
mat.push_back(v1);
yes, you can have a vector<T>
here, but not a vector<vector<T>>
2 | No.2 Revision |
vector<uchar> v2 = { 2, 3, 9, 6 };
mat.push_back(v2);
there is a conversion operator to Mat for your vector, but it makes a single column (4 rows) of it, while you would need a single row (the transposed version of it) for push_back:
mat.push_back(Mat(v2).t());
vector<vector<uchar>> v1 = { { 5, 77, 0, 4 },{ 2, 3, 9, 6 } };
mat.push_back(v1);
yes, you can have a vector<T>
here, but not a vector<vector<T>>
(there needs to be a defined DataType for everything, that can be in a Mat)
3 | No.3 Revision |
vector<uchar> v2 = { 2, 3, 9, 6 };
mat.push_back(v2);
there is a conversion operator to Mat for your vector, but it makes a single column (4 rows) of it, while you would need a single row (the transposed version of it) for push_back:
// clumsy, but works:
mat.push_back(Mat(v2).t());
// will never work
vector<vector<uchar>> v1 = { { 5, 77, 0, 4 },{ 2, 3, 9, 6 } };
mat.push_back(v1);
yes, you can have a vector<T>
here, but not a vector<vector<T>>
(there needs to be a defined DataType for everything, that can be in a Mat)