Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

you need a fresh Mat instance for each element of your array /vector, like:

vector<Mat> im {
     Mat(r,c,CV_8UC3),
     Mat(r,c,CV_8UC3),
     Mat(r,c,CV_8UC3)
};

please do NOT try like this:

vector<Mat> im(3, Mat(r,c,16));

(because all 3 Mat instances will point to the same Mat.data)