1

I want to create a vector of matrices which each cell of a matrix is a 2 element vector. I tried to use this code but it gets stuck on assignment.

typedef Vec<char, 2> Vec2u;

Mat VecMat[8];
VecMat[0].create(FrameHeight, FrameWidth, CV_8UC2);
VecMat[1].create(FrameHeight, FrameWidth, CV_8UC2);
VecMat[2].create(FrameHeight, FrameWidth, CV_8UC2);
VecMat[3].create(FrameHeight, FrameWidth, CV_8UC2);
VecMat[4].create(FrameHeight, FrameWidth, CV_8UC2);
VecMat[5].create(FrameHeight, FrameWidth, CV_8UC2);
VecMat[6].create(FrameHeight, FrameWidth, CV_8UC2);
VecMat[7].create(FrameHeight, FrameWidth, CV_8UC2);

Vec2u elem;
elem[0] = num1;
elem[1] = num2;
VecMat[2].at<Vec2u>(row,col) = elem;

Any ideas why??? Thanks

RamBracha
  • 381
  • 1
  • 5
  • 7
  • 1
    Have you seen [this][1] answer? I think it's what you're looking for. [1]: http://stackoverflow.com/a/1836580 – cid Jun 28 '13 at 07:33
  • What do you mean by "it gets stuck"? – Bull Jun 28 '13 at 09:34
  • The code supposed to work in 30 frames per second. And it does if I remark the assignment line. I don't understand why does it take so much computation to do simple assignment – RamBracha Jul 01 '13 at 08:42

0 Answers0