Hanan PishehCan coler
Published © GPL3+

Airport Security

Airport Security enables a thorough screening of passengers, while being much more efficient and less burdensome than the current system.

IntermediateShowcase (no instructions)10 hours759
Airport Security

Things used in this project

Software apps and online services

Eyeris
BlueMix
IBM BlueMix
Watson
IBM Watson

Story

Read more

Code

Hack Code

Python
import os
import subprocess
import commands
import json
from time import sleep
from PySide import QtGui, QtCore 
import sys

 
#print("Welcome to the United States of America")
#print("Swip your right index finger to start")

class Window(QtGui.QMainWindow):
   
    def __init__(self):
        super(Window, self).__init__()
        self.setGeometry(50,50,600,400)
        self.setWindowTitle("Airport Security")
        #self.setWindowIcon(QtGui.QIcon('scollar.png')     
	self.home()

    def home(self):   
		
        #global output
        #output=QtGui.QTextEdit("",self)
        #output.move(90,10)
        #output.resize(200,310)


	
	pic=QtGui.QLabel(self)
	pic.setGeometry(400,0,200,200)
	
	#pic.resize(300,300)
	pic.setPixmap(QtGui.QPixmap(os.getcwd()+"/dhs.png"))
	
	#lasvegaspic=QtGui.QPicture()
	pic2=QtGui.QLabel(self)
	pic2.setGeometry(0,0,200,200)
	
	#pic.resize(300,300)
	pic2.setPixmap(QtGui.QPixmap(os.getcwd()+"/lasvegas.png"))
	
	#lasvegaspic.load("lasvegas.png")
	#painter=QtGui.QPainter()
	#painter.begin(myimage)
	#painter.drawPicture(0, 0, lasvegaspic)
	#painter.end()
	welcome=QtGui.QLabel("Welcome to Las Vegas",self)
   	#pic=QtGui.QPicture("lasvegas.png")
	welcome.move(180,50)
	scan=QtGui.QLabel("Please scan your finger",self)
	camera=QtGui.QLabel("Please look at the camera",self)
	newfont=QtGui.QFont("Times",16,QtGui.QFont.Bold)
	newfont2=QtGui.QFont("Times",16,QtGui.QFont.Bold)
	welcome.setFont(newfont2)
	welcome.resize(300,200)

	camera.setFont(newfont)
	scan.setFont(newfont)
	scan.resize(300,200)
	camera.resize(300,200)	
	scan.move(180,80)
	camera.move(180,100)
	#welcome.resize(500,500)	
        #global textBLENameConnect
        #textBLENameConnect = QtGui.QLineEdit("", self)
	global start	
	start=QtGui.QPushButton("Start",self)
	start.move(180,300)
	start.clicked.connect(self.scan)
	self.show()
        #textBLENameConnect.move(0, 120)
        #textBLENameConnect.resize(110,30)
	


	


    def scan(self):
	process = subprocess.Popen('fprintd-verify', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
	out, err = process.communicate()
	process.wait()
	if out.find('verify-match')>=0:
		#print("Please look into the camera")
		sleep(2)
		os.system('/usr/bin/streamer -f jpeg -o image.jpeg')
		process2 = subprocess.Popen('curl -X POST -H "LicenseKey: 38097816826970282087131381592699111622085402531410208007631072420304511737" -F "previousFrameResult=" -F imageFile=@/home/cancola/hackathon/image.jpeg -F timestamp=0 http://api.emovu.com/api/imageframe/', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
		out2, err2 = process2.communicate()
		process2.wait()

		print out2
		#jsonEncoded=json.dumps(out2)
		#decoded= json.load(jsonEncoded)
		#decoded= json.load(jsonEncoded)
		#print(decoded)
		#print decoded['PreviousComputedAgeGroupTimestamp']
		

		start.setStyleSheet("background-color:green")
	else:
		start.setStyleSheet("background-color:red")


def run():
        app=QtGui.QApplication(sys.argv)
        GUI=Window()
        sys.exit(app.exec_())
           
run()

Credits

Hanan Pisheh

Hanan Pisheh

8 projects • 4 followers
Master Of Computer Engineering Science and bachelor of Statistics.
Can coler

Can coler

1 project • 0 followers

Comments