python - opencv backgroundsubtractor not updating -
i'm using python 2.7.9 , opencv version 2.4.8.
i'm trying detect moving cars movie. first frame in movie has car , once car leaves, contour stays there. tried playing backgroundsubtractormog params seemed ignored. setting history 10 nothing , 200 frames movie still have original contour.
thanks reading
in reading opencv tickets found sebastian ramirez found problem source , solution.
the problem method "apply" has learningrate set 0 default. solve problem calling this:
history = 10 # or whatever appropriate you
fgmask = fgbg.apply(frame, learningrate = 1.0/history)
Comments
Post a Comment