发布: 2026年12月20日第16卷第24期 DOI: 10.21769/BioProtoc.5901 浏览次数: 41
评审: Anonymous reviewer(s)
Abstract
Advances in camera technology and computer vision techniques have allowed researchers to track animals in 3D in ways that previously were difficult or impossible. Many such 3D tracking tools make use of multiple cameras, but unfamiliarity with the principles and technology involved can make it difficult to employ such techniques. In this protocol, we describe Braid, an open-source software for live, multicamera 3D tracking of insects. Using background subtraction, Braid performs detection of objects without requiring the use of physical markers affixed to the insect. Braid constructs low-latency 3D position estimates using Kalman filtering and nearest-neighbor data association. We document in detail the process of tracking freely flying bees within a flight arena using Braid. This protocol includes instructions on installation, camera configuration, setup, calibration, and operation. Within the system described here, we demonstrate that Braid can achieve position estimates accurate to <1 mm (within a 0.3 m3 volume). These factors make Braid suitable for tracking small, fast-flying animals like insects. Braid’s low latency allows live tracking, removing the necessity to collect large video files and making it suitable for integration in closed-loop systems such as virtual reality.
Key features
• Guides the reader through setup and use of Braid multicamera acquisition and tracking software.
• Braid allows low-latency, marker-free real-time 3D tracking of multiple objects, with a web-based GUI and integration with Rerun visualization software.
• Braid has all necessary calibration tools incorporated within it. We provide detailed instructions on how to calibrate a Braid multicamera system.
• Braid is useful for 3D tracking of animals, robots, or other moving objects, particularly when these objects are small, such as insects.
Keywords: Multicamera trackingGraphical overview
Schematic of 3D tracking with Braid. The sequence of events that occur at each time point to achieve 3D tracking is described from panels A through C (i.e., left to right). Red lines indicate the flow of information between panels and thus through the sequence. (A) Initially, the flight of an insect (here, a honey bee; inset) is observed by a series of synchronized cameras. The bee’s full flight trajectory to the yellow artificial flower is indicated by green points. (B) Image frames from each camera are acquired and processed online with Strand Camera, with one instance of Strand Camera software running per physical camera. Images in B show the image captured for the time point indicated by the black triangle on the bee’s flight trajectory in A. Strand Camera detects the insect in two dimensions. Green dots, visible within magnifications of image frames, indicate the location of these 2D detections. (C) These detections are given to a single instance of the Braid software. Braid then utilizes a Kalman filter-based algorithm and camera calibrations to produce estimates of the bee’s 3D position in real time. The full flight trajectory of the bee looking down the x (red axis), y (green axis), and z (blue axis) axes is shown (panels x, y, and z, respectively). The black triangle in C indicates the same time point in the bee’s flight sequence as shown in B.
Background
Many biological questions require quantification of animal subjects’ position and motion. Computer vision–based tracking techniques allow researchers to automatically detect and track subjects (e.g., [1–8]). In recent years, such computer vision tools have proliferated, especially with the advent of machine learning–based techniques to facilitate object detection and classification (e.g., [9–11]). Automated tracking has been utilized to address a variety of biological questions. These include questions related to flight behavior [12–15], animal activity levels [16], how animals behave in large groups [17–20], responses to stimuli associated with food [21–24], locating and pursuit of food [25–30], threat avoidance [31–33], and navigation in complicated environments [34–43], among many others. Use of automated tracking tools can allow researchers to more quickly acquire large behavioral datasets than they would using manual identification [1] and can allow collection of quantitative data on behaviors that might have been represented in a more qualitative manner in the past, allowing more detailed exploration and analysis (e.g., compare data collected in [44,45] with [46,47]).
How the position is represented in tracking applications can vary. The simplest applications track animals in 2D, often by cameras looking down a single axis, usually from above. Here, the animal’s movement is assumed to remain in a flat plane (e.g., [21,35,41–43]). This can be suitable for terrestrial animals where the vertical position is comparable to ground level. However, tracking of animal position in three dimensions can give more complete insight, especially for flying animals. Yet, flying animals may move quickly in three dimensions within relatively large areas, may be physically small, and sometimes can only be observed at a distance [8]. This is particularly true of insects. These factors are also true of swimming animals, which similarly move in 3D within a fluid environment [48]. While possible (see [49–54]), there are limitations to how well animals can be tracked in 3D using a single camera. If subject size varies, estimation of the animal’s distance from a single camera can be challenging. When animals are small and tracking volumes are comparably large, spatial resolution of cameras can become a problem. High temporal resolution cameras, needed to track fast-moving animals, often have more limited spatial resolution (i.e., to record images at a high frame rate, the cameras often have reduced resolution and smaller image size). Additionally, occlusion can become an issue in some applications, particularly if the target organism is small. For these reasons, many 3D tracking systems make use of multiple cameras [1,4–6,8,55–58]. However, even when 3D trajectory calculation and data association are handled by existing software, multiple cameras present further challenges, such as camera setup, calibration, and synchronization. Thus, without relevant familiarity with the steps involved, researchers can find implementation of multicamera tracking tools challenging.
In this protocol, we aim to address this difficulty by introducing the software Braid. Braid is a free, open-source multicamera acquisition and tracking software. A Braid system is made up of multiple synchronized instances of the single camera–based object detection software Strand Camera, which are coordinated by the Braid program itself. An instance of Strand Camera operates and controls an individual camera and performs 2D detection, measuring the locations of the tracked object(s) in each camera’s field of view. Strand Camera’s object detection algorithm is based on background subtraction. A background model for the appearance of each pixel is made, and incoming images are compared with the model, allowing marker-less object detection. The 2D locations of objects found by each instance of Strand Camera are transmitted to the Braid program, which implements 3D tracking, creating estimates of the object’s position and velocity. Braid makes use of an extended Kalman filter and nearest-neighbor data association algorithm [56]. This can be thought of as Braid modeling the 3D position and velocity of objects at each frame captured by the synchronized cameras. This model is then updated with each incoming frame based on the 2D detections from individual cameras (see [56] for details on the Kalman filtering applied in Braid). Together, the system is robust to brief loss of tracking as a result of the target being blocked by objects in the environment, including other tracked targets (occlusion), as the position estimates are still modeled and individual camera detections can still contribute to the position estimates even when only one camera can detect the object. Throughout such instances, uncertainty of the estimates is maintained. Braid’s object detection is robust and not target-specific; thus, Braid can be applied to track any object in 3D space but is particularly useful in tracking small, fast-moving targets such as insects. Braid’s low latency allows live tracking of objects so 3D tracking data can be recorded without the need for video to be saved, vastly reducing the file size and storage requirements needed for 3D position data collection. Braid is a successor to Flydra [56], being at its core a Rust language–based rewrite of Flydra. Thus, the details of object detection, data association, and application of the Kalman filter to track objects’ positions and velocities remain similar or identical to those described for Flydra in Straw et al. [56]. Like Flydra, Braid is capable of tracking multiple objects simultaneously and also of tracking underwater objects from cameras above the water by modeling the refractive index boundary [48].
Here, we describe the setup of the basic Braid system, where cameras are synchronized with precision time protocol (PTP) over a gigabit Ethernet network. The protocol demonstrates the use of Braid in the context of tracking bees within a tunnel flight arena (in a setup similar to that performed in [59–62]). Our goal is to cover all steps with detailed descriptions of what each step entails in a manner that can be understood and followed without extensive prior experience of computer vision or 3D tracking tools.
Materials and reagents
Biological materials
1. Honey bees, Apis mellifera (L.); four hives were maintained on site using standard beekeeping practices, with free access to foraging in the local environment. These bees were trained to visit the lab via a window access (see Equipment, item 20), providing 1 M sucrose (see Supplementary materials 2)
Reagents
1. Sucrose, 1 M (reward for artificial flowers) (Sigma-Aldrich, CAS number: 50-50-1)
2. Ethanol, 30% (by volume) (for cleaning) (Sigma-Aldrich, CAS number: 64-17-5)
Equipment
1. PC with Linux Ubuntu 24.04 amd64 installed; the full specifications of the PC we use are provided in Supplementary materials 1.
2. Work surface (Fetra Fechtel Transportgeräte GmbH, Borgholzhausen, Germany, Item name: Rolltisch, 150 kg, article number: 5864)
3. Room dividers (KAISER+KRAFT GmbH, Stuttgart, Germany, Item name: Info-Wand Eurokraft basic, article number: 759462 49); two are required to obscure the PC and experimenters from cameras during operation
4. Ethernet cables, six required (S-Impuls Handels, Markt Bibart, Germany, model: Patchcable, 7.5m, cat6A S/FTP, article number: 75717)
5. 10G SFP+ Ethernet cable, one required (Ubiquiti, New York, USA, model: 10G Base Direct Connect Cable - SFP+ to SFP+ - 3 m - 6 mm - passive)
6. Gigabit Ethernet switch (Hewlett Packard Enterprise, Spring Houston, TX, USA, model: HPE Networking Instant On GigE Switch Series 1930 24G Class4 PoE 4SFP/SFP+ 195W serial number: JL683B)
7. Five Basler GigE cameras (Basler, Ahrensburg, Germany, model: a2A1920-51gcBAS GigE camera with the Sony IMX392 CMOS sensor)
8. Lenses (Edmund Optics, Barrington, NJ, USA, model: 4 mm UC Series Fixed Focal Length Lens), five required
9. Ball mounts (PanaVise, Reno, NV, USA, model: 851-00 Knuckle Adjustable Knob and Screw) with T-nut fittings and screws to attach to the support and camera mounting frame (M5 T-nuts, Item Industrietechnik, Solingen, Germany, article number: 0.0.480.54, and an M5 25 mm long countersunk screw, ISO 10642); nine are required in total (five for camera mounts, four for light arrays)
10. Mounting plates to attach Basler cameras to the ball mounts; these have holes positioned to match the 3 mm screw fittings of the cameras and have a socket for a 1/4” nut. These custom parts are 3D printed (Prusa Research a.s., Prague, Czech Republic, Printer: Prusa i3 MK3S, Material: Prusament PETG Jet Black). CAD file is provided in [63] at protocol_downloads/custom_equipment_cad_files/3D_printed_parts/ace2-gige_mount.stl. Figure S1 shows how these parts are combined with ball mounts and cameras
11. Checkerboards made of black and white squares for intrinsic camera calibration. Two 9 × 7 square checkerboards are used, one with 30 mm squares, and the other with 10 mm squares. All checkerboards are produced via the Python script in the Strand-Braid repository at https://github.com/strawlab/strand-braid/blob/main/docs/user-docs/scripts/draw_checkerboard_svg.py. Each is printed out full size, stuck flat (with no folds, bumps, or creases) to a 5 mm thick piece of foamboard. To the back of the foamboard, a handle for the checkerboard made from a plastic cup or more foamboard (depending on the board) is stuck with tape
12. AprilTag plates, made using L204 White, black, white 1.6 mm TroLaze (Trotec Laser GmbH, Marchtrenk, Austria, catalog number: 91640 1031005903397) onto which the AprilTag designs are etched and cut free with a CO2 laser cutter (Trotec Laser GmbH, model: Speedy 100); CAD files are provided in [63] at protocol_downloads/custom_equipment_cad_files/AprilTag_plates/. An example of the resultant AprilTag plates is shown in Figure S2.
13. Sloped mounting blocks, to angle position of AprilTags, four required; these are 3D-printed (using materials as above) and adhered to AprilTag plates with the TroLaze adhesive and to the support and camera mounting frame with double-sided tape. CAD files are provided in [63] at protocol_downloads/custom_equipment_cad_files/3D_printed_parts/tag_groove.stl.
14. Cable ties, to attach camera cables to the flight arena support frame (OBI Group Sourcing GmbH, Wermelskirchen, Germany, Item name: Kabelbinder Weiß, article number: 3511110)
15. Light arrays to illuminate the arena; four simple light arrays are used. Each array is made of a pair of LED light units (LED Umrüst-Modul, Eltric K. Heckel GmbH, Bayreuth, Germany, article number: 541135) screwed to a steel plate. These are in turn attached to the support frame using a ball mount (see above). Light arrays are wired together in parallel and powered via main power supply (wire: Huber+Suhner, Herisau, Switzerland, article: Radox 125, 1 mm, RED and BLUE; connectors: Wago, Minden, Germany, article: Verbindungsklemme 221-413; plug socket and switch: Eltric K. Heckel GmbH, Anschlussleitung mit Schukostecker und Zwischenschalter, article number: 026000). Circuit diagrams for each array and connection of lights to mains are available in Figures S3 and S4.
16. Screwdrivers (Wiha-Softfinish, Schonach, Germany, EAN code: 4010995010218) and hex key sets (iFixit hex key set, San Luis Obispo, CA, USA, article number: IF145-859-2)
17. Insect flight arena, made from Makerbeam 10 ×10 mm aluminum profile extrusions and associated fittings for this profile system (Makerbeam B. V., Utrecht, Netherlands) and UV-permeable acrylic glass of 3 mm thickness (Rohm and Haas, Philadelphia, PA, USA, catalog number: Plexiglas acrylic GS transparent UVD 2458). This creates an enclosed 301 × 31 × 32 cm volume (interior space, x × y × z; length × width × height) with a removable lid. In the backmost wall of the arena, a 32 mm hole is cut to allow the arena access tube to be connected to the arena. Paper wall panels with stripes of a 5 cm periodicity are printed (full-size PDFs for printing are provided in the repository associated with this publication [63] at protocol_downloads/custom_equipment_cad_files/Insect_flight_arena_with_frame/panel_5.03cmPwidth.pdf) and cut to size to be attached to the arena’s long sides and bottom (3.02 × 0.32 m) with masking tape. To the end walls, a cut white paper sheet is stuck. Full details, itemized components, and CAD files are available in [63] at protocol_downloads/custom_equipment_cad_files/Insect_flight_arena_with_frame/ within the files Arena_and_support_assembly.FCStd and Reference_for_Arena_and_support_assembly.docx.
18. Support and camera mounting frame. Built to support the flight arena, cameras, and AprilTag plates. Constructed from 40 mm aluminum profiles (Item Industrietechnik, article number: 0.0.026.33) and associated fittings for this profile system. Notable design features are the presence of horizontal profiles above and below the arena support level for cameras, light arrays, and AprilTag attachment. Full details, itemized components, and CAD files are available in [63] at protocol_downloads/custom_equipment_cad_files/Insect_flight_arena_with_frame/ within the files Arena_and_support_assembly.FCStd and Reference_for_Arena_and_support_assembly.docx.
19. Artificial flowers. Two types of artificial flowers are used, and at least one of each is required. Both utilize discs constructed from 3-mm thick opaque yellow acrylic (Rohm and Haas, catalog number: Plexiglas acrylic GS colored yellow opaque 1H01) cut to a 250 mm diameter disc with a 32 mm diameter hole in its center (using a laser cutter, see above for model). This hole allows flowers to be attached to feeding reservoirs (see below), allowing bees to reach food within by going through the central hole in the artificial flower disc (artificial flower disc can be seen in Figures S5–S7).
Type A: A Falcon tube collar and wick design (similar to that used in [64]). This is constructed with the following parts as shown in Figure S5: two 50-mm sections of a 32-mm diameter acrylic tube (Grünke Acryl, Schwelm, Germany); a 32-mm 90° fitting (Flowcolour, Zaozhuang Shandong, China, item name: Acrylic PMMA fitting right angle connector, diameter: 32 mm); a Falcon tube (Corning Inc, Corning, NY, USA, item name: Falcon 50 mL High Clarity Conical Centrifuge Tubes) filled with sucrose solution, a cotton wool wick (made from a rolled cylinder, Paul Hartmann AG, Heidenheim, Germany, item name: Hartmann Watte, article number: 4046871010515) and a 3D-printed collar (made using the same 3D printing materials listed above, and CAD files found in [63] at protocol_downloads/custom_equipment_cad_files/3D_printed_parts/reinforced_collar.stl). This collar screws onto Falcon tubes, replacing the Falcon tubes’ lid. In this new lid is a 6.6 mm hole through which the wick is threaded. The top of this lid slots into the 32 mm diameter acrylic tube. If the Falcon tube were then filled with sucrose solution, the solution would wet the cotton wick. Bees accessing the tube would be able to feed from the wick. The wick then draws up more solution via capillary action as bees feed. This flower design sits level on a slotted stand cut to size from pieces of packing polystyrene. When empty of sucrose, the Falcon tube and collar can be swapped out with fresh and full tubes or refilled.
Type B: A plastic jar design. The jar used was 6-cm diameter, 3-cm height, with its lid removed, and a sucrose-soaked wick (made as in type A) was placed inside. Artificial flower discs could be placed so the hole in the disc aligned with the open top of the jar (as shown in Figure S6), allowing bees to access the wick by entering the jar through the hole in the disc.
20. Window access. A 32-mm diameter hole is cut into the lab window. An access tube is attached to this hole, allowing bees to reach the lab (and the feeders and arena within) by entering the hole in the flower disc. This window access was constructed with the following parts as shown in Figure S7: sections of 32-mm diameter clear acrylic pipe, one 10 cm, one 30 cm, and two 5 cm lengths; an artificial flower disc (as in item 19) fixed to the end of the 10-cm pipe with acrylic glue; two horizontal pipe connector fittings for 32-mm tubing (Flowcolour, item name: Acrylic PMMA fitting socket connector, diameter: 32 mm); a 32-mm T-junction connector; a Falcon tube collar and wick (exactly as that used in type A artificial flowers). Access to the flight arena was initially blocked (as in Figure S7) using a cap fitting (Flowcolour, item name: Acrylic PMMA fitting cap diameter: 32 mm). This allowed bees to learn to come to the lab window and expect rewards, while allowing the work within the lab discussed in sections A–I to be conducted without interference from bees. To this blocked arm, the arena access tube can be attached (see sections J and K below).
21. Arena access tube, connecting the window access to the flight arena. Made from the following constructed as in Figure S8: 20 mm (a length of 30 cm and 50 cm) and 32 mm (one 10 mm section) diameter clear acrylic pipes (Grünke Acryl), 2 mm wide slits are cut along the width of the 50 cm tube at 4 cm intervals; two 45° pipe fittings for 20 mm diameter tube (Flowcolour, item name: Acrylic PMMA fitting 45-degree elbow connector, diameter: 20 mm); one horizontal pipe connector fitting (Flowcolour, item name: Acrylic PMMA fitting socket connector, diameter: 20 mm) for 20 mm tube and two horizontal pipe connector fittings for 32 mm tube.
22. Arena access tube gates, made from garden plant labels (OBI Group Sourcing GmbH, item name: Stecketiketten 12 cm, article number: 4007873253744); used to control bee arena access
23. Falcon tubes, for catching bees; if not able to release bees back outside shortly, consider drilling air holes into the tubes
24. Fly net (NHBS Ltd, Devon UK, item name: telescopic insect net, article number 245824) for catching bees
Software and datasets
The following software was used in the Braid tracking setup described here. The procedure for installation of software beyond the Linux Ubuntu operating system is described in the procedure section (see Video 1).
1. Linux Ubuntu 24.04 amd64 operating system for the PC running Strand-Braid. Installed exactly as described on the Ubuntu tutorial site: https://ubuntu.com/desktop/docs/en/latest/tutorial/install-ubuntu-desktop/. Some familiarity with using the Linux operating system and the Unix command line is useful.
2. ptpd (Linux Precision Time Protocol Daemon; version: PTPD2 version 2.3.1), to implement Precision Time Protocol (PTP version 2 [65]) across the PC and cameras, for synchronization of frame timestamps between Gig-E cameras.
3. pylon API and pylon Viewer (Basler, Ahrensburg, Germany; version 7.3.0) to allow communication between Strand-Braid and Basler cameras and for setup, configuration, and troubleshooting with cameras (available here: https://www.baslerweb.com/en/downloads/software/?downloadCategory.values.label.data=pylon&softwareVersion.data=7.3.0).
4. Strand-Braid (Andrew Straw, Strawlab; version 1.0.0-rc.6), available open source at https://github.com/strawlab/strand-braid/releases/tag/1.0.0-rc.6. The source code for Strand-Braid is available at https://github.com/strawlab/strand-braid.
5. BRAIDZ viewer (Andrew Straw, Strawlab) accessed online via a web browser here: https://braidz.strawlab.org/ (version used dated: Feb 5th 21:55:20 2024); used for quick visualization of BRAIDZ files (with the ‘.braidz’ extension).
6. Python (The Python Software Foundation, version 3.13.1) and pip (version 25.0). Used for Rerun installation, analysis, and plotting data. The Python packages required for analysis and plotting data (not required for the protocol itself) are provided in [63] at /braid_tracking_data/requirements.txt. Use of Conda/Miniconda or similar for environments for Python is advised but is optional (miniconda version 25.1.1 was used). A conda environment file for these requirements is provided in [63] at /braid_tracking_data/environment.yml.
7. Rerun-cli (version 0.22.1), hereafter, “Rerun.” Used for detailed visualization of Braid live tracking, calibration, and data.
8. Braid config file, available in [63] at /protocol_downloads/config_files_for_protocol/config.TOML. This file is used to configure Braid to requirements; the available file tunes Braid for the setup used in this protocol.
9. Basler .pfs config file, used to set camera settings when Braid is launched to suit the setup used in the protocol, available in [63] at /protocol_downloads/config_files_for_protocol/Basler_a2A1920_features.pfs.
10. Retracking parameters config file, used to apply alternative tracking parameters to Braid’s offline tracking, available in [63] at /protocol_downloads/config_files_for_protocol/retrack_paras.toml.
Procedure
登录 / 注册后阅读全文
文章信息
稿件历史记录
提交日期: Aug 29, 2026
接收日期: Nov 8, 2026
在线发布日期: Nov 26, 2026
出版日期: Dec 20, 2026
版权信息
© 2026 The Author(s); This is an open access article under the CC BY license (https://creativecommons.org/licenses/by/4.0/).
如何引用
Harrap, M. J. and Straw, A. D. (2026). Low-Latency Multicamera 3D Tracking of Insects With Braid. Bio-protocol 16(24): e5901. DOI: 10.21769/BioProtoc.5901.
您对这篇实验方案有问题吗?
在此处发布您的问题,我们将邀请本文作者来回答。同时,我们会将您的问题发布到Bio-protocol Exchange,以便寻求社区成员的帮助。
Share
Bluesky
X
Copy link
