import cv2
import mediapipe as mp
mp_maos = mp.solutions.hands
mp_desenho = mp.solutions.drawing_utils
maos = mp_maos.Hands()
camera = cv2.VideoCapture(0)
resolucao_x = 1280
resolucao_y = 720
camera.set(cv2.CAP_PROP_FRAME_WIDTH, resolucao_x)
camera.set(cv2.CAP_PROP_FRAME_HEIGHT, resolucao_y)
while True:
sucesso, img = camera.read()
img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
resultado = maos.process(img_rgb)
if resultado.multi_hand_landmarks:
for marcacao_maos in resultado.multi_hand_landmarks:
mp_desenho.draw_landmarks(img, marcacao_maos, mp_maos.HAND_CONNECTIONS)
cv2.imshow('Imagem', img)
tecla = cv2.waitKey(1)
if tecla == 27:
break
está retornando um erro que não consigo resolver
Traceback (most recent call last):
File "/Users/gabrielbarruzi/Documents/OpenCVEstudo/maos.py", line 7, in <module>
maos = mp_maos.Hands()
^^^^^^^^^^^^^^^
File "/Users/gabrielbarruzi/Documents/OpenCVEstudo/hand_tracking/lib/python3.11/site-packages/mediapipe/python/solutions/hands.py", line 114, in __init__
super().__init__(
File "/Users/gabrielbarruzi/Documents/OpenCVEstudo/hand_tracking/lib/python3.11/site-packages/mediapipe/python/solution_base.py", line 248, in __init__
self._graph = calculator_graph.CalculatorGraph(