Created
September 25, 2015 14:34
-
-
Save tyndyll/3ba5f4bbe5236370c76f to your computer and use it in GitHub Desktop.
Spec Ops Eyes
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/env python | |
from SimpleCV import Camera, Display, Color | |
cam = Camera() | |
display = Display(resolution = (800, 600)) | |
while display.isNotDone(): | |
img = cam.getImage() | |
faces = img.findHaarFeatures("face") | |
if faces is not None: | |
for face in faces: | |
tlp = (face.points[0][0], (face.points[0][1] + ((face.points[3][1] - face.points[0][1])*0.35))) | |
trp = (face.points[1][0], (face.points[1][1] + ((face.points[2][1] - face.points[1][1])*0.35))) | |
img.dl().line(tlp, trp, Color.BLACK, width = 40) | |
img.save(display) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment