使用非常简单, frame 就是当前帧, foreground 是取得的, binary 型背景, 0.03是学习速率可以根据实际调整.
cv::BackgroundSubtractorMOG mog;
mog(frame, foreground, 0.03);