0
votes

Traceback (most recent call last): File "faceDetection.py", line 21, in gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) cv2.error: OpenCV(4.2.0) /Users/travis/build/skvark/opencv-python/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'

1
Welcome to Stack Overflow! Can you:- 1) edit your question so that the code is formatted correctly. 2) clarify what you are trying to achieve with this code? See How to Ask in the Help Centre for more information (How to Ask : stackoverflow.com/help/how-to-ask)Paresh Mangukiya
It says the src.empty() means it is unable to read or capture frames .Amisha Kirti

1 Answers

0
votes

The path to your input image is incorrect. Double check that the path is correct and if it is, check if the image isn't corrupted by opening it up in an image viewer.