https://github.com/rajputrockstar/hand-star
HandStar is a Python library that uses Mediapipe and OpenCV to make hand detection and tracking easy.
https://github.com/rajputrockstar/hand-star
mediapipe opencv opencv-python opencv2 pypi pypi-package pypi-packages python python-modules python-script python3
Last synced: 4 months ago
JSON representation
HandStar is a Python library that uses Mediapipe and OpenCV to make hand detection and tracking easy.
- Host: GitHub
- URL: https://github.com/rajputrockstar/hand-star
- Owner: RAJPUTRoCkStAr
- License: mit
- Created: 2024-07-05T19:53:59.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-07-05T20:13:55.000Z (12 months ago)
- Last Synced: 2025-01-08T09:51:07.698Z (6 months ago)
- Topics: mediapipe, opencv, opencv-python, opencv2, pypi, pypi-package, pypi-packages, python, python-modules, python-script, python3
- Language: Python
- Homepage: https://github.com/RAJPUTRoCkStAr/hand-star
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HandStar
HandStar is a Python library that uses Mediapipe and OpenCV to make hand detection and tracking easy. It provides functionalities to detect hands in real-time from camera feed, visualize hand landmarks, and calculate distances between specific landmarks.
## Features
- Real-time hand detection and tracking.
- Visualization of hand landmarks and connections.
- Calculation of distances between specified landmarks (e.g., fingertips).## Installation
You can install HandStar using pip:
```bash
pip install hand-star
```
## Code
```bash
import cv2
from hand_star.hand_star import HandStardef 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'):
breakcap.release()
cv2.destroyAllWindows()if __name__ == '__main__':
main()```
## Contact
For any questions or feedback, feel free to reach out at [[email protected]](mailto:[email protected]).