Sizes of input arguments do not match (The operation is neither 'array op array')

asked 2018-01-23 09:21:13 -0600

breizher gravatar image

updated 2018-01-23 09:21:51 -0600

Hello there,

I am trying to add two images but I am stuck with this error. I don't understand this error as I am declaring all the Mat the same way. Here is my code :

pMOG2->apply(init_frame, fgMaskMOG2);
fgMaskMOG2_masked = Mat::zeros(frame.rows, frame.cols, CV_8UC1);
fgMaskMOG2.copyTo(fgMaskMOG2_masked, Mask_final);
frame_masked_contours = Mat::zeros(frame.rows, frame.cols, CV_8UC1);
Mask.copyTo(frame_masked_contours, Mask_final);
Double_Detection = Mat::zeros(frame.rows, frame.cols, CV_8UC1);
add(frame_masked_contours, fgMaskMOG2_masked, Double_Detection);

In the debuger I can see that all thes images have the same size (576x720) !

So, what am I doing wrong ?

Any help would be much appreciated,

Thx in advance,

edit retag flag offensive close merge delete