fgbg = cv2.createBackgroundSubtractorMOG2(history=200, varThreshold=35, detectShadows=True)
时间: 2023-08-11 20:04:39
浏览: 85
这是一个使用 OpenCV 库创建基于 MOG2(Mixture of Gaussians)[算法](https://geek.csdn.net/educolumn/2354e3486d804fe718dd230739581535?spm=1055.2569.3001.10083)的背景减法器。该[算法](https://geek.csdn.net/educolumn/2354e3486d804fe718dd230739581535?spm=1055.2569.3001.10083)可以用于[视频](https://geek.csdn.net/educolumn/237e06506d30a4cfa9904992fb4f696f?spm=1055.2569.3001.10083)中的运动[目标](https://geek.csdn.net/educolumn/06c7a9ffb1969a0ad080048a16f82c4e?spm=1055.2569.3001.10083)检测。其中,history 参数表示用于[建立](https://geek.csdn.net/educolumn/02bf46ff825a0df64db0a77a0d987842?spm=1055.2569.3001.10083)背景模型的帧数,varThreshold 参数表示像素颜色与背景模型不匹配的阈值,detectShadows 参数表示是否检测阴影。