This error is caused by an empty image being passed to the cvtColor function in OpenCV. The _src.empty() assertion checks whether the input image is empty or not.

To resolve this error, you should check if your input image is empty before passing it to the cvtColor function. You can do this by checking the shape attribute of your image array. If the shape is (0,0) or if the image array is None, then the image is empty.

You can also check if the file path of the image you are trying to read is correct or if there are any issues with the image file itself

cv2error OpenCV470 Daopencv-pythonopencv-pythonopencvmodulesimgprocsrccolorcpp182 error -215Assertion failed !_srcempty in function cvcvtColor

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

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