Hello everyone I used MOG2 function in C# there was no problem but when i try to do same thing on C++ there is a strange result. I believe it's about image's channels but i couldn't fix it . I need a hand thanks .
Mat mask;
Ptr<BackgroundSubtractor> sub ;
sub=createBackgroundSubtractorMOG2();
sub->apply(frame,mask);
This is a pretty simple define but the result is like this.