How to change BackgroundSubtractorMOG2 options
I'm learning OpenCV and loving it so far. Currently I'm looking into background subtractor and it's awesome that the library already offers algorithms for this. I was looking at BackgroundSubtractorMOG2 and I've managed to get a basic setup running:
cv::BackgroundSubtractorMOG2 bg;
//in update loop
bg.operator ()(frame,foreground);
bg.getBackgroundImage(background);
but I haven't worked out how change/use options with for this class. The documentation lists members to control the algorithm (such as nmixtures,backgroundRatio,etc.), but they appear to be protected (in OpenCV 2.4.1). Would I still be able to control the algorithm using OpenCV 2.4 ? If so, how ?
Thanks!
I've moved the protected components I wanted to change to the public area in the header file which feels a bit dirty. Should I also call initialize() after updating a property (like nmixtures for example) ? Also, how is the Size calculated ? I'm working with a 640x384 image and with the default settings Size is (0,1124007936). Should that change based on different parameters ?