How to use BackgroundSubtractorMOG in OpenCV 3.0.0 with Java?

I am trying to run BackgroundSubtractorMOG in a video file, but javadoc (version 3.0.0) says I need to provide a long argument, while the online documentation (version 2.4.9) says that the constructor requires neither argument nor int, int , double. When I give it a long one, I get an error that the constructor is not showing. Looking into the BackgroundSubtractorMOG class, the constructor is protected, and I have no idea why. I tried using it with both static and non-static methods, but no luck. I could not find a single example of successfully using BackgroundSubtractorMOG with java online. Any ideas or examples on how to call the constructor?

+4
source share
1 answer

Looks like opencv3.0 is here , creating backgroundsubtractormog2 , they solved it

you need to do this through Video.createBackgroundSubtractorMog2 ()

0
source

Source: https://habr.com/ru/post/1546626/


All Articles