|
Implementing the model on the hardwareBog'liq Integration Of Face Recognition Model to a BiometrImplementing the model on the hardware
After the enhanced training had been done, the trainer.yml and the haarcascades_frontalface.xml files will be moved to the Raspberry
Pi. The face recognition model will use the haarcascade_frontalface.xml file so that it can differentiate between faces and non-faces.
The trainer.yml file will be used to help the model to differentiate between individual faces stored within the system as seen on Figure
9. From the previous training program, we have given each face in the datasets a unique id. The unique id will be used to help the
model to assign names with our help manually. We must first initiate an id counter starting from zero. We will then create the names
variable and fill it with strings with the names we want to attach to a certain id. Afterwards, we will set the camera function on the cam
variable and set the size of the camera window. We will also set the size of the minimum window size to recognize a face as seen in
Figure 10.
Figure 9.
Part of the main face recognition program that shows the use of the pre-trained and enhanced training files.
Figure 10.
Part of the main program that shows the naming of the id.
The main face recognition program has two main loops, the first loop is responsible for continuous face detection and live camera
feed. The second loop will judge whether the face detected in the first loop is inside the system or not. Inside the second loop (the
for loop) we will create a confidence rate that will denote how close the recognized face is to the face in the system, it will also show
the name of the closest face it thinks resembles the face in the system, if it detects that the face is not the system however, it will
print the word unknown as seen on Figure 11.
|
| |