Skip to content

Instantly share code, notes, and snippets.

@tyndyll
Created September 25, 2015 14:34
Show Gist options
  • Save tyndyll/3ba5f4bbe5236370c76f to your computer and use it in GitHub Desktop.
Save tyndyll/3ba5f4bbe5236370c76f to your computer and use it in GitHub Desktop.
Spec Ops Eyes
#!/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