Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

First, you never actually create the subtractor object. You need to call the create function like so:

Ptr<BackgroundSubtractorMOG2> subtractor = createBackgroundSubtractorMOG2();

Secondly, you're never actually filling background. You need to get the background image by calling

subtractor->getBackgroundImage(background);