Skip to content

TIPE · VISION & CONTROL · 2025

Locate the player. Aim the shot.

From image processing to a prototype: a badminton training aid combining two cameras, a geometric model and Arduino control.

Aurélien Capron · Python / OpenCV · Arduino UNO

Watch the test ↗Explore the process

Project at a glance

Context
Preparatory-class TIPE: locating a player and investigating control of a shuttlecock launcher.
Timeframe
2023–2025 · preparatory classes
Team
TIPE presented by Aurélien Capron.
My role
Image processing, calibration, triangulation, prototype building and ballistic study.
Technologies
Python · OpenCV · Arduino UNO · serial communication
Outcome
Tested prototype; distance errors of 19–32 mm at three reference positions. Automatic shot-parameter control remains to be developed.
The rigid camera mount on its tripod.
On this page
01

From images to player detection

The starting point: adapt shot direction to the player’s location. First, identify the same target in both images, then calculate its position.

An initial YOLO approach precedes the selected solution: HSV colour filtering, binary thresholding and selection of the largest bounding rectangle. Colour thresholds are calibrated separately for each camera.

Working interface: two camera views and a court representation.
02

Calibrate before measuring

Wall laser setup used to determine the iPhone focal length.

Connecting pixels to an angle

The experiment measures the visible wall width at several distances. These measurements give the field of view, then the equivalent focal length in pixels used to convert image position into an angle.

The program includes three distance–width pairs for the iPhone and three for the webcam, giving each camera its own field of view.

The calculation

FOV = 2 arctan(L / 2D)
fpx = Wpx / (2 tan(FOV / 2))

D: wall distance · L: visible width · W: image width in pixels. The computed focal length is expressed in pixels.

03

Intersecting two lines of sight

Both cameras share a rigid mount, parallel axes and a known baseline. Viewing angles yield depth and lateral position by triangulation; azimuth gives the direction to send to the launcher.

720 mmBaseline configured in the code
2Independently calibrated cameras
3Difficulty levels

The virtual court displays the player and target. Level 1 targets the player’s position; level 2 chooses a point inside a surrounding disc; level 3 chooses a point on its circumference. A fixed-position mode also disables tracking.

View the geometry
Triangulation principle — presentation, page 7.
04

Building the physical system

The wooden mount maintains camera geometry. A control box houses the Arduino, selection button and indicator LEDs; USB serial connects Python processing to servo control.

Building the wooden mount.
Assembling and soldering the electronics.
Wired control box, active indicator LEDs and servo on the mount.

An observable control chain

LEDs show data reception, timing and selected level. A button changes difficulty without returning to the keyboard. Operating parameters can still be adjusted from the terminal.

View the wiring
Arduino wiring diagram from the repository.
05

From direction to trajectory

Aiming is only part of the problem: shuttlecock trajectory also depends on launch parameters and aerodynamic drag. The presentation compares an experimental trajectory with a theoretical model including drag.

Theory–experiment comparison and trajectory study — presentation, page 15.
06

Comparing the model with measurements

Experimental setup in the sports hall.

Three reference positions

Localisation measurements are compared with three actual positions. Absolute distance errors range from 19 to 32 mm, and azimuth errors from 0.31 to 0.63°. These figures describe these three tests, not guaranteed accuracy across the court.

Measurements from presentation, page 18
Measurement Test 1 Test 2 Test 3
Actual distance (mm) 2730 5448 7388
Measured distance (mm) 2698 5467 7412
Actual azimuth (°) −10,80 7,98 24,20
Measured azimuth (°) −10,17 7,67 23,67

What this project brings together

A complete measurement process: choose a detection method, calibrate the optics, build a geometric model, construct a prototype and compare results with real measurements. Alignment and calibration quality matter as much as image processing.

Documents & code

Explore related work

TIPE · Démonstration / Demo