Ask Your Question

Revision history [back]

I have some problem with GMM

this is my code

image description

I really don't know what's going on with the "subtractor"...

thanks

p.s. I am using opencv310, maybe sth about the version?

I have some problem with GMM

this is my code

image description

#include <opencv2\opencv.hpp>
using namespace cv;
int main(){
VideoCapture video(0);
Mat frame, mask, thresholdImage, output;
Ptr<BackgroundSubtractorMOG2> subtractor = cv::createBackgroundSubtractorMOG2(20, 16, true);
namedWindow("background");
while (true){
    video >> frame;
    subtractor(frame, mask, 0.001);
    imshow("background", mask);
    char c = (char)waitKey(20);
    if (c == 27)
        break;
}
return 0;
}

There's something wrong with "substractor". I really don't know what's going on with the "subtractor"...

thanks

p.s. I am using opencv310, maybe sth about the version?