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

cv2.imshow error #11

Open
Sumedhsonkamble opened this issue Jun 26, 2021 · 2 comments
Open

cv2.imshow error #11

Sumedhsonkamble opened this issue Jun 26, 2021 · 2 comments

Comments

@Sumedhsonkamble
Copy link

Sumedhsonkamble commented Jun 26, 2021

Hand Tracking | OpenCV | python

Facing an error due to this command
cv2.imshow ('Image', img)

cv2.error: OpenCV(4.5.2) C:\Users\runneradmin\AppData\Local\Temp\pip-req-build-k1ohfcms\opencv\modules\highgui\src\window.cpp:404: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'

When I comment out the above command, the script is running fine giving all the desired results but without the image.

I checked with the OpenCV versions
Uninstalled opencv from pip and reinstalled using Anaconda but no change.
image

@singhania0601
Copy link

I studied from the same channel and I have uploaded the handTracking module taught by this teacher, you can copy the code from there, there are few minor changes according to the new versions of media pipe

@Sumpy1
Copy link

Sumpy1 commented Sep 9, 2023

Mediapipe newer version has an additional argument called model_complexity, if you add that your code should work fine.
You can refer here if you want to see the changes:
https://github.com/Sumpy1/OpenCV-GestureControl/blob/main/VolumeControl.py

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

3 participants