Face-Tracking Camera Turret

Introduction

This was my first endeavor involving machine vision. The Raspberry Pi-controlled robot uses OpenCV to process images and detect faces using a pre-trained Haar cascade classifier. Servo motors are controlled using an I2C interface board (it was what was available to power them separately) to attempt to align the camera with the face.

Image description

Hardware

  • Raspberry Pi Zero WH
  • I2C servo driver HAT for potential future integration with other projects
  • Raspberry Pi camera module
  • External power supply to prevent damage to the Pi due to the noise in the servos
  • Two MG90s servo motors
  • 3D printed chassis (modeled in Solidworks and printed in PLA on an Ender 3 Pro)

Software

The program uses the machine vision library, OpenCV, to process images in the form of arrays and detect faces in the stream of such images. The face detection is executed via a Haar cascade classifier, which is trained using the “haarcascade_frontalface_default.xml” profile.

Due to hardware limitations in the Pi Zero W and streaming over wifi, I was only able to get a workable frame rate at an abysmal resolution of 192x128.

Demo

Image description
Image description