hand star
1.0.0
Handstar는 Mediapipe 및 OpenCV를 사용하여 핸드 감지 및 추적을 쉽게하는 Python 라이브러리입니다. 카메라 피드에서 실시간으로 손을 감지하고 손 랜드 마크를 시각화하며 특정 랜드 마크 사이의 거리를 계산할 수있는 기능을 제공합니다.
PIP를 사용하여 핸드 스타를 설치할 수 있습니다.
pip install hand-starimport cv2
from hand_star.hand_star import HandStar
def main ():
cap = cv2.VideoCapture(0)
detector = HandStar(maxHands=2)
while True:
success, img = cap.read ()
if not success:
break
img = detector.detect_hands(img)
lmList = detector.get_hand_positions(img)
# Additional functionalities
fingersList = detector.get_fingers_status ()
for i, fingers in enumerate(fingersList):
print(f " Hand {i+1}: " , fingers)
length, img, lineInfo = detector.calculate_distance(4, 8, img, handNo=i)
print(f " Hand {i+1} Distance: " , length)
cv2.imshow( ' Hand Detection ' , img)
if cv2.waitKey(1) == ord( ' q ' ):
break
cap.release ()
cv2.destroyAllWindows ()
if __name__ == ' __main__ ' :
main ()
질문이나 피드백을 받으려면 [email protected]으로 자유롭게 연락하십시오.