Answers for "cv2 !_src.empty() in function 'cv::cvtcolor'"

22

error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'

This error happened because the image didn't load properly.
So you have a problem with the previous line cv2.imread my suggestion is :

Check if the images exist in the path you give

Check the count variable to see if it has a valid number
Posted by: Guest on March-09-2020
3

cv2.error: OpenCV(4.5.3) C:UsersrunneradminAppDataLocalTemppip-req-build-q3d_8t8eopencvmodulesimgprocsrccolor.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'

Try Giving Full Path. 
This seems to be the path issue in windows. 
I changed it to a full path like this and it worked.

filename = "D:SandboxGithubopencv-projectResourcesPhotoscats.jpg"
Posted by: Guest on July-29-2021

Code answers related to "cv2 !_src.empty() in function 'cv::cvtcolor'"

Browse Popular Code Answers by Language