Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 600

Background subtraction

$
0
0
I try to subtract using bitwise_and and BackgroundSubtractor but I have this error: > OpenCV Error: Assertion failed ((mtype == CV_8U || mtype == CV_8S) && _mask.sameSize(*psrc1)) in cv::binary_op, file C:\build\master_winpack-build-win64-vc14\opencv\modules\core\src\arithm.cpp, line 241 code: Mat frame1; Mat frame_mask; bool bSuccess = cap.read(frame1); if (!bSuccess) //if not success, break loop { cout << "Cannot read a frame from video stream" << endl; break; } pMOG2->apply(frame1, frame_mask); Mat kernel = Mat::ones(frame1.size(), CV_8UC1); erode(frame1, frame_mask, kernel); bitwise_and(frame1, frame1, frame, frame_mask); Error occurs when I use bitwise_and(...). I used OpenCV 3.2.0 and VS15. I'm pretty new at the OpenCV, so could you please say, what I do wrong? Thank you.

Viewing all articles
Browse latest Browse all 600

Trending Articles