ApplaudToPark / GestureControl-for-Python

1 stars 0 forks source link

[Code Revision] "HandTrackingModule.py" has errors #5

Open ApplaudToPark opened 3 months ago

ApplaudToPark commented 3 months ago

Hi.

This is Minseok Park who is a leader of "Fancy Child" for Capstone Design Competition held in Chung-Ang university in Seoul.

There are some errors for operating "HandTrackingModule.py", because 'detectionCon' is float-type.

If you solve this problem, please check the red-dotted sentence in the picture below.

Or if you have any problems, mention me.

Thank you.

image

ApplaudToPark commented 3 months ago

A team member told me the problem :

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

### INFO: Created TensorFlow Lite XNNPACK delegate for CPU.

A member addressed the situation :

"I run this code at the first time, there is no error. But after that, the camera does not recognize my finger joint, and a bounding box does not exist." image

ApplaudToPark commented 3 months ago

Solve the problem to do this :

  1. Change "def main(self)" to "def main()"
  2. In "controls.py", "try : lmList = detector.findPosition(img, draw=False)" (True -> False)

If you do, it will be fine.

Thank you.