(-215:Assertion failed) 0 <= contourIdx && contourIdx < (int)last in function ‘cv::drawContours‘ An error is reported during contour detection in OpenCV Just change the contents in the code to binary