Robot following face. 
======================

We are going to try various detectors of faces.

At first, try the classic detector based on the Haar features (the Viola algorithm)
check the code in Python and launch and play: haar_face_detector.py
Try to occlude your face, rotate your head, ... to make the detection worse
Put contrast desk behind you, make lighting accurate, ... to increase the detection quality

Compare the above solution with the detector based on the Local Binary Patterns: 
lbph_face_detector.py

The XML files containing the two models are readable, so you can also open them
in your editor and investigate. But, please, do not modify.

Better results - and even satisfactory service - we can get by the HOG detector
However, this detector is not a part of the OpenCV library; thus, we need 
to use another library: Dlib.

Dlib is installed in the terminal room.

for Dlib installation on your notebook, you need to install VC++ or gcc and cmake. Then
pip install dlib
if it fails, look for missing packages, install them, if there is still no progress, 
install without it CUDA support:
pip install -v --install-option="--no" --install-option="DLIB_USE_CUDA" dlib
The installation takes a long time (tens of minutes).
(if you fail to install the Dlib library, bypass this step and use it on the 
robot where it is installed in ~/src/lesson7/face_detection_test
Notice the delay in the camera response.)

Notice that Dlib stores the model of the HOG detector in binary form, so 
it is not present in the form of a readable file. (see HOG_face.dat)
However, it contains information similar to that of the models in XML format.

Try the HOG detector on the robot. 
The program is in the "robot" directory.

Start the prepared solution. 
(Notice that there is no delay now - thanks to the blackboard architecture.)

Please modify it to follow the face, not only by left or right turning
but also with forward and backward movement.

(use WinSCP for the files transfer into ~/src/lesson7/face_detection and TightVNC client 
to run it)
(Install WinSCP from https://winscp.net/download/WinSCP-6.3.2-Setup.exe on your notebook
on download its portable version from https://winscp.net/download/WinSCP-6.3.2-Portable.zip
on computers in the terminal room.)
(Install the TightVNC from https://www.tightvnc.com/download.php on your notebook or 
download portable TightVNC from https://download.cnet.com/tightvnc-portable/3001-7240_4-75332206.html
on computers in the terminal room.)

Pay attention to the difference in the FOV of your camera (44 degrees) and the 
robot's (82 degrees) camera. Therefore, debug (print out) all information that 
enables you to volume constants for the robot hardware.

Use the HOG face detector demo to save your face into the file face.png.
Launch the facial landmark detector to find your facial landmarks.
