BackgroundSubtractorMOG2 set parameters
Hi, i'm trying to use the class BackgroundSubtracorMOG2 with Opencv 3.0.
After:
Ptr<BackgroundSubtractor> pMOG2;
pMOG2 = createBackgroundSubtractorMOG2();
I want to set some parameters like:
pMOG2.setShadowThreshold(0.5);
But it tells me:
No member named 'setShadowThreshold' in 'cv::Ptr<cv::backgroundsubtractor>'
Same with the operator "->" instead of "."
Do you know how to set parameters of this class?
correct usage is like below :
Since no-one explains why it is failing. The overall
BackgroundSubtractor
object does not have that specific function, therefore you need a pointer to an object of the correct type, which isBackgroundSubtractorMOG2
in this case.