Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(-215:Assertion failed) !ssize.empty() in function 'resize' #1

Open
cognitiveRobot opened this issue Jul 23, 2018 · 13 comments
Open

(-215:Assertion failed) !ssize.empty() in function 'resize' #1

cognitiveRobot opened this issue Jul 23, 2018 · 13 comments

Comments

@cognitiveRobot
Copy link

Hi Fabito,
Thank you for your code. I am trying to run webcam.py file. But, I get the following error

**Traceback (most recent call last):
File "/usr/local/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/local/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, *self._kwargs)
File "/usr/local/lib/python3.6/multiprocessing/pool.py", line 103, in worker
initializer(initargs)
File "mainWebCam.py", line 70, in worker
frm = detect_objects(frm, net, min_confidence)
File "mainWebCam.py", line 36, in detect_objects
blob = cv.dnn.blobFromImage(frame, inScaleFactor, (inWidth, inHeight), (0, 0, 0), True, False)
cv2.error: OpenCV(3.4.2) /io/opencv/modules/imgproc/src/resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'resize'

output of pip list
$ pip list
Package Version


imutils 0.4.6
mtcnn 0.0.7
numpy 1.14.5
opencv-contrib-python 3.4.2.16
pip 18.0
setuptools 28.8.0
utils 0.9.0

Can you please help?

Regards
Hossain

@cognitiveRobot
Copy link
Author

Thanks. It's been fix. it was not getting the frame from the camera.

@dscha09
Copy link

dscha09 commented Oct 11, 2018

@cognitiveRobot how did you fix it?

@cognitiveRobot
Copy link
Author

@chaine09 sorry I forgot. I will check and let you know asap.

@cognitiveRobot
Copy link
Author

@chaine09, Sorry again. I lost the old project and couldn't reproduce the error from the new code.

@dscha09
Copy link

dscha09 commented Oct 22, 2018

Hello @cognitiveRobot, can you remember if you fixed any line of code or downloaded any package?

@mmargegaj
Copy link

Hey try to check if the file is not 0 bytes... A 0 bytes image caused that error for me.

@daxingshen
Copy link

i had the same problem, it cause by some coordinate value is less than zero

@TheMrCoder
Copy link

TheMrCoder commented Dec 26, 2018

i had the same problem, it caused by no frame or image ,try printing the length

@GayatriPurandharT
Copy link

@TheMrCoder I agree, I encountered the same issue with invalid image file.

@annu205v
Copy link

I guess the error is due to invalid image file or file not found. Make sure you are referencing the file correctly and image is not broken.

@GhassanAlSumaidaee
Copy link

The real error is due to the camera connecting, you just need to connect your camera then the error will disappear.

@LordonCN
Copy link

It's strange.. its no problem runing in vscode but terminal,i dont know how to fix it :(

@LordonCN
Copy link

I try to uninstall torch1.2.0 and found that another torch1.1 still existed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants