Object of abstract class type “cv::BackgroundSubtractorMOG2” is not allowed. all the methods are pure virtual
问题 I develop the code in VS2015 + OpenCV3.0 in Windows 7 64bit. This is a demo code that I want have a try. And I have tried many demo but I was coming across the same problem: object of abstract class type "cv::BackgroundSubtractorMOG2" is not allowed. all the methods are pure virtual function. The demo code is: using namespace cv; using namespace std; int main() { VideoCapture video("1.avi"); Mat frame, mask, thresholdImage, output; //video>>frame; Ptr<BackgroundSubtractor> pMOG2; pMOG2 = new