Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Make a 3D mat from a std::vector of 2D mat

Hi,

I have a std vector of several 2D Mat std::vector<cv::Mat> matList, and instead of accessing the pixel values in the third dimension by using, e.g., matList.at(k).at<float>(i, j), i'd like to have a 3D mat so that I would access that same pixel using mat3D.at<float>(i, j, k). k can be up to several hundreds. What would be the most efficient way to make this conversion, apart from assigning each pixel explicitly?