cv2.error: OpenCV(4.1.0) C:\projects\opencv-python\opencv\modules\imgproc\src\color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'

Author: rezabrgCreated Sep 17, 2019Updated Nov 3, 2025
  • face_recognition version:4.1.0
  • Python version:3.7
  • Operating System:windows 10

Description

I'm having problem to run this program, the error under below

gray = cv2.cvtColor(im,cv2.COLOR_BGR2GRAY) cv2.error: OpenCV(4.1.0) C:\projects\opencv-python\opencv\modules\imgproc\src\color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'

What I Did

Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.

Source: ageitgey/face_recognition