OpenCV Error Assertion failed size width 0 size height 0

0 votes

I make one python program that stream my video using cv2 module. But sometimes it gives me the below error.

OpenCV Error: Assertion failed (size.width>0 && size.height>0)

How can I solve this error?

Apr 20, 2020 in Machine Learning by akhtar
• 38,260 points
13,784 views

1 answer to this question.

0 votes

Hi@akhtar,

You are getting this error, because your camera is not able to detect any face. It means when your program unable to find any face it throws an error because of null value.

To avoid this error, you can use if else condition in your python code. If it is not able to detect any face it will pass otherwise it will run your code.

Hope this will give you some idea how to avoid this error.

answered Apr 20, 2020 by MD
• 95,460 points

Related Questions In Machine Learning

+1 vote
1 answer

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-8nhf9w2t/grpcio/

Hi@akhtar, You may get this error because of ...READ MORE

answered May 16, 2020 in Machine Learning by MD
• 95,460 points
32,791 views
0 votes
1 answer

error: command 'cl.exe' failed: No such file or directory

Hi@akhtar, The cl.exe is the MSFT C /C++ compiler and ...READ MORE

answered Jul 13, 2020 in Machine Learning by MD
• 95,460 points
1,693 views
0 votes
1 answer

error: command 'gcc' failed with exit status 1

Hi@akhtar, I don't know which steps you followed. ...READ MORE

answered Sep 7, 2020 in Machine Learning by MD
• 95,460 points
4,911 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,441 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP