(-215:Assertion failed) s >= 0 in function 'cv::setSize'
See original GitHub issueI was following your Youtube tutorial but got stuck in this particular problem. I searched a lot but couldn’t find any solution.
Video with Timestamp - https://youtu.be/oXlwWbU8l2o?t=10728
Traceback (most recent call last): File "face_recognize.py", line 43, in <module> face_recognizer.train(features, labels) cv2.error: OpenCV(4.4.0) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-8ely825f\opencv\modules\core\src\matrix.cpp:235: error: (-215:Assertion failed) s >= 0 in function 'cv::setSize'
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
python - OpenCV Error: Assertion failed (s >= 0) in setSize
There are not enough details to tell, but it seems that one of the images that you are trying to resize is empty....
Read more >OpenCV Error: Assertion failed (s >= 0) in setSize
Hi everyone, I'm new user and I'm trying to execute my program that uses opencv. It compiles but during the exeution it appears...
Read more >cv::imshow raises (Assertion failed) s >= 0 in function 'setSize ...
When I was trying to make a minimal program to reproduce the same error, there were two new errors showing up, Assertion failed)...
Read more >FaceRecognizer - train method throws "Assertion failed"
Hello,I have the same problem like that,but my program is SVM object detect. It always say that"OpenCV Error: Assertion failed (s >= 0)...
Read more >Assertion failed (size.width>0 && size.height>0) in imshow, file ...
This error means you are passing an empty array to imshow function. Use cout to check if the array is empty or not....
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
Your issue is here: https://github.com/bradtoxic/open-cv-face-detection/blob/7263af8229394674371c28c1a9be8c637714bd4e/face-detection.py#L29
You’ve written
instead of
You’re attempting to access a negative index, which is not possible.
At first, I thought it had something to do with a
NoneTypereturn, so hence the above tests.It’s working now. Thank you so much