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!
Asked
Active
Viewed 134 times
1
-
25 year old code. yes, that would need modifications. the repo states that it works with opencv 2.4, which has been End Of Life for a good while. you can use the code as a basis, and change whatever has changed since then in the OpenCV API (current version is 4.5) – Christoph Rackwitz Oct 07 '21 at 19:22
-
Will try it, thanks for the advice! – rojele Oct 08 '21 at 07:16
-
1@rojele check out [this link](https://docs.opencv.org/master/d2/d55/group__bgsegm.html) – Jeru Luke Oct 08 '21 at 10:24
-
@Jeru Luke Thanks for the link, very useful. If i get it working will share the code with the community. – rojele Oct 09 '21 at 07:12
1 Answers
0
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.

rojele
- 80
- 7
-
2As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Oct 12 '21 at 01:16