1 | initial version |
BackgroundSubtractorMOG2 is inherited from BackgroundSubtractor which is inherited from cv::Algorithm (read the documentation carefully). That means that you can use Algorithm::set
and Algorithm::get
methods for accessing parameters. Here is a sample on how you can work with cv::Algorithm
.
BTW
bg(frame,foreground);
instead of your second line.