Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

i found a solution:

vector<vector<Mat>> B;
for (int i = 0; i<dim1; i++) {
    B.push_back(vector<Mat>());
    for (int j = 0; j<dim2; j++)
        B[i].push_back(Mat(dim3, dim4, CV_64F, Scalar::all(1)));
}
Mat in = A.reshape(1, 1);
Mat subImg;
for (int i = 0; i < 256; i++)
{
    for (int j = 0; j < 20; j++)
    {
        subImg = in(cv::Range(0, 1), cv::Range(100 * j, 100 * j + 100));
        subImg.reshape(10, 10);
        B[i][j] = subImg;
    }
}
return B;