Introduction to Face Identifying security system:- A facial recognition/face identifying security system uses biometrics to map facial features from a photo or video. It fetched the information with a database of known faces to find a match one. Facial recognition security system can help verify personal identity, but it also leads to privacy issues.
Components Required:-
1: Raspberry Pi 3
Raspberry Pi 3 is a small sized computer. By simply just adding a keyboard, mouse, display, power supply, micro SD card with installed Linux Distribution and we will have a amall sized portable computer that can run applications from word processors and spreadsheets to games and so on.
2: PIR Motion Sensor
Passive Infrared module is used to detect the motion of human movement. It has a very version with large lens which can support long range and wide angle.
3:Web Cam
A webcamera is a camera that feeds or streams an image or video in real time through a computer to a computer network, with Internet application. Webcams are generally small cameras in size that sit on a desk, attach to a user's monitor, and are built into the hardware. Note: You can also use Raspberry Pi Camera Module given below.
4: Raspberry Pi Camera Module
RaspberryPi camera module is a portable light weight camera that supports Raspberry Pi. It communicates withRaspberryPi using the MIPI camera serial interface protocol. It is generally used in image processing, machine learning or in surveillance projects.
5:Jumper Wires
Jumper Wires is used for circuit interconnections.
After all setup and interconnection your face recognition security system will ready. Along with this you can also add the servo to this project to make it open a door lock which will take your setup to a another level.
6: Circuit diagram & connections
7:Steps to follow
STEP1:
Wire up the Security System
STEP2:
Signup For Microsoft Cognitive Services
STEP3:
Add a Display, Keyboard and Mouse.
STEP4:
Deploy to the app to the Raspberry Pi
STEP5:
Create your Whitelist by simply click on the '+' icon at the bottom (to add someone to the whitelist).
8:CODE
importnumpy as np
import cv2
faceCascade = cv2.CascadeClassifier('Cascades/haarcascade_frontalface_default.xml')
cap = cv2.VideoCapture(0)
cap.set(3,640) # set Width
cap.set(4,480) # set Height
while True:
ret, img = cap.read()
img = cv2.flip(img, -1)
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
faces = faceCascade.detectMultiScale(
gray,
scaleFactor=1.2,
minNeighbors=5,
minSize=(20, 20)
)
for (x,y,w,h) in faces:
cv2.rectangle(img,(x,y),(x+w,y+h),(255,0,0),2)
roi_gray = gray[y:y+h, x:x+w]
roi_color = img[y:y+h, x:x+w]
cv2.imshow('video',img)
k = cv2.waitKey(30) & 0xff
if k == 27: # press 'ESC' to quit
break
cap.release()
cv2.destroyAllWindows() }