Ask Your Question

joanmanel's profile - activity

2015-11-06 12:39:14 -0600 received badge  Scholar (source)
2015-11-06 12:39:13 -0600 received badge  Supporter (source)
2015-11-06 10:08:44 -0600 commented answer BackgroundSubtractorMOG 1 with OpenCV 3?

I didn't install "OpenCV" (I am running Windows and Python2). I downloaded the zip file with OpenCV3, and then I copied the file called cv2.pyd into the python folder. Basically the first guide here: http://docs.opencv.org/master/d5/de5/...

By what you said, and the tests I am running, it seems that didn't include the new module I need, am I right?

2015-11-06 09:55:10 -0600 commented answer BackgroundSubtractorMOG 1 with OpenCV 3?

Sorry for the question, but how can I use that module? I just copied the cv2 from the installation folder to my python path, and it doesn't seem to be loaded (bgsegm)

2015-11-06 09:00:30 -0600 asked a question BackgroundSubtractorMOG 1 with OpenCV 3?

So I have some code using BackgroundSubtractorMOG with opencv 2.10, it works OK.

I ported this code to OpenCV3, and the only change I needed to perform was to use BackgroundSubtractorMOG2 instead of the first one. The code runs OK, but the results are slightly different. I collected a lot of data with the first version, so now continuing the experiments with the second version is creating some consistency problems. The results are very similar, but not the same.

Long story short, I need to use the first version of MOG with OpenCV3, but I don't know how to do it (I don't know the name, or if it is even implemented). Otherwise I will need to rollback to OpenCV2, but I'd like to keep working with OpenCV.

2015-05-06 10:22:39 -0600 asked a question How to save Background Subtraction MOG to reuse between executions

I have the classic Python code for Background Substraction MOG (OpenCV 2.x) and it works well:

backsub = cv2.BackgroundSubtractorMOG()
capture = cv2.VideoCapture(filename)
While True:
    ret, frame = capture.read()
    fgmask = backsub.apply(frame, None, 0,005)

I know there are some parts missing, like checking if frame is something and so, but this is the backbone, and it does work.

What I would like to do is to save the BackgroundSubtractorMOG in some file, and then reuse again when I execute the code some time later.

I have an script that records 1 minute videos and then it runs the backsub. The problem with my current method is that I lose around 3s of video while it tries to guess what is background and what is not, so that is why I would like to reuse the previous information, to be more efficient.

I tried to pickle backsub, and it says it cannot be pickled.