1 | initial version |
you could use Matx<float,2,2> for your 'tensor'
typedef Matx<float,2,2> tensor;
Mat_<tensor> mt = Mat_<tensor>::zeros(4,4);
mt(2,2) = tensor(1,2,3,4);
cerr << mt << endl;
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 0, 0, 0, 0;
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
2 | No.2 Revision |
you could use Matx<float,2,2> for your 'tensor'
typedef Matx<float,2,2> tensor;
Mat_<tensor> mt = Mat_<tensor>::zeros(4,4);
mt(2,2) = tensor(1,2,3,4);
cerr << mt << endl;
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 0, 0, 0, 0;
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
but again, all with a grain of salt. you'll find a lot of unhandled operators, there's no constructor for your initialization above, etc.
3 | No.3 Revision |
you could use Matx<float,2,2> for your 'tensor'
typedef Matx<float,2,2> tensor;
Mat_<tensor> mt = Mat_<tensor>::zeros(4,4);
mt(2,2) = tensor(1,2,3,4);
cerr << mt << endl;
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 0, 0, 0, 0;
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
but again, all with a grain of salt. you'll probably find a lot of unhandled operators, there's no constructor for your initialization above, etc.operators.