Ask Your Question

Revision history [back]

Hi there,

if you take a look at the documentation of addWeighted you will see that the last parameter is the output array that will have the same size as the input arrays. This means that by doing

addWeighted(image_roi,.3,im_roi,.7,0,image);

the method addWeighted will deallocate image (because it is not of the same size as the image_roi) and allocate a new array with the same size as image_roi (40x60) and put there the result. Try instead this:

addWeighted(image_roi,.3,im_roi,.7,0,image_roi);

It should do what you want.

I hope this helps.