Main Content

Design and Building of a Smart Platform with ESP32 Cam to achieve the Mode Tracking for search and Following the Face

In this tutorial, we will show you how to achieve the search and follow Mode of the Smart Robot Car and make it follow the target to move forward. For this project apart from ESP32 Cam, we will only need a two (or four-wheeled) robot with appropriate motor drivers and Arduino Uno board.
The main objective of this project is to perform detection and tracking of faces from the real-time input video. The tracking of the face is done with the help of Arduino uno microcontroller. The microcontroller arduino is connected to two servo motors and two Drive motors. The servos are centered before tracking begins. The coordinates obtained from the bounding box in ESP32 is used to track the face in the subsequent frames. The servos control panning and tilting the webcam mounted on it. The webcam’s position changes according to the movement of the object or person.

Design and Building

The input video stream is obtained using an ESP32-CAM. The ESP-WHO framework takes QVGA (320×240) images as input. Face detection is implemented using MTCNN and MobileNet, and will return the position of any faces in the image if present. Each frame is examined for a face. It is operative only on frontal faces. Once the face is spotted, a bounding box is drawn around it.

The coordinates of the box obtained after detecting the face in a frame is written onto the ESP32 microcontroller.

ESP32 equipped with other sensors such as ultrasonic sensors, IR etc. does not have enough pins to control 2 servos and 2 motors. In addition, the image processing puts a heavy load on the ESP32. In the end I decided on a combination of 2 processors. One component is the Arduino platform with 2 motors and 2 servos and ESP32 as the input video stream source, as the picture below shows.”

Link to article