Created
September 15, 2013 04:03
-
-
Save yingted/6567921 to your computer and use it in GitHub Desktop.
From UWaterloo Fall Orientation 2013 SCUNT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from scipy.signal import * | |
from cv2 import * | |
from numpy import * | |
cap=VideoCapture(0) | |
cc=CascadeClassifier("/usr/share/OpenCV/haarcascades/haarcascade" | |
"_frontalface_default.xml") | |
face=imread("joshua_kalpin.png") | |
while cap.grab(): | |
frame=cap.retrieve()[1] | |
for x,y,w,h in cc.detectMultiScale(frame): | |
frame[y:y+h,x:x+w]=floor(.5+resample(resample | |
(face,h),w,axis=1)).clip(0,255).astype("uint8") | |
imshow("output",frame) | |
waitKey(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment