Ask Your Question

Hello, I am working on the image face recognition project. I am getting error as follows. Please guide.

asked 2020-11-21 09:30:40 -0500

Error description- Traceback (most recent call last): File "C:\Users\om\Desktop\Program\", line 7, in <module> gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) #inputimage converted to grayscale cv2.error: OpenCV(4.4.0) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-95hbg2jt\opencv\modules\imgproct\opencv\modules\imgproc\src\color.cpp:182: error: (-215:Assertion failed) !_src.emptColor'y() in function 'cv::cvtColor'

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2020-11-21 09:49:33 -0500

berak gravatar image

your image was not loaded (and thus you feed an empty image into cvtColor(),

you MUST CHECK the result of imshow() before proceeding !!!

(and seriously, that must be the 5000th time we answer this question here....)

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-11-21 09:30:40 -0500

Seen: 58 times

Last updated: Nov 21