Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

you could use accumulate(), and only multiply once:

Mat dst(image.size(), CV_32S, Scalar(0));
accumulate(image, dst);
accumulate(image, dst);
accumulate(image, dst);
accumulate(image, dst);
accumulate(image, dst);
dst *= 0.2;

// later:
dst.setTo(0);