似乎更改BackgroundSubtractorMOG的参数不会影响算法的结果.
我使用的是Python:2.7.6 | Anaconda 2.1.0(64位)
OpenCV:'2.4.10'OS
:Windows 7 x64
算法的默认参数是:
history=200, nmixtures=5, backgroundRatio=0.7
Run Code Online (Sandbox Code Playgroud)
因此,创建具有不同参数的背景减法器应该给出不同的结果.但我总是使用默认参数和自定义参数获得相同的结果(前景蒙版).
首先,使用不同的参数创建两个背景减法器对象:
bg1 = cv2.BackgroundSubtractorMOG()
bg2 = cv2.BackgroundSubtractorMOG(history=3, nmixtures=5, backgroundRatio=0.0001)
Run Code Online (Sandbox Code Playgroud)
创建2个"VideoCaptrue"对象:
cap = cv2.VideoCapture('video.mp4')
cap2 = cv2.VideoCapture('different_video.mp4')
Run Code Online (Sandbox Code Playgroud)
测试结果:
# Get a frame from the first capturing object:
frame = cap.read()[1]
# Get the foreground mask from both background subtractors:
fg1 = bg1.apply(frame)
fg2 = bg2.apply(frame)
# Show both results and the difference between them:
cv2.imshow('Window name', np.hstack((fg1, fg2, fg1 - fg2)))
cv2.waitKey(30)
Run Code Online (Sandbox Code Playgroud)
在为某些帧运行该代码块之后,该窗口显示来自第一个背景减法器的结果,来自第二个的结果以及两者的差异.
因为两个掩码是相同的,它们的差异(第三个窗格)的结果是一个完整的黑色框架:

然后,突然改变视频源(第二个VideoCapture对象): …
DONE状态具有相关的错误标志,指示某种类型的网络错误或堕胎.它可以是true或false,初始值为false.
还在"打开"状态下说出类似"send()标志"的内容.
它在规范中说,但在IDL中没有,当我创建一个新的XMLHttpRequest时,我找不到那些"标志".
那些布尔变量在哪里?