Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

it's some version problem, while in opencv3, you have to use:

Ptr<backgroundsubtractormog2> subtractor = cv::createBackgroundSubtractorMOG2(20, 16, true); subtractor->apply(frame, mask, 0.001);

(call an "apply" function on a pointer)

while with opencv2.4, it would have been:

BackgroundSubtractorMOG2 subtractor(20, 16, true); subtractor(frame, mask, 0.001);

(call a () operator on a stack object)

please make sure to use appropriate docs and samples for your version.

it's some version problem, while in opencv3, you have to use:

Ptr<backgroundsubtractormog2>

Ptr<BackgroundSubtractorMOG2> subtractor = cv::createBackgroundSubtractorMOG2(20, 16, true);
subtractor->apply(frame, mask, 0.001);

0.001);

(call an "apply" function on a pointer)

while with opencv2.4, it would have been:

BackgroundSubtractorMOG2 subtractor(20, 16, true);
subtractor(frame, mask, 0.001);

0.001);

(call a () operator on a stack object)

please make sure to use appropriate docs and samples for your version.