This error occurs when the number of points in a contour is less than zero or the depth of the contour is not either 'CV_32F' or 'CV_32S'.

To fix this error, make sure that the contour being passed to the cv::contourArea function has a valid number of points and a valid depth. You can also try converting the contour to the correct depth using the cv::convertTo function.

OpenCV (4.7.0) Error: '(-215:Assertion failed) npoints >= 0 && (depth == CV_32F || depth == CV_32S)' in cv::contourArea

原文地址: https://www.cveoy.top/t/topic/neK7 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录