Filming a bumblebee in flight at high speed is hard because the bee will not stay in a tiny, razor-thin focus zone. Maker and engineer Jeremy Fielding spent about a year building a robot that solves this: a cinema camera on a motorised rail that finds a bumblebee, follows it and keeps it in focus automatically. The finished rig was shipped to a bumblebee research team in Berkeley, California, and the project was supported by the Alfred P. Sloan Foundation.
How it finds the bee
Instead of training a neural network to recognise bumblebees, the vision system uses OpenCV to look only for a high-contrast yellow blob and draws a box around it. That is far less work per frame, so the tracking cameras can run faster, and the maker notes he did not need YOLO at all. Scanning the full image, the vision loop runs at about 32 Hz. Once it has found the bee, it searches only a small window around the last position, and the loop speeds up to about 60 Hz. This region-of-interest trick is one of the easiest ways to speed up any camera tracking project.
Stereo vision for focus
Two cameras form a stereo pair, which measures the distance to the bee. A motor with an encoder turns the cinema lens focus ring to match. Because focus ring rotation is not linear with distance, the maker placed a bumblebee specimen at a series of distances, set focus with the focus-peaking tool, checked each distance against a caliper, logged the encoder position and fitted a curve. At 144 mm, the stereo reading matched the caliper exactly. Stereo calibration was the worst part of the whole build. It failed for almost a year, until a software update began flagging blurry calibration shots. About a third were blurred by a few pixels, invisible to the eye but too much for sub-pixel calibration. Fixing that, and locking the shutter speed in the open-source code, made calibration pass first time.
Mechanics and the last-minute bug
The first design was built for very high speeds and was heavy. Measurements showed real bees fly slower than expected, so the maker switched to a commercial belt-driven linear guide that is lighter and can be replaced off the shelf, which matters for a rig that will be used for years. Parts were CNC-machined in steel rather than 3D printed for durability. Days before shipping, the rail began clicking and shaking the camera, visible in macro footage. After rebuilding an older belt system as a backup, he found the real cause: a slipping coupling between the motor and the rail.
Our take
In Berkeley, the robot tracked a yellow chick before moving on to a trained bumblebee colony in a 3 x 1 x 1 foot flight arena. The video is long but a good lesson in system integration, limit switches and e-stops included. To start with colour tracking yourself, see our guide to installing OpenCV on a Raspberry Pi.
Image credit: Jeremy Fielding, frame from the maker's video, cropped and resized.
About the author: Aswinth Raj is an electronics engineer and the editor of CircuitDigest, where he has published more than 150 hands-on projects and tutorials across Arduino, PIC, ESP32, Raspberry Pi and EV battery systems. He selects the stories on this page for what engineers and makers can actually learn or build from. Connect on LinkedIn
Add a comment
No account needed. Your comment appears once a moderator has reviewed it.