4.Face positioning

The main purpose of color block positioning is to achieve face tracking for advanced functions. The principle is to determine the distance and position information of the face to the camera, and judge by calculating the coordinates of the center point of the face in the camera screen, thereby achieving face positioning. The experimental results show that it will always find the center point of the face to follow the movement and print the center point. (For face recognition, please see the previous tutorial)

Code path:dofbot_ws/src/dofbot_face_follow/face positioning.ipynb

1.1 Main code

After the program is started, you can see the printed center coordinates and selected faces.