opencv BackgroundSubtractorMOG in openframeworks

152 views Asked by At

does anybody knows how to implement nowadays an opencv background subtractor like MOG or MOG2? I tried to use ofxCvMOG2 library (https://github.com/naus3a/ofxCvMOG2) but when I run the example the error "cannot create an instance of an abstract class" appears and I got stuck there. May be my version of openframeworks (0.11.2) doesn't fit to a five years old library? Any help in pointing me in the right direction woul be really appreciated. Thanks in advance!

1

There are 1 answers

1
rojele On

https://github.com/rojele/ofxCvMOG2_openCv4.5

I made it work. Here is the updated implementation of an opencv 4.5 mog2 background subtractor addon for openframeworks: ofxCvMOG2. The previous version of the addon, as commented above, was outdated, relied in opencv v2.4 and needed some little changes in the declaration of the subtractor and in the specifications of values like history, threshold and mixtures. Hope it could be useful to you.