Iterate over multiple vectors of uneven Mat

asked 2016-01-21 09:47:27 -0500

podlipensky gravatar image


I have two vectors with uneven Mat

vector<Mat> delta_nabla_w = GetWeightsMatDelta();  // [Mat(10, 20), Mat(20, 40), Mat(40, 10)]
vector<Mat> nabla_w = GetWeightsMatZeros(); // [Mat(10, 20), Mat(20, 40), Mat(40, 10)]

I need to iterate over both of them at the same time and sum them up. I've tried this:

for(int j = 0; j < nabla_w.size(); j++) {<Mat>(j) +=<Mat>(j);

But it gives me an error Mat does not refer to a value, which kind of make sense. Could you please help me on this one?

edit retag flag offensive close merge delete


wait, cv::Mat has a at<someType> but accessing the vector is still plain or even nabla_w[j]

berak gravatar imageberak ( 2016-01-21 10:01:51 -0500 )edit