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'
See original GitHub issueIssue Description
- 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.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:31
- Comments:101 (1 by maintainers)
Top Results From Across the Web
imread returns None, violating assertion !_src.empty() in ...
COLOR_BGR2GRAY) cv2.error: OpenCV(4.1.0) C:\projects\opencv-python\opencv\modules\imgproc\src\color.cpp:182: error: (-215:Assertion failed) ...
Read more >error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'
error : (-215:Assertion failed) !_src.empty() in function 'cvtColor' I don't have a user called Travis on my computer in case that is not ......
Read more >error: (-215:Assertion failed) !_src.empty() in function 'cv
How to solve error : (- 215:Assertion failed ) !_src. empty () in function 'cv::cvtColor' in opencv is shown.
Read more >215:Assertion failed) !_src.empty() in function 'cv ... - YouTube
opencverror # opencv #datascience #artificialintelligence #machinelearning #ml #ai #python # error #pythonerror #cvtcolor #cvtcolorerror ...
Read more >error: opencv(4.6.0) /io/opencv/modules/imgproc/src/color.cpp ...
cpp:182 : error: (-215:assertion failed) !_src.empty() in function 'cv::cvtcolor'. Try Giving Full Path ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This a secondary error that basically just means the image you are trying to process didn’t load and was empty.
If you grabbed the image dara from the camera, it means the camera connection failed or isn’t configured correctly. If you loaded an image file, it means the loading failed.
I have same problem. My old code is : cap = cv2.VideoCapture(1)
Then I change my code, and problem has solved. Probably, opencv accepts my finger print input as a camera. Thus, I change VideoCapture parameter as follows: cap = cv2.VideoCapture(0)