Coumputer Vision helping Library
Project description
cvlearn
An easy to use package which helps to do hand tracking, face detection, etc. with use of opencv module.
Installation
- Use Python 3.x
- Open cmd/terminal and type:
pip install cvlearn
Dependencies
- python 3.x
- opencv-python
- numpy
- mediapipe
Examples
Hand Tracking:
from cvlearn import HandTrackingModule as handTracker
import cv2
cap = cv2.VideoCapture(0)
detector = handTracker.handDetector()
while True:
ret, img = cap.read()
img = detector.findHands(img)
cv2.imshow("Result", img)
cv2.waitKey(1)
Result:
Face Detection:
from cvlearn import FaceDetection as faceDetector
import cv2
cap = cv2.VideoCapture(0)
detector = faceDetector.FaceDetector()
while True:
ret, img = cap.read()
img = detector.findFaces(img)
cv2.imshow("Result", img)
cv2.waitKey(1)
Result:
SideView:
Drawing face mesh:
from cvlearn import FaceMesh as fms
import cv2
cap = cv2.VideoCapture(0)
detector = fms.FaceMeshDetector()
while True:
ret, img = cap.read()
img, face = detector.findFaceMesh(img)
cv2.imshow("Result", img)
cv2.waitKey(1)
Result:
Finger Counting
from cvlearn import FingerCounter as fc
import cvlearn.HandTrackingModule as handTracker
import cv2
cap = cv2.VideoCapture(0)
detector = handTracker.handDetector(maxHands=1)
counter = fc.FingerCounter()
while True:
ret, frame = cap.read()
frame = cv2.flip(frame, 180)
frame = detector.findHands(frame)
lmList, bbox = detector.findPosition(frame)
if lmList:
frame1 = counter.drawCountedFingers(frame, lmList, bbox)
cv2.imshow("res", frame)
key = cv2.waitKey(1)
if key == 27:
break
cv2.destroyAllWindows()
Result:
Two Hands Finger Counting
from cvlearn import TwoHandsFingerCounter as fc
import cv2
cap = cv2.VideoCapture(0)
counter = fc.FingerCounter()
while True:
ret, frame = cap.read()
frame1 = counter.drawCountedFingers(frame)
cv2.imshow("res", frame)
key = cv2.waitKey(1)
if key == 27:
break
cv2.destroyAllWindows()
Result:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cvlearn-0.1.2.tar.gz
(5.9 kB
view hashes)