I am using opencv2.4.10 with python and I am trying to draw some contours of moving objects. Unfortunately I cannot figure out what am I doing wrong.
First of all I use Background Subtractor from opencv (cv2.BackgroundSubtractorMOG2
). It works fine, I can see my moving objects separated from the background.
After separation I use cv2.FindContours
method. It also works fine and I can print contorus as list of numbers.
But then, when I am trying to draw contours on the original image frame an error occurs.
cv2.drawContours(frame, contours, 1, (0, 255, 0), 3)
cv2.error: ..\..\..\..\opencv\modules\imgproc\src\contours.cpp:1810: error: (-215) 0 <= contourIdx && contourIdx < (int)last in function cv::drawContours
Could you comment on this issue?