我正在使用以下代码使用 mediapipe 检测手部地标
import cv2
import mediapipe as mp
mphands = mp.solutions.hands
hands = mphands.Hands()
mp_drawing = mp.solutions.drawing_utils
cap = cv2.VideoCapture(0)
while True:
_, frame = cap.read()
framergb = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
result = hands.process(framergb)
hand_landmarks = result.multi_hand_landmarks
if hand_landmarks:
for handLMs in hand_landmarks:
mp_drawing.draw_landmarks(frame, handLMs, mphands.HAND_CONNECTIONS)
print("\n\n\n")
cv2.imshow("Frame", frame)
cv2.waitKey(1)
我只想要一个围绕检测器返回的所有点的矩形请告诉是否有任何方法可以在 mediapipe 中内置或使用 opencv