31 lines
594 B
Python
31 lines
594 B
Python
|
import cv2
|
||
|
import sys
|
||
|
from popeize import popeize
|
||
|
|
||
|
# Get user supplied values
|
||
|
try:
|
||
|
cascPath = sys.argv[1]
|
||
|
except IndexError:
|
||
|
cascPath = 'features/haarcascade_frontalface_default.xml'
|
||
|
|
||
|
video_capture = cv2.VideoCapture(0)
|
||
|
|
||
|
# Create the haar cascade
|
||
|
faceCascade = cv2.CascadeClassifier(cascPath)
|
||
|
|
||
|
# Read the image
|
||
|
papaj = cv2.imread("zoltamorda.png", -1)
|
||
|
|
||
|
while True:
|
||
|
ret, image = video_capture.read()
|
||
|
|
||
|
popeize(faceCascade, image, papaj, 1.3)
|
||
|
|
||
|
cv2.imshow("Video", image)
|
||
|
|
||
|
if cv2.waitKey(1) & 0xFF == ord('q'):
|
||
|
break
|
||
|
|
||
|
video_capture.release()
|
||
|
cv2.destroyAllWindows()
|