Honeybees are fascinating insects that can fly quickly through crowded environments without frequently colliding with one another. They communicate, search for food and return to their hive with remarkable accuracy. Studying how bees move can help researchers better understand their behavior and also inspire new technologies in robotics and autonomous navigation.
This project presents a simple and low-cost approach for capturing and reconstructing the three-dimensional (3D) flight trajectories of Asian honeybees (Apis cerana). Instead of using expensive scientific equipment, the system uses two smartphone cameras placed side by side to record bee movements near the entrance of a beehive. By combining recordings from both cameras, it is possible to estimate the position of each bee in 3D space and visualize its complete flight path.
Data Collection

The videos were collected in a natural environment at a beekeeper's location in Jhinaigati, Sherpur, Bangladesh. Two smartphones, an iPhone 15 and an iPhone 12, were mounted 10 cm apart and positioned 50 cm from the observation area. A white cloth was placed behind the bees to improve their visibility during recording. The cameras captured videos at a resolution of 1920x1080 pixels and a frame rate of 60 frames per second.
Camera Calibration

Before reconstructing the bee trajectories, the two cameras had to be calibrated. Camera calibration is an important step because each camera has slightly different properties, such as lens distortion and viewing angle. A checkerboard pattern was used for this purpose, allowing the intrinsic and extrinsic parameters of both cameras to be estimated. These parameters make it possible to accurately relate the images from the two cameras and calculate the 3D position of objects.
Annotation

After recording, selected video frames were manually annotated using the Computer Vision Annotation Tool (CVAT). Every visible bee was enclosed with a bounding box and assigned a unique identifier. The same identifier was maintained for the corresponding bee in both camera views, ensuring that each bee could be correctly matched across the stereo images. The annotations were exported in the COCO format for further processing.
2D and 3D Trajectory Reconstruction
The annotated data was then processed using Python. First, the center point of each bounding box was calculated to represent the two-dimensional position of the bee in each frame. These points were used to generate 2D trajectory visualizations for both camera views. Different colors were assigned to different bees, making it easier to observe their movement patterns over time.
Loading visualization...
Bees Position Frame by Frame
To reconstruct the bees' movements in 3D, stereo vision techniques were applied. Using the calibrated camera parameters and the corresponding 2D positions from both cameras, OpenCV's Linear Triangulation method was used to estimate the 3D coordinates of each bee. This process was repeated for every frame, producing a continuous 3D flight trajectory. The resulting trajectories were visualized using Plotly, allowing users to explore the flight paths interactively.
Applications
This project demonstrates that accurate 3D bee trajectory reconstruction can be achieved using affordable consumer devices instead of specialized laboratory equipment. Such datasets have potential applications in ethology, ecology, computer vision, swarm robotics and bio-inspired navigation systems. By understanding how bees move and avoid collisions, researchers may develop more efficient algorithms for autonomous drones and collaborative robotic systems.
Conclusion
Overall, this project provides a practical demonstration of how computer vision and stereo imaging can be used to study honeybee flight in natural environments. It also offers a valuable dataset that can support future research on insect behavior and inspire new developments in intelligent robotic systems.
