copy cv2.BackgroundSubtractorMOG2

asked 2014-09-30 22:23:34 -0600

Is there a way to create a duplicate copy of cv2.BackgroundSubtractorMOG2 in python? I want to train it for a single set of frames first, then train it for 2 different set of frames later.

copy.copy() and copy.deepcopy() did not work.

edit retag flag offensive close merge delete

Comments

afaik, you can't do that (it's not allowed).

why do you even need a copy ?

if you want to use it with different frames later, you also have trained it on the wrong ones before, no ?

berak gravatar imageberak ( 2014-10-01 00:36:42 -0600 )edit

Thanks for the feedback.

It's not trained on the wrong ones before, but I want to test how the subtraction evolve under different environments. Is there a way to save the MOG model to a variable and then apply the background subtraction later? Or, a way to copy and assign the MOG parameters with pointer operations? I'll probably spend some time to look into this next, unless someone can confirm that this approach won't work either.

newooub gravatar imagenewooub ( 2014-10-01 16:12:37 -0600 )edit