Ask Your Question
-1

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 -0600

SamruddhiSD gravatar image

Error description- Traceback (most recent call last): File "C:\Users\om\Desktop\Program\prac.py", 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
0

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

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

Question Tools

1 follower

Stats

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

Seen: 5,911 times

Last updated: Nov 21 '20