ravigithub19 / ai-virtual-mouse

Developed an AI-based system to control the mouse cursor using Python and OpenCV with the real-time camera. Fingertip location is mapped to RGB images to control the mouse cursor.
91 stars 45 forks source link

got this error while running the code #3

Open lakshya3612 opened 3 years ago

lakshya3612 commented 3 years ago

Traceback (most recent call last): File "C:/Users/hp/Documents/HandTrackingModule.py", line 108, in main() File "C:/Users/hp/Documents/HandTrackingModule.py", line 95, in main img = detector.findHands(img) File "C:/Users/hp/Documents/HandTrackingModule.py", line 21, in findHands imgRGB = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) cv2.error: OpenCV(4.5.2) C:\Users\runneradmin\AppData\Local\Temp\pip-req-build-i3ohmhl0\opencv\modules\imgproc\src\color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'

please help me to get rid of this error

amankumar2013 commented 2 years ago

I am also facing this problem!!!!!

SAMIR672160 commented 2 years ago

Traceback (most recent call last): File "C:/Users/samir/PycharmProjects/AiVirtualMouseProject/AiVirtualMouseProject.py", line 26, in img = detector.findHands(img) File "C:\Users\samir\PycharmProjects\AiVirtualMouseProject\HandTrackingModule.py", line 21, in findHands imgRGB = cv2.cvtColor(img,cv2.COLOR_BGR2RGB) cv2.error: OpenCV(4.5.5) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'

[ WARN:1@17.149] global D:\a\opencv-python\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (539) `anonymous-namespace'::SourceReaderCB::~SourceReaderCB terminating async callback

Process finished with exit code 1