Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

maybe you can use accumulate here, since it can handle larger result types like:

Mat a = imread("a.png",0);    
Mat b = imread("b.png",0);
Mat c = imread("c.png",0);    
Mat d = imread("d.png",0);
Mat e = imread("e.png",0);    

Mat dst(a.size(), CV_32F, Scalar(0)); // large enough to hold sum
accumulate(a, dst);
accumulate(b, dst);
accumulate(c, dst);
accumulate(d, dst);
accumulate(e, dst);

Mat final;
dst.convertTo(final, 1.0/5);

(... and yea, don't write loops ...)