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);