1 | initial version |
you can use cv::addWeighted to sum up the images. Assume that you have an empty image in which you want to store the images (dst) and read the video frames into a matrix src. your code could then look like:
cnt = 0; dst = EmptyImageSameSizeAsVideoSource while true: src = loadNewFrame() cv::addWeighted(dst,1,src,0.2,dst) # dst += 0.2*src cnt = cnt +1; if cnt%5 == 0: DoSomeMagic(dst) # dst is your mean image! dst.setTo(0)
2 | No.2 Revision |
you can use cv::addWeighted to sum up the images. Assume that you have an empty image in which you want to store the images (dst) and read the video frames into a matrix src.
your code could then look like:like (just pseudo-Code):
cnt = 0;
dst =