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
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.
On this page
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.
Calibrate before measuring
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.
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.
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
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.
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
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.
Comparing the model with measurements
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.
| 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.