while True: image = cam.getImage().scale(320, 240) # get image, scale to speed things up faces = image.findHaarFeatures("facetrack-training.xml") # load in trained face file if faces: if not password: faces.draw() face = faces[-1] password = face.crop().save("password.jpg") break else: faces.draw() face = faces[-1] template = face.crop() template.save("passwordmatch.jpg") keypoints = password.findKeypointMatch(template,quality,minDist,minMatch) if keypoints: print "YOU ARE THE ONE!!! CONGRATS" question = raw_input("WOULD YOU LIKE TO CHANGE YOUR FACE PASSWORD? Y/N").strip() if question == "Y": image = cam.getImage().scale(320, 240) faces = image.findHaarFeatures("facetrack-training.xml") tryit = 1 while not tryit == 10 or not faces: image = cam.getImage().scale(320, 240) faces = image.findHaarFeatures("facetrack-training.xml") tryit += 1 if not faces: "CANNOT FIND ANY FACE, QUITING" break else:
from SimpleCV import Image template = Image('transformed_logo.jpg') img = Image('transformed_wallpaper.jpg') match = img.findKeypointMatch(template) match.draw(width=3) print(3) img.show()
image = cam.getImage().scale(320, 240) # get image, scale to speed things up faces = image.findHaarFeatures( "facetrack-training.xml") # load in trained face file if faces: if not password: faces.draw() face = faces[-1] password = face.crop().save("password.jpg") break else: faces.draw() face = faces[-1] template = face.crop() template.save("passwordmatch.jpg") keypoints = password.findKeypointMatch(template, quality, minDist, minMatch) if keypoints: print "YOU ARE THE ONE!!! CONGRATS" question = raw_input( "WOULD YOU LIKE TO CHANGE YOUR FACE PASSWORD? Y/N").strip( ) if question == "Y": image = cam.getImage().scale(320, 240) faces = image.findHaarFeatures("facetrack-training.xml") tryit = 1 while not tryit == 10 or not faces: image = cam.getImage().scale(320, 240) faces = image.findHaarFeatures( "facetrack-training.xml") tryit += 1 if not faces:
sleep(2) image = cam.getImage().scale(320, 240) # get image, scale to speed things up faces = image.findHaarFeatures("face.xml") # load in trained face file if faces: if not password: faces.draw() face = faces[-1] password = face.crop().save("password.jpg") break else: faces.draw() face = faces[-1] template = face.crop() template.save("passwordmatch.jpg") keypoints = password.findKeypointMatch(template) if keypoints: print "YOU ARE THE ONE!!! CONGRATS" question = raw_input( "WOULD YOU LIKE TO CHANGE YOUR FACE PASSWORD? Y/N").strip( ) if question == "Y": image = cam.getImage().scale(320, 240) faces = image.findHaarFeatures("facetrack-training.xml") tryit = 1 while not tryit == 10 or not faces: image = cam.getImage().scale(320, 240) faces = image.findHaarFeatures( "facetrack-training.xml") tryit += 1 if not faces: