This is my make-through for the week's assignment.
Grab a cup of coffee! Buckle up your seat belt! Enjoy the upcoming greatness!
I have never been a fan of AI or computer vision, so excuse my limited abilities to go through this week.
In this week we discussed image processing using python programming and how to use the haar cascade classifiers to detect eyes.
We used OpenCV as well, which is a library of functions that enables us to control real-time computer vision
Haar Cascade is a machine learning object detection algorithm, It only used for educational purposes.
Step1: After looking for how to use haar cascade I have downloaded the examples folder there are many examples and applications like object tracking or eye-tracking and so on, for me I have chosen aarcascade_frontalface_default and haarcascade_eye which will automatically detect the eyes and the face movement.
Step2: It was necessary to install some packages through the terminal such as:
sudo apt-get install libhdf5-dev libhdf5-serial-dev libhdf5-100
sudo apt-get install libqtgui4 libqtwebkit4 libqt4-test
sudo apt-get install libatlas-base-dev
sudo apt-get install libjasper-dev
wget https://bootstrap.pypa.io/get-pip.py
sudo python3 get-pip.py
sudo pip3 install opencv-contrib-python
sudo pip3 install opencv-python
Step3: I have used the GPIO pins as GPIO no bcm
Step4: I have defined the camera as an input device while the servo motor as an output device.
Step5: I setup the GPIO pin 12 as an output pin and defined PWM function to use it to control the servo motor.
Step6: also I have used some important arrays such as PiRGBArray, Pi Camera and some libraries like time, cv2.
Step7: Connected the raspberry pi camera on the RPI board and attached the servo motor in the defined GPIO Pins.
Step8: Now I need to track face, so I need to detect and read the (x,y) location.
Step9: It worked perfectly so whenever I move my face the servo motor moves in a specific angle which I have previously defined in the code.
What I learned this week is...
Introduction to open cv
How to use a raspberry pi camera
How to use classifiers
Using input reads to control outputs of Raspberry pi GPIO's