Making the guard robot
Now that we have understood how the learning works and how the learned data can be used to identify people, it's time to put it to use. As the name of the chapter suggests, we will be making a guard robot using this technology. Now, let's have a look at the following program. Before you start programming, take out the robotic vehicle you had and make the connection like we did before in Chapter 6, Bluetooth-Controlled Robotic Car. Attach the motor, motor driver, and Raspberry Pi. Once you have done that, then write the following code. This code is utilizing all the learning of the previous programs in the chapter and we would be able to distinguish between an intruder and a resident of the house based on vision processing. So let's get going:
import numpy as np import cv2 Import RPi.GPIO as GPIO Motor1F = 20 Motor1R = 21 Motor2F = 2 Motor2R = 3 Buzzer = 24 GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(Motor1a,GPIO.OUT) GPIO.setup(Motor1b,GPIO.OUT) GPIO...