yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
2DOF PTZ📖
0.About 2DOF PTZ
  • About 2DOF PTZ
1.PTZ Installation tutorial
  • PTZ Installation tutorial
2.Drive servo
180° Servo
  • Arduino Tutorials
  • microbit Tutorials
  • MSPM0G3507 turtorials
  • MSPM0G3519 turtorials
  • Raspberry Pi tutorials
  • Raspberry pico tutorials
270° Servo
  • Arduino Tutorials
  • Microbit Tutorials
  • MSPM0G3507 Tutorials
  • MSPM0G3519 Tutorials
  • Raspberry Pi Pico Tutorials
  • Raspberry Pi Tutorials
3.K230 module on PTZ
  • 1. PTZ face tracking
  • 2. PTZ color tracking
  • 3. Fruit sorting
  • 4. Rock-paper-scissors game
  • 5. Gesture control
  • 6. Human tracking alarm
  • 7. Moving target control and tracking
4.K210 module on PTZ
  • 1.2DOF PTZ Color Tracking
  • 2.2DOF Face Tracking
  • 3.2DOF Fruit sorting
Download ZIP

Welcome to 2DOF PTZ repository

2.2DOF Face Tracking

Gimbal Face Tracking


Gimbal Face Tracking1. Experiment description2. Lab Objectives3. Experimental operations4. Experimental effect5. Experimental summary

1. Experiment description

This experiment belongs to the expansion class experiment, need to match the 2D servo gimbal, and 24-way servo driver board to use. These additional modules are not part of the K210 module kit, so this experiment is for reference only, if there is no corresponding equipment can not directly use the code of this routine.

Firmware required for 24-way servo driver board: K210-track.hex

Gimbal servos are connected to the 24-way servo driver board, x-axis servos are connected to the servo control board S1 pin, y-axis servos are connected to the servo control board S2 pin.

Where the servo line (yellow for the signal line, red for VCC, black for GND) connected to the corresponding colour pins of the control board

24-way servo driver board, please connect the 7.4V lithium battery pack, otherwise it will be low voltage buzzer alarm.

The wiring diagram of K210 vision module and 24-channel servo driver board is shown below.

Connect the K210's serial cable to the serial interface of the 24-way servo driver board (5V--5V, GND--GND, TX--RX3, RX--TX3)

2. Lab Objectives

This lesson focuses on learning K210 vision module with 2D gimbal to do visual tracking function.

The reference code path for this experiment is: CanMV\06-export\tracking_face.py

3. Experimental operations
  1. 24-way servo driver board burn firmware: K210-track.hex
  2. Download the cart driver library and PID control library in the CanMV\06-export\library directory to the root directory of the memory card in advance.
  3. Open CanMV IDE to open the tracking_face.py code and download it to the K210 module.
  4. Connect the K210 module to the 24-channel servo driver board through the 4PIN cable.
  5. Put the gimbal in the white or black background, and then turn on the power of the 24-channel servo driver board.
  6. When the human face enters the collection range of the K210 module's camera, the K210 module will frame out the human face and the PTZ will track the movement of the human face.
4. Experimental effect

Wait for the system initialisation to complete, the K210 module camera will detect whether there is a human face in the screen in real time, if there is a human face in the screen, modify the gimbal angle to make the face look as good as possible.

If there is a face in the screen, modify the angle of the gimbal to keep the face in the middle of the screen as much as possible, and the camera will track the face.

 

If the tracking response is too fast or too slow, you can modify the PID parameters in the programme appropriately.

 

5. Experimental summary

The gimbal tracking face play is developed based on the face detection function, which detects the position coordinates of the face from the camera of the K210 module and through the PID algorithm

Calculate the position where the gimbal needs to move so that the gimbal can track the face in front of the camera. Due to the frame rate and recognition limitations, the face movement cannot be too fast, otherwise the gimbal

Due to the frame rate and recognition limitations, the face cannot move too fast, otherwise the gimbal may not be able to keep up with the response.

 

2DOF PTZ Color Tracking
2DOF Fruit sorting

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文