Ask Your Question
0

Facial comparison

asked 2013-07-18 14:04:05 -0500

maketshi gravatar image

Would it be possible to take two photographs of a person's face, and compare them to see if it is the same person?

I'm thinking about writing a program that verifies someone's age by comparing their face to their driver's license, so it would need a high degree of accuracy.

edit retag flag offensive close merge delete

1 Answer

Sort by ┬╗ oldest newest most voted
0

answered 2013-07-18 16:41:46 -0500

no reposit├│rio de exemplos, existe algo semelhante, que talvez possa ajudar, veja:

#!/usr/bin/python
"""
copyright: Rishi Mukherjee
"""
import time
from SimpleCV import *
import sys

cam = Camera() #inicializa a camera
quality = 400
minMatch = 0.100

try:
    password = Image("password.jpg") #verifica se   havia uma imagem password a ser carregada caso nao, password recebe nulo
except:
    password = None

mode = "unsaved"
saved = False
minDist = 0.95


while True:
    image = cam.getImage().scale(800, 600) # get image, scale to speed things up
    faces = image.findHaarFeatures('face') # 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)
            password.drawKeypointMatches(template).save("password2.jpg")
            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("face")
                    tryit = 1
                    while not tryit == 10 or not faces:
                        image = cam.getImage().scale(320, 240)
                        faces = image.findHaarFeatures("")
                        tryit += 1
                    if not faces:
                        "CANNOT FIND ANY FACE, QUITING"
                        break
                    else:
                        faces.draw()
                        face = faces[-1]
                        password = face.crop().save("password.jpg")
                        face.crop().show()
                        print "SUCCESSFULLY SAVED"
                        print "QUITING"
                        time.sleep(1)
                        break
                else:
                    print "OK..."
                    break

            else:
                print "YOU ARE NOT THE ONE!!!"
                print "RUN AWAY OR POLICE WILL THROW YOU BEHIND THE BARS....:P"
                break
    else:
        break
edit flag offensive delete link more

Comments

I tried it with myself, it didnt work at all. It always showed me "you are not the one" even though the given picture was mine taken just a few seconds back.

bendtherules gravatar imagebendtherules ( 2013-08-03 01:03:39 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-07-18 14:04:05 -0500

Seen: 303 times

Last updated: Jul 18 '13