First time here? Check out the FAQ!
answered 2013-12-02 07:14:20 -0600
You already has function in OpenCV that highly optimized for this specific task: addWeighted.
addWeighted(frame_current, 1/Beta, background_current, 1-1/Beta, 0, foreground_current);