Hi all, i try many different methods to declare and intial backgoundsubtractormog2 classs. But i always fails, i list all i declare. Someone can tell me how to declare or has any idea or any referance can help me? I appreciate your help.
Ptr<BackgroundSubtractor> MOG2model=createBackgroundSubtractorMOG2().dynamicCast<BackgroundSubtractor>();//Fail
Ptr<BackgroundSubtractorMOG2> MOG2model = createBackgroundSubtractorMOG2().dynamicCast<BackgroundSubtractorMOG2>();//Fail
Ptr<BackgroundSubtractorMOG2> MOG2model = createBackgroundSubtractorMOG2();//Fail
cv::BackgroundSubtractorMOG2 MOG2model=BackgroundSubtractorMOG2::create<BackgroundSubtractorMOG2>("Background");//Fail
by the way, thanks very much!