Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Error: Sizes of input arguments do not match, why?

I have the following code and it produces the error "Sizes of input arguments do not match" at the line where I try to add two cv::Mat objs together. Why?

std::vector<cv::Mat> depths;
for (int i = 0; i<102; ++i)
    depths.push_back(cv::imread(img_path + std::to_string(i) + img_suffix));

cv::Mat mean_depth = cv::Mat::zeros(depths.at(0).size(), CV_64F);

for (std::vector<int>::size_type i = 0; i != depths.size(); i++) {
    mean_depth = mean_depth + depths[i];
}