Published: Vol 16, Iss 24, Dec 20, 2026 DOI: 10.21769/BioProtoc.5901 Views: 41
Reviewed by: 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
Note: The nature of the Braid system and setup means that work pauses can be taken after (and indeed during) almost all steps with minimal issues.
A. Initial setup
1. Set up the dividers near the flight arena and support frame and place the work surface behind them such that the work surface is shielded from view by the dividers.
2. Place the PC and switch on the work surface.
3. Attach the lenses to the cameras.
4. Connect the switch and PC.
a. Connect the switch to the external internet via an Ethernet cable.
b. Connect the switch to the PC using the SFP+ Ethernet cable.
Warning: Do not attach the PC to the external internet via another port on the PC. This will cause future behavior of the PC to differ from that we describe.
5. Turn on the PC and log in.
6. Ensure the PC’s Gigabit Ethernet connection is enabled. Go to PC Settings → Network and activate the toggle corresponding to the Gigabit Ethernet to “on”. In the PC described above, this is the “Aquantia Ethernet” toggle.
7. Configure the network to accept Jumbo Frames. This needs to be done on the PC network settings and on the switch itself (see Video 1).
a. Configure the PC network settings:
i. Go to PC Settings → Network and then click on the wired network options cog button for the Aquantia Ethernet: this is to the right of the toggle clicked in step A6. This will open wired network options related to the switch in a new settings window.
ii. In this wired network options window, navigate to the Identity tab and set the value of MTU to 9,000 bytes.
b. Configure the switch itself via the switch’s own settings page, the Instant On portal:
i. In a browser, enter the IP address of the switch. This will bring you to the switch settings portal.
Note: The IP addresses of connected devices can be found using the command arp -a in the Linux terminal [66].
ii. Enter the password for the switch.
Note: If this is the first time you have logged into the switch’s settings portal, you will need to use the default password (this will be provided with the switch, within the administrator guide or online: https://arubanetworking.hpe.com/techdocs/AOS-CX/10.13/HTML/fundamentals_8400/Content/Chp_IniCfg/log-fir-tim-10.htm). You will be required to create a new user and password for the switch when first logging in this way.
iii. Within the Instant On portal, navigate to the left menu to the Switching tab and activate the Jumbo Frames toggle. Then, click Apply on the bottom right of the page. When this occurs, you should receive a notification that this change needs to be saved and will only take effect after a device reboot.
iv. Save the changes to the switch settings by clicking the floppy disc save icon.
Note: If you do not see this icon, click Refresh or navigate back to the Dashboard tab (on the left menu). This may need to be performed a few times before the switch acknowledges settings have been altered and the save icon appears.
v. Reboot the switch by turning it off and on. Once the switch has rebooted and web access restored, it is advised that you return to the switch settings portal and the switching tab and verify these changes have been saved. If not, repeat step A7b.
B. Install and configure dependent software
1. Before beginning the installation of software, in the Linux terminal, run the following:
sudo apt updateand
sudo apt upgradeNote: All commands that require the super-user “sudo” prefix will require inputting the user’s password in the terminal; assume this is needed each time “sudo” appears in commands.
2. Install the Basler pylon API and pylon Viewer.
a. Download the file “pylon_7.3.0.27189_linux-x86_64_debs.tar.gz” from https://www.baslerweb.com/en/downloads/software/?downloadCategory.values.label.data=pylon&softwareVersion.data=7.3.0, and select the pylon 7.3.0 box in the downloads and then the “pylon 7.3.0 Camera Software Suite Linux x86 (64 Bit) - Debian Installer Package”. This will trigger the download (see Video 1).
b. Unzip the “tar.gz” file downloaded (right-click on the tar.gz → Extract).
c. Install pylon API and the associated Basler camera drivers using the following in a command-line terminal launched in the extracted folder (either right-click on the open folder → Open in Terminal, or open a terminal window directly and navigate to the folder with the cd command; see Video 1):
sudo apt-get install './pylon_7.3.0.27189-deb0_amd64.deb' './codemeter_7.40.4997.501_amd64.deb'd. Once the commands from B2c have finished, restart your PC and log back in.
e. Open pylon Viewer.
Note: If pylon Viewer does not open, ensure steps B2a–d have been performed correctly. If so, consult Troubleshooting problem 1.
f. Connect all cameras to the switch with the Ethernet cables. Within the Devices window of pylon Viewer, each camera should appear listed under GigE.
Note: Depending on your network administration settings, cameras that appear in the pylon Viewer may require their IP settings to be altered to allow PC network connection to access the camera. If this is the case, an error directing you to the pylon IP Configurator (pylon Viewer → Tools → pylon IP Configurator, or Apps → pylon IP Configurator) will appear when you attempt to open the camera in pylon Viewer. In the pylon IP Configurator, IP settings can be altered by selecting a camera and selecting the IP settings with the toggles on the bottom left of the window. Consult with your network administrator for the correct IP settings. See also Troubleshooting problem 4 and Basler support: https://www.baslerweb.com/en/learning-support/.
g. Confirm that the cameras are functional by opening each camera and selecting Continuous Shot (camera icon) from the top menu bar (Video 1). You should see the cameras’ live view appear in a viewer tab as this is done.
Note: If devices do not appear in the list of GigE cameras, or do not provide a live view when Continuous Shot is selected, consult Troubleshooting and Basler support: https://www.baslerweb.com/en/learning-support/.
h. If all cameras function within pylon Viewer, you may now close pylon Viewer.
Note: The Basler pylon API does not allow more than one piece of software to operate the cameras at once. Thus, fully close pylon Viewer after use to allow Strand-Braid to operate the camera properly. Assume from now on that if pylon Viewer is used, it is closed after that step. See Troubleshooting.
3. Install ptpd using the following command:
sudo apt install ptpd4. Configure the ptpd network. The ptpd’s configuration downloaded will not be configured to a specific PC and will not automatically activate. The ptpd configuration must be edited for Braid; namely, with the PC running Braid as the “Master” clock to which other “Servant” devices on the network (the cameras) synchronize (see [65] for more details of PTP networks). This process is shown in Video 1.
a. ptpd on installation saves a “minimal” example config at the path “/usr/share/ptpd/ptpd2.conf.minimal”. Copy this config to “etc/ptpd2.conf” by running the following in the command-line terminal:
sudo cp /usr/share/ptpd/ptpd2.conf.minimal /etc/ptpd2.confNote: The file directory “etc” can be accessed in the file navigator by going to other locations → Ubuntu → etc.
b. Identify the port interface ID for the Gigabit connection to the switch, hereafter the <PORT INTERFACE ID>, by either:
i. In the command terminal, enter:
ip link | grep "state UP"This will display something like the following: “3: <PORT INTERFACE ID>: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000”, where <PORT INTERFACE ID> will be replaced by some sort of alpha-numerical code (e.g., “enp3s0”).
ii. Open the pylon IP Configurator (in pylon Viewer → Tools → pylon IP Configurator, or Apps→ pylon IP Configurator). This will display something like the window shown in Figure 1 (be aware that, in Figure 1, five cameras are connected to the switch). The <PORT INTERFACE ID> is the left-aligned name entry after the green circuit board icon.

Figure 1. Basler’s pylon IP Configurator, as it appears when five GigE cameras are connected to the switch. Note the green circuit board icon (on the selected line in the top left) and the <PORT INTERFACE ID> for the Gigabit connection to the switch, here “enp3s0”.
c. Edit the ptpd2.conf file (that was copied in step B4a) so the PTP network occurs over the Gigabit switch connection and uses the PC’s clock (as opposed to a camera) as the “Master”.
i. Enter the <PORT INTERFACE ID> for the Gigabit connection to the switch as the entry for “ptpengine:interface” (line 10) as follows:
ptpengine:interface=<PORT INTERFACE ID>that is, if the <PORT INTERFACE ID> were “enp3s0”
ptpengine:interface=enp3s0ii. Edit ptpengine:preset (line 16) as follows:
ptpengine:preset=masteronlyd. Edit the ptpd file at “/etc/default/ptpd” (note this is a different file from the one edited in step B4c) as follows:
i. On line 3: START_DAEMON=yes
ii. On line 6: PTPD_OPTS="-c /etc/ptpd2.conf"
Note: Depending on the permissions of the user on your PC, either or both above files may require the superuser (sudo) to write and edit. To do this, one can use the terminal editor nano, sudo nano <file path>, or edit a copy of a file and replace the original using sudo cp (as we did in step B4a).
e. Restart the PTP daemon with the following terminal command:
sudo systemctl restart ptpdf. Confirm the PTP network is running with the following terminal command:
sudo systemctl status ptpdThis will produce an output similar to Figure 2.

Figure 2. An example output of the terminal command systemctl status ptpd when ptpd2 is correctly configured
Appearance of a “Started ptpd.service” log entry indicates that the ptpd network has correctly started. If this does not occur, confirm that step B4 has been correctly carried out.
5. Install Rerun.
Note: Rerun can also be installed in different manners (see https://rerun.io/); we describe the simplest method using pip.
a. Install pip. This can be done by either:
i. Using the following:
sudo apt-get install python3-pipii. Using conda. Installation of miniconda as instructed in https://www.anaconda.com/docs/getting-started/miniconda/main should create a base environment with pip installed.
Note: If using conda, all commands using the word “rerun” must be run in the same conda environment. If your PC is being used solely for operating Braid, it may be advisable to install Rerun in the base conda environment (see https://www.anaconda.com/docs/main for instructions on using conda environments).
b. Install Rerun using the following command:
pip install rerun-sdkc. Confirm the installation of Rerun by running the command
rerunIf installed correctly, this will launch Rerun’s launch page (see Video 1). If this page opens, it can be closed for now.
C. Install Strand-Braid
1. Download the GitHub release of Strand-Braid. This protocol uses version 1.0.0-rc.6 from https://github.com/strawlab/strand-braid/releases/tag/1.0.0-rc.6. Within the Downloads section of the release pages are .zip files containing the Debian installer .deb files for each supported Linux distribution (see Figure 3 and Video 1). Click on “strand-braid-ubuntu-2404-1.0.0-rc.6.zip” to download the 2404 version.
Warning: Strand-Braid is supported on multiple distributions of Linux; for this protocol, we use Ubuntu 24.04 (although the usage of Strand-Braid is similar across versions). Be careful that you select the correct version of Strand-Braid for the distribution (if using Ubuntu 24.04, use 24.04, etc.). If the wrong distribution version of Braid is installed, it may still function but may lead to errors in certain functions.

Figure 3. Strand-Braid release on GitHub. Note the Downloads tab and the release .zip files. Highlighted in blue is the 24.04 Linux version; clicking here will initiate the download of the .zip file as indicated in step C1.
2. Unzip the Strand-Braid release .zip file (right-click in file navigator → Extract). Navigate to the unzipped folder. This will contain the .deb installer file and a README.txt (which details the installation of Strand-Braid).
3. Install Strand-Braid itself with the following command in a terminal window opened in this location:
sudo apt install ./strand-braid_1.0.0-rc.6-1_amd64.deb4. Verify strand-braid’s installation by opening a new terminal window (anywhere) and running the following command:
strand-cam --versionIf Strand-Braid was installed correctly, this command should display the version information of Strand Camera (see Video 1).
Note: Strand-Braid is supported on other distributions of Linux and will continue to receive support and new features after this protocol. Other releases (including releases that predate and postdate this protocol) are available from https://github.com/strawlab/strand-braid/releases. Here, releases are ordered newest to oldest. The procedure for installation of other releases of Strand-Braid will be similar to that described here. Specific instructions for each release are found in the README.txt file provided alongside .deb files.
D. Launching Strand Camera on a single attached device
1. Attach a single camera to the switch using an Ethernet cable.
2. Run Strand Camera on this single camera with the following in a command terminal:
strand-camStrand Camera itself will launch with its default settings for the camera. Strand Camera’s graphical user interface (GUI) should launch in the PC’s default web browser. Strand Camera itself will continue to run in the terminal it was launched in and provide an activity log (see Video 2).
Note: If Strand Camera does not launch at this stage, verify the camera’s connection (with pylon Viewer, see step B2 and Troubleshooting) and the strand-braid installation.
3. Take note of the system camera name for the connected camera. This is needed to launch Strand Camera on specific cameras when multiple cameras are connected (section E) and to configure Braid (section F). Each system camera name is computed for each camera from its vendor and serial number. Thus, a Basler camera with the serial number “22441143” would have the name Basler-22441143. The system camera name can be identified in two ways (both demonstrated in Video 2):
a. From the Strand Camera GUI, where it is given at the top of the page in the Live view tab, the title of which takes the form “Live view – <camera_name>”.
b. From the activity log in the terminal Strand Camera was launched in, where the following will appear in the log: “Camera “<camera_name>” detected”.
4. Close Strand Camera:
a. By selecting the terminal the Strand Camera instance was launched in and aborting the current task by pressing Ctrl+c while the terminal window running Strand Camera is selected.
b. By selecting the terminal the Strand Camera instance was launched in and closing the terminal window.
c. Clicking on the “Quit Strand Camera” button at the bottom of the GUI.
This will interrupt the GUI (as Strand Camera is not running); the GUI browser window can also be closed (see Video 2).
5. Disconnect the camera from the switch.
E. Running specific instances of Strand Camera
1. Repeat section D for each camera. The command given in section D launches a single instance of Strand Camera on the first Basler camera detected by the system. Thus, it can only be used to launch Strand Camera on a specific camera if that is the only camera connected. To run Strand Camera on specific cameras when multiple cameras are connected, and later to configure Braid (see section F), one must obtain the system camera names for all cameras in the system.
2. Once all system camera names are obtained, connect all the Basler cameras to the switch.
3. Launch each camera on Strand Camera in turn using the following in the command terminal (demonstrated in Video 2):
strand-cam --camera-name <camera-name>where <camera-name> is the system’s camera name. Thus, a camera with the name “Basler-22441143” would be launched with:
strand-cam --camera-name Basler-22441143Note: To launch multiple instances of Strand Camera at once, you need to open multiple terminal windows (one for each camera).
4. Close all instances of Strand Camera (see step D4).
F. Configuring and launching Braid
1. Create a Braid configuration TOML for your system.
a. Download the config.toml from [63] at protocol_downloads/config_files_for_protocol/config.TOML. Each instance of Braid requires a configuration .toml file [67]. Any options not specified within the configuration toml result in default values being used by Braid. The file config.toml has inputs required for running five Basler GigE cameras, synchronized at 40 fps, with Strand Camera object detection and Braid mainbrain settings adjusted to suit tracking a bee within the arena volume.
b. Replace the system camera names in the config.toml file with those of your cameras obtained in section D and step E1. The entries for system camera names can be found on lines 26, 46, 65, 85, and 105 of the config.toml.
c. Download the Basler .pfs file from [63] at protocol_downloads/config_files_for_protocol/Basler_a2A1920_features.pfs and save this on your PC. We will refer to this file’s path as <Camera_settings_path> henceforth.
d. Edit the config.toml file so that the path indicated by each camera’s “camera_settings_filename” is now <Camera_settings_path>. The entries for each camera can be found on lines 27, 47, 66, 86, and 106 of the config.toml.
Note: Different cameras can share a single camera settings file (as here) or can reference different camera settings files. New .pfs files can be generated in pylon Viewer. Consult pylon Viewer’s documentation for more information: https://docs.baslerweb.com/knowledge/saving-camera-features-or-user-sets-as-a-file-on-hard-disc. To use a different .pfs file, you must update the config.toml as in step F1d.
e. Save the config.toml with your edits with the .toml extension. It is advisable, but not necessary, to create a separate folder for Braid tomls in your “home” directory. Henceforth, the path to this toml file will be represented by <config.toml>.
Notes:
1. In the config.toml provided, the mainbrain input “cal_fname” (the calibration file path) is commented out (prefixed with #) and therefore not read by Braid. We will restore this once the calibration is produced in section I. Braid will still launch without a calibration but will not be able to perform 3D tracking.
2. The object detection parameters of Strand Camera and the Braid tracking mainbrain parameters can be adjusted, and there is a range of options. A full list of inputs and options for those inputs in Braid configuration files is available at https://strawlab.org/strand-braid-api-docs/latest/braid_config_data/index.html [68]. Additionally, the full list of settings that a given configuration toml will produce can be obtained by running:
braid-show-config <config.toml> 2. Launch Braid using your configuration toml with the following command:
braid run <config.toml>Note: Braid will save certain files (AprilTag CSVs, MP4 video) in the current directory Braid is launched from.
3. Allow Braid to launch. As with Strand Camera, Braid will continue to run in the terminal it was launched in and provide an activity log in that terminal window. If the system is installed and configured correctly, Braid should launch similar to the instance shown in Video 3.
a. Initially, Braid will provide confirmation in the activity log of the cameras it can detect and whether all cameras listed in the toml are present.
b. Braid will then attempt to synchronize these using PTP. While this is happening, a series of activity log entries will discuss camera time offsets. Synchronizing the multiple GigE cameras may take a few seconds. Typically, synchronization takes longer the first time Braid is launched after cameras have been powered off. During this time, you may see the following warning in the terminal log: “launch time precedes device timestamp. Is time running backwards?” but this should stop appearing in the log after a few seconds (if it persists, see Troubleshooting problem 3).
c. When the Braid log reports “All expected cameras synchronized”, Braid is ready to be used.
Note: If cameras do not synchronize, the Braid log will report “All expected cameras NOT synchronized.” Consult Troubleshooting if this occurs.
d. Access the Braid GUI by scrolling back through the Braid activity log until you find a link near a large QR code; click on that link or copy it to the browser (see Video 3).
Note: The HTTP port for Braid’s control API (application programming interface) is set in the config toml using the input “http_api_server_addr”. In the example config.toml file provided, this is set to a specific local port. This means that each time Braid is launched, it will be consistently accessible at the same web address in the browser. The QR code and link token provided can be used to access a running Braid instance by devices on the same network as the PC. This can be done by copying the link token into a browser or scanning the QR code with an appropriate device on the same network as the PC running Braid.
Note: In Video 3, Braid is launched with a config file containing a calibration. If Braid is launched without a calibration file, the “calibration:” indicator in the Status tab in the Braid GUI will read “NO CALIBRATION”.
4. Access individual Strand Camera instances that make up the Braid instance by clicking the camera names in the Braid GUI (Video 3) and navigating back to the Braid GUI using the Back buttons in the browser.
5. End the instance of Braid by:
a. Selecting the terminal the Braid instance was launched in and aborting the current task with Ctrl+c.
b. Selecting the terminal the Braid instance was launched in and closing the terminal window.
c. Clicking the “Quit Braid” button at the bottom of the GUI.
G. Set up the tracking volume
Note: In this protocol, steps related to volume setup and calibration (sections G, H, and I) are presented linearly. However, these steps represent parts of what is usually an iterative process. The accuracy of tracking achieved by later steps is dependent on earlier ones and thus, to achieve the desired level of accuracy, it is often necessary to return to earlier steps. Furthermore, adjustments to improve accuracy of later steps may also necessitate repetition of previous steps; see General note 1 for more details.
1. Attach a camera to a mounting plate and then to a ball mount. It may be practical to temporarily disconnect the camera from the switch at this point.
2. Select a position for the camera and attach the mounted camera to the support frame at the selected position. When selecting the position and viewing angle of a camera, consider the following:
a. All points in the tracking volume should be viewed by as many cameras as possible.
b. Collinearity and coplanarity of the cameras’ positions (sharing a geometric line or plane, respectively) should be minimized.
c. Camera fields of view should overlap as much as possible.
d. Cameras should be able to view common points about the volume to which AprilTag markers can be attached for extrinsic calibration (see section I).
The chosen positions for our tunnel volume are detailed in Figure 4, and the resultant fields of view of each camera in the corresponding positions are detailed in Figure 5.

Figure 4. Example of suitable camera positions for 3D tracking of the flight arena tunnel with Braid. (A) Photograph of the positions of the cameras on the support frame. The red point symbol indicates the origin point of the coordinate system used to calibrate Braid (discussed in step G11). (B) 3D model of camera location and positions computed using the resultant extrinsic calibration (displayed using Rerun). Camera location (specifically the pinhole of each camera in the calibration model, which roughly corresponds to the camera sensor location) is indicated by pyramid points. Lowercase letter labels indicate camera identity with respect to the camera views in Figure 5 (each letter corresponding to the panel label in Figure 5; the view of the camera at position “a” is seen in Figure 5A, “b” in Figure 5B, etc.). The * symbol indicates the position at which the photograph of panel A was taken. Axes show the axes with respect to the coordinate system used in extrinsic calibrations (see step G11). Note how cameras vary such that they are non-coplanar and vary as much as possible in horizontal and vertical position without compromising view of the arena volume. Note that the 3D model does not show the camera mounts; hence, the cameras do not intersect with the frame. Note that the frame will subsequently have light arrays attached (step G12); these are not shown here. Note that scale bars can only be an approximation due to the image's perspective view.

Figure 5. Fields of view of cameras in our setup, when the artificial flower is installed (described in section J). Each panel corresponds to a different camera’s view. Camera position is indicated in Figure 4B (panel A shows the view of the camera labeled “a” in Figure 4B, Panel B shows the camera labeled “b” in Figure 4B, etc.). Note that the cameras are positioned in a non-collinear manner, some in line with the arena center, some aligned with the arena edges. Note that the cameras are also positioned in different viewing planes. The outermost cameras near the ends of the tunnel (A and E) view all the way down the length of the arena; as these are positioned lower than other cameras, they view the arena at a nearer horizontal angle. The remaining cameras (B–D) each view the arena from above (nearer vertical). Note the highly overlapping fields of view and that most cameras (all except position C) can see the whole arena volume from a different angle. Additionally, note that AprilTags are visible around the arena by all cameras. Note that scale bars can only be an approximation due to the image’s perspective view.
3. Attach the camera to an Ethernet cable and launch Strand Cam for the camera (as in step E3).
4. While observing the live view of the camera in the Strand Camera GUI, adjust the viewing direction of the camera to view the arena.
5. When satisfied with the camera position, tighten the ball mount so that the camera’s position is fixed.
6. Prepare lens settings for each camera.
a. Place the checkerboard, or another suitable target for focus, in the arena at a point in the camera’s field of view.
b. Viewing the live view in Strand Camera, adjust the focus and aperture of the lens so that the camera has the checkerboard in focus.
c. Fix the lens focus and aperture positions by tightening the screw heads on the lens.
7. Close the Strand Camera instance (as in D4).
8. Repeat steps G1–7 for each camera, selecting a new camera position.
9. Attach AprilTags to points within your tracking volume. When placing tags, consider the following:
a. Collinearity and coplanarity of tag plates should be minimized. Use the sloped mounting blocks to support plates at non-flat angles.
b. Tags should be varied in xyz space (i.e., vertical and horizontal space).
c. Each tag should be detected by multiple cameras.
The positions of our AprilTags (relative to the coordinate system described in Figure 4) are given in [63] at calibration_files/3d_coords_20250523.csv and displayed in Figure 5.
10. Verify AprilTag detections for each camera.
Note: AprilTag detection is computationally demanding. This may result in the error described (with various solutions) in Troubleshooting Problem 2.
a. Access an individual camera’s Strand Camera instance, either via Braid (step F4) or Strand Camera directly (section E).
b. In the Strand Camera GUI, navigate to and deselect Object detection → enable object detection to turn off object detection.
c. Select the box at AprilTag detection → enable detection. If tags are detectable, the location of the center of each tag will be highlighted with a green circle in the live view tab.
d. Looking at the live view from the camera, verify it can detect at least three AprilTags. If so, for each camera, continue to step G11. If not, consider one of the following adjustments until this is the case for all cameras:
i. Adjust the position of the AprilTags.
ii. Adjust the viewing angle of the camera.
iii. Adjust the position of the camera.
iv. Adjust the focus of the camera.
Notes:
1. While “at least” three detections per camera are required, ideally more should be detected. In the system we demonstrate, each camera detects at least six tags. It is advisable to maximize the number of tags each camera can see.
2. AprilTags that are viewed at shallow angles, toward the more distorted periphery of the camera field of view, or that appear small in the camera’s field of view may not be detected by the camera on every frame. This may mean the green detection point flickers in the “live view tab”. Such detections are still suitable for calibration.
11. For each AprilTag, measure its position in 3D space. Save these measured positions into a CSV file with the columns id, x, y, z, where id is the AprilTag identity number, and x, y, and z are the coordinates of the tag center in meters in the respective axes. An example of the CSV file documenting the locations of our tags is available in [63] at calibration_files/3d_coords_20250523.csv. This file and the path to it will henceforth be referred to as <3dCoords>.
Note: The coordinate system used here will define values for data collected with the Braid system. Therefore, it is best for the axes and their origin to align with the volume. For our volume, the origin point (x,y,z = 0,0,0) is the point on the inner right-hand side of the wall at the base of the arena center (the position of the red marker on Figure 4A). The x, y, and z axes run parallel to the arena’s length, width, and height, respectively. These axes directions are marked on Figure 4B.
Warning: Later processes of Braid assume a right-handed coordinate system as in [69,70], as is the case for the system described above. Use of a left-handed coordinate system will result in outputs being presented as mirrored.
12. Attach lighting arrays to the support and camera mounting frame using the ball mounts. Angle the lights such that specular (mirror-like) reflection from these lights in the arena is minimized. We found that arranging the lights so each faces along the arena's length at a 45° angle from the top corners of the support frame works best for illuminating the arena. However, the ideal placement will depend on conditions of your setup (room wall color, extant light fittings, etc.) and the exact placement of your cameras. The goal is to provide even illumination of the volume.
13. Connect lighting arrays to the mains. Circuit diagrams of lighting arrays and a rough sketch of lighting positions used are given in Figures S3 and S4.
H. Perform intrinsic calibrations (checkerboard calibration)
Note: Checkerboard detection is computationally demanding. This may result in the error described in Troubleshooting Problem 2 (with various solutions).
1. Access an individual camera’s Strand Camera instance, either via Braid (section F) or Strand Camera directly (section E).
2. Activate checkerboard calibration for a camera.
a. In the Strand Camera GUI, turn off object detection as done in step G10b.
b. At Checkerboard Calibration → Input: Checkerboard Size, enter the size of your checkerboard. For this purpose, the “size of a checkerboard” is measured in the number of inner corners. That is, an 8 square by 8 square chessboard would have 7 internal corners in both height and width. If using the checkerboards we describe, enter 8 in the “width” and 6 in the “height” fields.
c. Select the box at Checkerboard Calibration → Enable checkerboard calibration.
Note: If you wish to save the images collected during the checkerboard calibration and the checkerboard detection information, select the box at Checkerboard Calibration → Save debug information. The file path where debug information is saved will be indicated next to this box. By default, it is a /tmp (temporary) folder, so it is advisable to save any debug information you wish to keep elsewhere once it is collected.
3. Collect checkerboard detections.
a. The goal is to show the checkerboard to the camera so that Strand Camera can calculate the distortion to the image based on the apparent divergence of straight and flat lines of the checkerboard in the image. To get a good calibration (with mean reprojection error <1 pixel), we need to collect multiple images of the checkerboard that, between them, provide views of the checkerboard that:
i. Provide a good coverage of the camera’s field of view.
ii. View the checkerboard at flat and foreshortened angles.
iii. View the checkerboard at close and farther distances from the camera.
We show a series of target views of the checkerboard that we aim to collect in Figure 6. This process is shown in Video 4.
Note: What is described here is a process that we have found to consistently result in suitable checkerboard images for intrinsic calibrations in Braid. However, different approaches can be successful. It is important to note that some approaches, particularly those that collect only images of the checkerboard far away from the camera, can result in calibrations with unrealistic distortion estimates but low reprojection error. This may cause issues later in extrinsic calibration.

Figure 6. The target images we aim to collect during a checkerboard calibration. For each of our target views (i) shows an idealized diagram of how the image we aim to obtain would look to a camera with no distortion and (ii) shows an example image, from Video 4, which we consider a suitable replication of this view on a real camera. Note how distortion of the image is present in the example images but not idealized diagrams. The target views are as follows: (A) Checkerboard held at a right angle to the camera FOV, at a distance where it fills the camera’s FOV; Checkerboard held at a foreshortened angle, at a distance such that one side fills (B) the left-hand side; (C) the right-hand side; (D) the top and (E) the bottom of the camera’s FOV. These five positions are then replicated but with the checkerboard at a distance where the board fills approximately 10% of the FOV (F–J).
b. Show the checkerboard to the camera so that you replicate a position shown in Figure 6.
Note: Take care not to bend the checkerboards while performing intrinsic calibrations. Calculation of distortion assumes that the checkerboard’s lines are straight and flat, and that any deviations in how these lines appear to the camera are the result of the camera’s intrinsic features. Bending the board will thus introduce deviation in the appearance of the checkerboard that is not due to the camera. We advise holding the checkerboard by the handle attached to the back as shown in Figure 6 and Video 4.
c. Once the checkerboard is in the desired position, wait and hold the checkerboard in that position until it is detected by the Strand Camera. At Checkerboard Calibration → Number of checkerboards collected, there is a counter. Once a frame containing a checkerboard detection is made, this number will count up. When this happens, the detected corners will be indicated in the live view with green rings. However, rings may appear only briefly, so we advise looking at the counter.
d. Once the checkerboard is detected, move the checkerboard smoothly to the next position shown in Figure 6, ideally keeping the checkerboard in the camera’s field of view.
Note: Depending on exact camera positions and available space, you may not be able to achieve all positions in Figure 6 on every camera with the 30 mm checkerboard. If so, use the smaller 10 mm checkerboard for these positions.
e. Repeat steps H3b–d for each position shown in Figure 6.
f. Once checkerboards have been collected, remove the checkerboard from the camera’s view.
g. Return to the PC and observe the number of checkerboards listed at Checkerboard Calibration → Number of checkerboards collected. This should read at least 10 checkerboards detected. However, it is likely that the Strand Camera also detected the checkerboard while you were moving it between the 10 positions. The goal is to have approximately 20 images, including those from the 10 positions shown in Figure 6. If there are many more, production of the calibration will take a long time; too few, and the calibration will likely be of low quality. If you have too many or too few checkerboards, you may wish to perform a new checkerboard calibration.
Note: You may find it difficult to quickly move between positions. This may result in many checkerboards being collected in each position. If so, consider reducing the frame rate of the camera (see General note 2) until you can comfortably move between positions with a detection or two at each.
h. If you wish to repeat the checkerboard calibration and collect checkerboards again, press the button at Checkerboard Calibration → Clear checkerboards. You may then restart.
4. Produce the intrinsic calibration using the checkerboard images collected in step H3.
a. Press the button at Checkerboard Calibration → Perform and save calibration in the Strand Camera GUI. This will produce an intrinsic calibration for the camera, [system camera name].yaml, and a copy of this calibration with a timestamped name [system camera name] [time].yaml. Both these files will be saved to “~/.config/strand-cam/camera_info”.
Note: Strand-Braid uses the intrinsic calibration matching the camera name, the [system camera name].yaml file. Producing a new intrinsic calibration later overwrites this file. However, using the timestamped copy, one can return to an old calibration by replacing the content of the file Braid uses with that of the timestamped copy.
b. Deselect the box at Checkerboard Calibration → Enable checkerboard calibration (and the box at Checkerboard Calibration → Save debug information if selected previously).
5. Validate the intrinsic calibration.
a. Navigate to “~/.config/strand-cam/camera_info” in the file explorer.
Note: .config is a hidden file. To view hidden files in the file navigator, click on the three-bars symbol in a file navigator window, ≡, and click Show hidden files.
b. Open the camera’s intrinsic calibration file and view the “Mean reprojection distance” for the calibration (line 2 of the file). Confirm it is <1 pixel. If not, then repeat steps H1–5 for the camera.
6. Repeat steps H1–5 for every camera.
Warning: Camera intrinsic calibrations are specific to the physical lens adjustment of a specific lens and camera. If lens focus is changed after this point, the intrinsic calibration of the camera must be repeated. See General note 1.
I. Perform extrinsic calibration (AprilTag position detection)
1. Collect AprilTag detection data for the extrinsic calibration.
a. Access an individual camera’s Strand Camera instance, either via Braid (step F4) or Strand Camera directly (section E), deactivate object detection (as in step G10b), and activate AprilTag detection (as in step G10c).
b. Activate AprilTag position recording by clicking on the circular record icon within the AprilTag detection tab. This will record a CSV in the directory from which you launched Braid.
c. Allow AprilTag recording to run for 10 s. This will allow time for inconsistent detections (see notes following step G10) to be detected.
d. End AprilTag recording by clicking the square stop recording button (which replaced the record button you clicked on to start) in the AprilTag detection tab.
2. Repeat step I1 for each camera.
3. Move the AprilTag CSV files to a single folder; the path to this folder will henceforth be referred to as <2d-dir>.
4. Generate the extrinsic calibration by running the following in the Linux terminal:
braid-april-cal-cli --apriltags-3d-fiducial-coords <3dCoords> \--apriltags-2d-detections-dir <2d-dir> \--intrinsics-yaml-dir <intrinsics> \--bundle-adjustment --bundle-adjustment-world-points-remain-fixed \--output-xml <output.xml> \--rerun-save <rerun_save.rrd>where <3dCoords>, <2d-dir> are the paths described as in steps G11 and I3. <intrinsics> is the path to the folder containing the intrinsic calibration yaml files for each camera (collected in section H); normally, this is “~/.config/strand-cam/camera_info”. <output.xml> is the path where the calibration will be saved; this path must end in .xml. <rerun_save.rrd> is a path to where a Rerun .rrd file for visualizing the calibration will be saved; this path must end in .rrd. Braid can perform an optimization procedure, bundle adjustment, on all parameters within the calibration (see [71] for more information on bundle adjustment). By default, Braid does not alter camera intrinsic parameters. Furthermore, inclusion of the additional argument “--bundle-adjustment-world-points-remain-fixed” orders Braid to not perform adjustment on the 3D coordinates of the AprilTags. Thus, here, bundle adjustment is restricted to extrinsic camera parameters.
Note: The bundle adjustment procedure used by Braid can be altered or removed. Run braid-april-cal-cli --help for more details on available options. However, we advise (at least initially) using the restrictions detailed above.
5. Validate the extrinsic calibration summary.
a. Observe the calibration summary provided in the output from the command run in step I4 or in the initial lines of the calibration .xml file itself (saved at <output.xml>). This output has two main parts: the “Results from SQPnP algorithm using prior intrinsics” and “Results after refinement with bundle adjustment model”.
b. Navigate to the section “Results after refinement with bundle adjustment model” and inspect the following:
i. In the section “3d distance between original and updated point locations”, verify for each tag ID that the values read “0”.
ii. In the section “3d distance between original and updated camera center locations”, verify that the adjustments are small, ideally below 0.05 m.
iii. In the section “Camera parameters”, the translation (“t_”) and rotation (“r_”) of each camera in the x, y, and z axes are given for the current calibration. The intrinsic parameters (fx, fy, cx, cy) and distortion coefficients (k1, k2, k3, p1, p2) are also given for each camera; however, as these have not been adjusted (due to restrictions applied to bundle adjustment, see above), they can be ignored. Verify that each camera’s translation and rotation values correspond to the camera positions within the coordinate system you used.
iv. In the section “reprojection distance”, a table reports the reprojection distance (error), in pixels, of each AprilTag visible to each camera. The table also gives the mean reprojection distance of each tag across all cameras that detect it (rightmost “mean” column) and of all tags detected by each camera (bottom “mean” row). Lastly, the mean reprojection error across the whole system is given at the intersection of the mean column and row. Low reprojection error is better (discussed in the Validation of protocol section). Verify that the mean reprojection error of each camera is less than 10 pixels. Confirm that the calibration’s mean reprojection error (intersection of row mean and column mean) is small, ideally less than 5 pixels.
Note: The above assumes that the calibration was generated with bundle adjustment settings as in step I4. If these settings are altered, how outputs appear, and the acceptable values for a calibration, will differ.
c. If at any part of step I5b you cannot verify that the values meet the criteria given, you must generate a new extrinsic calibration.
i. Confirm that section I has been correctly performed up to this point. If not, repeat section I up to this point.
ii. If section I has been correctly performed up to this point, identify which tag(s) or camera(s) contribute to the high error. This will be indicated by higher reprojection distances corresponding to them in the “reprojection distance” table.
iii. If a tag is associated with higher reprojection distance, consider remeasuring the position of that tag, or moving the tag so that it is detected by more cameras. Remember to update the <3dCoords> CSV file when remeasuring or moving tags before repeating section I.
iv. If a camera is associated with higher reprojection distance, consider adjusting the camera position, view, or focus and/or performing a new intrinsic calibration (see sections G and H).
v. Once adjustments are made, repeat section I and reevaluate the new calibration.
6. Visualize the calibration in Rerun.
a. Run the following command:
rerun <rerun_save.rrd>where <rerun_save.rrd> is as in step I4. This will launch the Rerun visualization of the calibration.
b. Within Rerun, you will be presented with a 3D reconstruction of the calibration, using the coordinate system for your setup. Here, numbered tags will be positioned at the center of the corresponding AprilTag, and pyramid shapes indicate the location of the cameras. Additionally, for each camera, a reconstruction of its field of view, with AprilTags marked with corresponding numbered tags, will also be presented. Using the time series scroller in the lower part of the window, one can scroll from the beginning to the end of bundle adjustment (if carried out). Looking at the Rerun reconstructions, particularly that at the end of bundle adjustment, confirm that the arrangement of cameras and tags appears true to life. (For more details on using Rerun to visualize data, see https://rerun.io/docs/getting-started/what-is-rerun.)
7. Set your Braid config file to use the calibration.
a. Close Rerun and Braid, as detailed in step F5.
b. Edit the Braid config file produced in section F to use the calibration.
i. Open <config.toml> in the Linux text editor.
ii. Delete the “#” at the start of line 3, corresponding to the input “cal_fname”. Braid will now read this line when launched.
iii. Replace the path listed in the toml for “cal_fname” with the calibration file produced in step I4. The line should look something like this:
cal_fname= "<output.xml>"where <output.xml> is the path to the Braid calibration file.
c. Save and close <config.toml>.
8. Restart Braid with the edited config.toml (as in section F). Now, the Braid GUI should report the presence of a calibration file (see 00:37 on Video 3). At this point, Braid is ready for 3D tracking.
Warning: If a camera position (angle, translation, rotation) or the intrinsic state of a camera is altered, necessitating a new intrinsic calibration, extrinsic calibration must be repeated. See General note 1.
J. (Optional) Provide bees with experience of the flight arena
Note: Bees lacking experience of the flight arena often do not fly straight to the artificial flower when they first enter it, even if they have experience with artificial flowers or the window access (similar observations are described in [62]). Allowing bees to experience the arena before tracking leads them to search the arena in a more direct way [59–62]. It is, however, possible to track a completely naïve bee within the arena and not conduct section J.
Warning: Opening the arena and replacing and refilling the artificial flower feeding reservoirs while bees have access to the arena risks bees escaping into the lab; it should be conducted by someone experienced in handling bees in such a setting. If bees escape, catch them using Falcon tubes and the fly net, and release them outdoors.
1. Place an artificial flower attached to a feeding reservoir (type A) in the center of the flight arena.
2. Connect the arena access tube, without gates inserted, to one of the T-junction arms of the window access to allow bees visiting the window access free access to the flight arena (see Figures S7 and S8).
3. Maintain the rewards in the arena daily as follows:
a. Remove the artificial flower and feeding reservoir from the flight arena.
b. Replace the reservoirs in the artificial flower and window access with new tubes filled with sucrose, and replace the wick if there is visible mold or a change in color. Dispose of the used wicks.
c. Return the artificial flower and feeding reservoir to their place in the arena.
Note: Due to bee foraging habits, it is safest to conduct the feeding reservoir refills at night, when bees are less active and less likely to be attempting to access the feeder reservoirs while they are being replaced.
4. Continue step J3 until bees have learned the location. This will be evident by bees’ flight to the artificial flower and the presence of bees within the flower feeding reservoir tubes.
Note: The exact time step J3 takes will depend on many factors, including the weather. We allow bees free access to the arena for 10 days.
5. Once bees have learned, clear the arena of bees.
a. Place gates within the arena access tube and allow bees leaving the arena to pass by lifting the gate as each bee approaches. Prevent bees from entering the arena by leaving the gates down in front of them.
b. Once bees are no longer leaving the arena, remove the lid of the arena.
c. Using the fly net and Falcon tubes, capture any remaining bees and release them outdoors.
d. Remove the artificial flower from the flight arena.
Hint: Unplugging the lights prior to removing the lid of the flight arena can be helpful, as the dark conditions will discourage bees from flying, making their capture easier.
e. Using a paper towel damp with ethanol cleaning solution, wipe down the inside of the arena.
f. Return the arena lid.
K. Collecting 3D tracking data
1. Prepare the arena for tracking.
a. Place an artificial flower with a jar feeding reservoir (type B) in the center of the flight arena. Ours was placed such that the center of the flower hole was at (x, y, z) = (-0.043, 0.17, 0.03) m in the coordinate system described in step G11.
b. Place the gates into the arena access tube (if not already there).
c. Attach the arena access tube to the window access (if not already attached).
2. Launch Braid and access the GUI (as in section F).
3. (Optional) If saving video MP4 recordings alongside 3D tracking data, set the MP4 video recording frame rates. By default, MP4 recording frame rates in Braid are “unlimited”, and a video is recorded at the maximum frame rate (40 fps in our config.toml). However, recording high frame rate video alongside tracking data can overtax the PC-switch connection and lead to frames being lost and tracking interruptions. It is advised to set the video recording frame rates.
a. Access a camera’s Strand Camera instance as in section F.
b. Select the frame rate for the camera using the buttons at MP4 Recording options → MP4 Max Framerate.
c. Repeat steps K3a–b for each camera. We have found the system described here can tolerate four cameras set at 40 fps and one set at 1 fps. However, to minimize the chance of tracking being interrupted, we typically set four cameras at 30 fps and one at 1 fps. When finished, return to the Braid GUI.
Note: Adjusting MP4 recording frame rate has no effect on the recording frame rate of 3D tracking data. To adjust 3D tracking data recording frame rate, either lower the rate of the Braid system’s trigger pulse (see General notes) or select a frame rate for each camera in the camera’s Strand Camera GUI → Object Detection → CSV Max Rate.
4. Lifting the gates as a bee within the access tube approaches, allow a bee (the “focal bee” for this recording) through the gates in the access tube, closing these gates behind the focal bee. Isolate the focal bee in a tube between two gates in the tube. Ensure there are at least two closed gates between the focal bee and the window access. This will prevent other bees in the window access from reaching the arena during tracking.
5. Allow the focal bee to access the arena by removing the gates in the access tube between it and the arena.
6. Immediately return to the PC behind the divider and click the circle record icon at Record .braidz file in the Braid GUI to begin recording positional data. Ideally, this should be done before the focal bee enters the arena, while the bee is walking through the arena access tube.
7. (Optional) If MP4 video is required, press the circle record icon at Record .MP4 files in the Braid GUI after BRAIDZ file recording has been started.
Hint: To save hard drive space, you may wait until the bee has entered the arena before starting video recording. You can check when this happens in the Braid GUI by viewing a Strand Camera instance or the model live view (see section L below).
8. Record the focal bee in the arena.
9. (Optional) To end MP4 recording, click the square icon at Record .MP4 files in the Braid GUI before ending BRAIDZ recording (step K10). Saved MP4 files will have names corresponding to the time and date of the start of recording and the system camera name. These videos will be saved in the directory the Braid instance was launched from.
10. To end the recording of the BRAIDZ file, click the square stop icon at Record .braidz file in the Braid GUI. Ending a BRAIDZ recording will result in a BRAIDZ file (more details in Data Analysis section) saved in a new directory Home/BRAID-DATA. This BRAIDZ file will have a name corresponding to the date and time of the start of recording and the file extension .braidz.
Critical: To ensure error-free processing, particularly when exporting tracking to Rerun, recording of BRAIDZ files should begin before recording of MP4 files and end after the end of MP4 files, as described above.
11. Once finished with a recording, either allow the focal bee to return to the arena access tube, opening gates for it, as in step K4, allowing it to leave, or remove the lid to the flight arena, capture it, and release it outdoors.
L. Visualizing Braid tracking in real time
There are three ways to visualize the tracking state of the bee while collecting data:
1. You can access live views of the individual Strand Camera instances (as in section F) during recording and view the Live view window. Here, 2D detections will be indicated by a green ring around the object detected.
2. Click Model server in the Braid GUI. This will lead you to the live view of the detections, providing you with the current object ID and a current tracking estimate.
Note: Braid will assign objects it tracks separate object ID numbers. This object ID number will remain with an object while 3D tracking is maintained. Braid’s utilization of a Kalman filter to make 3D tracking estimates means that brief loss of 2D detections can be accounted for. However, if the object remains completely still for a long period of time, the tracking of that object will be lost. This is because 2D detection makes use of a model of the background image of each camera. By default, this is continually updated; thus, a stationary object will begin to be incorporated into this background model. Similarly, if the target is obscured for a prolonged period, the tracking will be lost. Within the arena, bees may be obscured for long periods when a bee goes under the artificial flower or the edges of the tunnel. Upon re-detection, tracking will resume with a new object ID. Braid tracking settings, controlling background model updating and how readily the object is discarded, can be altered within the config.toml (see https://strawlab.org/strand-braid-api-docs/latest/braid_config_data/struct.BraidConfig.html [68] for more details).
3. Using a live feed sent to Rerun:
a. Before tracking a focal bee (before step K5), set the global parameter
export RERUN_VIEWER_URL="rerun+http://127.0.0.1:9876/proxy"b. Start Rerun by running the command
rerunand leave the Rerun window open.
c. Track a bee as in section K.
d. While tracking the bee (during step K8), return to the Rerun window. Within the 3D visualization, you should see the current tracking state within the 3D reconstruction.
M. Visualize the BRAIDZ file
There are three ways to quickly visualize BRAIDZ files collected by Braid:
1. View a BRAIDZ in the BRAIDZ viewer.
a. Access the BRAIDZ viewer via an internet browser at https://braidz.strawlab.org/ or app if installed locally.
b. Drag and drop the BRAIDZ file into the viewer. This will present x- and y-detection values for each camera, then a pair of plots of the 3D tracking (x against y, and x against z).
Note: If the BRAIDZ viewer is installed locally, it can be set as the default application for BRAIDZ files. However, this is discouraged as it will replace Rerun viewer as the default.
2. View a BRAIDZ 3D reconstruction in Rerun: Double-click on a BRAIDZ file. This will launch Rerun viewer. Rerun will present a 3D reconstruction of the 3D tracking data from the BRAIDZ file alongside 2D detections in frames for each camera. Rerun’s data visualizations can then be navigated by frame using the timeframe scroller in the lower half of the Rerun interface. Labels indicating the object ID corresponding to 2D detections and 3D tracking will also be attached to points within these views. When tracking an object, camera views can show up to two dots. One is the detection made by the Strand Camera instance for that camera, if such a detection occurs. The other is the reprojection of the object’s position in the 2D view based on Braid’s 3D estimate. This reprojection point is displayed by Rerun in the camera views even when the estimate is outside the camera’s field of view.
3. Visualize BRAIDZ data with video using Rerun. To do this, a Rerun rrd file needs to be produced using the BRAIDZ and video files.
a. Run the following command to produce a Rerun rrd file:
braidz-export-rrd <path_to_braidz> <paths_to_video>where <path_to_braidz> is the path to the BRAIDZ file, and <paths_to_video> are the paths to each video collected simultaneously with that BRAIDZ file. Additional <paths_to_video> arguments can be added for each camera; however, the more <paths_to_video> added, the longer the production of the rrd will take.
b. View the resultant rrd file by running the following:
rerun <path to rrd>Video 5 shows a demonstration of Rerun’s 2D and 3D reconstructions. For more details on using Rerun, see https://rerun.io/docs/getting-started/what-is-rerun.

Figure 7. Example of a 3D plot of a single bee (the bee with the time identifier “1427”; see [63] for details on bee ID numbers). Axes are represented in meters and describe the flight arena’s 3D axes. Points plotted are the bees’ positions during tracking according to Braid. The yellow disc indicates the artificial flower position; note that tracking terminates as the bee enters. The color of plotted points indicates the time elapsed from when the bee enters the arena and is detected as an object by Braid. Code for generation of such graphs is available alongside datasets included with this publication.
N. Tracking multiple targets with Braid
1. Temporarily change the number of objects Braid tracks.
a. Launch Braid.
b. In Braid, navigate to the Strand Camera instance of a camera (as in step F4), go to Object Detection → Edit configuration input box, and change the “max_num_points” to the desired number of points (this number must be an integer, such as 1, 2, 3, etc.).
c. Press the > arrow between the Edit configuration and Current configuration input boxes to send this change in object detection configuration to the camera.
d. Confirm that the change is now present in Object Detection → Current configuration. If not, repeat steps N1b–c or observe any error warnings below the Edit configuration box. Here, errors such as incompatible or incorrect inputs to the current configuration will be explained, and advice is given.
e. Within the Live view tab of the Strand Camera, you should observe more 2D detection indicators (green rings) when objects move within the camera field of view.
f. Repeat steps N1b–e on each camera. Once complete, the Braid system is now ready to track multiple objects.
g. Repeat section K, but this time allow more than one focal bee (up to the number you have set “max_num_points” to) into the arena to be tracked. You may release these multiple bees into the arena at the same time; Braid does not require targets to be released one at a time for tracking.
Note: Adjusting the number of tracked objects as described in step N1, while useful for quick checks, does not alter the configuration Braid launches into when restarted. If Braid is closed, you must repeat this step. If you wish to keep changes made to Braid’s configuration, you must edit the config.toml file as in step N2.
2. Edit the config file from which Braid is launched. Adjusting the config file in this way allows Braid to launch with settings, such as “max_num_points”, set at the desired value.
a. Open the <config.toml>.
b. Edit the value under “max_num_points” within the sections “cameras.point_detection_config” for each camera to the desired number of points (again, this number must be an integer). This is found on lines 38, 58, 77, 97, and 117 for each camera.
c. Save and close the config file.
d. Once the above is complete, Braid can be launched as in section F. This will result in Braid being launched with the edited configuration, being able to track the desired number of points. Within the Live view tab of the Strand Camera instance, you should observe more 2D detection indicators (green rings) when objects move within the camera field of view.
e. Repeat section K, but this time allow more than one focal bee (up to the number you have set “max_num_points” to) into the arena to be tracked. You may release these multiple bees into the arena at the same time; Braid does not require targets to be released one at a time for tracking.
3. Visualize the data collected in steps N1–2 as done in section M.
Warning: When tracking multiple objects, occlusion where a target object is hidden from detection by another tracked object becomes an issue. When tracking is not based on recognition of individual features, as in Braid, occlusion events can also lead to ID-switching, where the identifiers of two targets swap. For example, a target assigned the ID 1 before an occlusion event with target ID 2 may be tracked as ID 2 after the occlusion event and vice versa [72,73]. As Braid tracks in 3D, ID-switching events will likely only occur when two targets are very close to each other in all dimensions, such that all cameras fail to resolve both targets. The use of these Kalman filter and nearest-neighbor tracking algorithms makes Braid somewhat robust to loss of tracking and ID-switching during brief occlusion events, as both objects’ positions will continue to be predicted by the model. Likewise, as one object post-occlusion will be more likely to align with the IDs before occlusion, Braid is resilient to ID-switching at brief occlusion events [73]. However, longer occlusion events, particularly when targets occlude each other while they are very still, persistently moving in the same direction, or physically interacting, as in mating or attacking, may lead to loss of tracking of one target during occlusion and ID-switching. This can be corrected for by re-tracking (section O, with mainbrain parameters less prone to extinguish objects) or manually correcting IDs in BRAIDZ files (see Data analysis). Due to this, if ID fidelity is important and such occlusion periods are likely, it is also advised to record at least some video (perhaps at low frame rates from a single camera) when tracking multiple objects to help resolve such occlusion events correctly.
Note: Other configuration parameters can also be changed using the same process as that described in section N. For further details on camera object detection parameters, see https://strawlab.org/strand-braid-api-docs/latest/braid_types/struct.BraidCameraConfig.html; for more details on Braid mainbrain parameters, see https://strawlab.org/strand-braid-api-docs/latest/braid_types/struct.TrackingParams.html.
O. Re-track a BRAIDZ file
1. When visualizing 3D tracking data collected live, as in section M, you may identify areas where 3D tracking estimates are absent but 2D detections are made. Braid prioritizes producing 3D estimates at low latency. This means that if 2D detection information from cameras is delayed (due to being held in the switch memory, for example) and received out of order, Braid will not “wait” for past frames, or detections from cameras that have not arrived. Braid will prioritize data for the current frames in the calculation of 3D positions (the “Kalman estimates”). However, if tracking and production of BRAIDZ files continues without errors, the corresponding detection data is logged in the BRAIDZ file. Re-tracking allows Braid to recalculate the 3D positions using all the detection data collected for each frame.
2. Re-track a BRAIDZ file using the following command:
braid-offline-retrack --data-src <braidz> -o <output>Where <braidz> is the “original” BRAIDZ file to be re-tracked, and <output> is the file path of the resultant re-tracked BRAIDZ, which must end in .braidz. This command will produce an output BRAIDZ with re-tracked data using the same calibration and tracking parameters as used when the original live data was collected.
Note: Braid will not allow you to overwrite a BRAIDZ file using the above command, so <braidz> cannot be the same as <output>, and you must change the output filename if performing multiple re-tracks.
3. Visualize the new output BRAIDZ file as in section M. Depending on the BRAIDZ file, re-tracking may slightly improve the quality of 3D tracking. Most often, these improvements will include:
a. 3D position estimates may be adjusted or added for frames where they were absent in files collected live.
b. Trajectories of the same target that were previously assigned different BRAIDZ object IDs (as discussed in step L2) may be unified as a single object.
c. Low-confidence projections when objects are lost may be reduced.
d. Braid object IDs within the BRAIDZ file will be altered to start from 0.
4. It can be beneficial to re-track data with altered Braid tracking parameters or a different calibration (such as one of a higher quality). Retracking with alternative configurations can be performed using:
braid-offline-retrack --data-src <braidz> --tracking-params <tracking-params_toml> \--new-calibration <new_calibration> \-o <output>where <braidz> and <output> are as in the command given in step O2, and <tracking-params_toml> is a .toml file containing the new tracking parameters (an example of such a toml file is provided in [63] at protocol_downloads/config_files_for_protocol/retrack_paras.toml), and <new_calibration>, a new calibration file produced as described in section I. --tracking-params and --new-calibration are optional inputs and either or both can be excluded (note that excluding both inputs is the command in step O2).
Data analysis
When you collect tracking data with Braid, it is saved in the BRAIDZ file format (with the extension .braidz, usually in a folder called “BRAID-DATA” in the home directory). This file format is a .zip file with specific contents pertaining to Braid tracking. The key component of a BRAIDZ file is the “Kalman_estimates” data file. This provides Kalman estimates of each tracked object’s position in xyz space (in meters) and directional velocity (m/s) in x, y, and z directions, both within the coordinate system used for calibration. It also provides uncertainty values of these estimates [56,74]. For more details on other specific BRAIDZ components, see https://strawlab.github.io/strand-braid/braidz-files.html.
Within the strand-Braid GitHub repository, generic Python scripts and Jupyter notebooks for accessing data in .braidz files are provided; see https://github.com/strawlab/strand-braid/tree/main/docs/user-docs/analysis/. Additionally, alongside datasets provided with this publication, we provide the specific Jupyter notebooks for plotting data collected by Braid using this protocol and performing the further validation step conducted in the next section [63]. These provide examples of how to access Braid data from BRAIDZ files in Python and how to generate 2D and 3D graphs (as in Figures 7–9) of data collected with Braid. BRAIDZ files can also be unpacked using the unzip command [75] on the BRAIDZ and then the gunzip command [76] on the contents to view the raw CSV files. Using the raw “Kalman_estimates.csv” data file, data collected with Braid can be analyzed using the platform of your choice.

Figure 8. 3D tracking results of three bees that successfully located the flower within the arena. Data were collected as described in the protocol up to section O (including optional section J). A pair of graphs is presented for each bee (individual bees are named by the time at which tracking began). (A–B) Bee 1447; (C–D) bee 1558; (E–F) bee 1740. Each bee’s trajectory is plotted in x-y (A, C, E) and x-z (B, D, F) axes. Axes are in meters and are as described for the tracking arena. The artificial flower position during tracking is indicated by the yellow disc (xy graphs) or lines (xz graphs). Note that tracking ends when the bee enters the inside of the artificial flower. Smaller filled points indicate the tracking estimates obtained after data is re-tracked with the original tracking parameters from the config.toml provided (as in step O2). Large white-filled points indicate tracking estimates data re-tracked using the alternative tracking parameters provided in retrack_paras.toml but not changing calibration (as in step O4). Consequently, a larger filled point indicates that original tracking estimates correspond well with those with more constrained tracking estimates. Black triangles indicate a section in each trajectory where original and re-tracked Kalman estimates differ more noticeably. The color of point fill (original estimates) and edges (retracked estimates) indicates time elapsed (in seconds) since the bee entered the arena.

Figure 9. 3D tracking of three bees simultaneously (specifically from the file “20251015_172023_retracked.braidz”, see [63]) within the flight arena. Data used are re-tracked data, but they maintain the tracking parameters used in config.toml (as discussed in step O2). Tracking of the bees is plotted (A) together in 3D and (B) separately in 2D plots. This data was collected by following the protocol described above, including the optional section J. Axes are represented in meters and describe the flight arena’s 3D axes. In (A), the color of points indicates individual bees, verified in Rerun. In (B), a pair of plots is presented for each bee in the x-y (white background) and x-z (gray background) axes. Each bee’s 2D plots can be identified in the 3D plot based on the label to the left side of the x-y and x-z plots, presented as the bee’s ID number and the corresponding color of that bee in panel A. In (B), the color of points indicates time elapsed (in seconds) since the first bee entered the arena. The artificial flower position during tracking is indicated by the yellow disc (panel A and xy graphs of B) or lines (xz graphs of B). Other examples of simultaneous tracking of multiple bees are provided in the datasets associated with this publication [63].
Validation of protocol
Braid’s 3D tracking is based on the same tracking algorithm as its predecessor software Flydra [56]. Consequently, the principles behind Braid’s 3D tracking algorithm are well validated. Flydra’s 3D tracking estimates have been validated against real-world objects [56], and Flydra has been successfully used to assess and measure 3D positions of insects and other animals (e.g., [1,48,56,57,77–83]). Furthermore, versions of Braid that predate the release described here have also been used [55,84–90]. Additionally, within a meta-analysis of 3D tracking tools, Braid was highly appraised compared to alternative software [91] based on its performance in tracking insects, particularly mosquitoes.
Using the above protocol up to section M (including section J, where bees were allowed to access the arena for 10 days before tracking), we tracked flights of 28 individual bees alone within the arena (data available in datasets included with this publication). We tracked each bee until it located and entered the flower, stopped searching, or attempted to leave the arena. Additionally, tracking was ended after 5 min had elapsed if none of the previous criteria were met. Of the bees tracked, 12 made successful flights in which the bee located the flower within 5 min. Tracking data for three example flights are provided in Figure 8 (tracking results for all successful flights are provided in Figures S9 and S10). Braid can effectively track insects live against complex backgrounds—here, contrasting stripes. As discussed in section O, re-tracking data can further increase the quality of tracking. Braid is also highly suitable for live 3D tracking applications that require low latency, such as integration with closed-loop virtual reality or position-triggered applications [48,57,78,86]. Braid is also capable of tracking multiple objects at a time. Figure 9 demonstrates the results of tracking multiple bees (in this case, three) simultaneously after following the protocol up to section N (including section J); further examples of tracking multiple bees simultaneously are provided (as BRAIDZ files) in the datasets associated with this publication [63].
During the procedure described above, Braid conducts several validation steps on the calibrations it produces, allowing evaluation of the system as it is prepared. These take the form of calculation of “reprojection distance”, also known as “reprojection error”. In general terms, reprojection distance is a measure of the quality of calibration models used by Braid. Reprojection is the act of replotting the location of a detected point using the estimate of that point’s predicted location derived from another coordinate system; this replotted point is the “reprojection”. Thus, reprojection error (or reprojection distance) is the difference between the detected point’s location in the original coordinate system and that of the corresponding reprojection (see [71] for more details). Within Braid, the “detected” points are the 2D detections made by Strand Camera within each camera’s field of view; the reprojections are the corresponding points derived from calibration models (intrinsic and extrinsic). That is, the reprojections are estimates of where a location would appear on a 2D field of view given the calibration model. Within the Braid setup procedure, this method is employed twice, and reprojection distance is always represented as pixels. First, we assess the quality of intrinsic calibrations in step H5, comparing the detected internal corners of the checkerboard against the camera’s intrinsic calibration (distortion) model’s estimate of where the checkerboard corners should appear. Second, we assess the quality of the 3D extrinsic calibration model in step I5, where we compare the 2D detections of 3D points (the AprilTag positions) with the 2D reprojections of those positions derived using the 3D extrinsic calibration model. Using the protocol above, one should be able to produce intrinsic calibrations with mean reprojection distances of <1 pixel. Those used to collect the data shown here had mean reprojection distances of <0.55 pixels (see camera calibrations provided in [63]). Using the protocol as described, we were able to produce extrinsic calibrations with mean reprojection distance as low as 1.95 pixels (see [63] for examples).
To further validate the 3D tracking of the Braid setup described by this protocol, we conducted further validation testing the accuracy of Braid’s measurements compared to known real-world values. An LED wand with two small 1.5-mm-wide LED lights (Broadcom, Palo Alto, CA, USA, article number: HSMW-C170-U0000) was constructed using Makerbeam aluminum profiles (Figure 10A). The distance between the centers of these LED lights was measured with calipers as 0.2924 m. The Braid system was then set to track two points at once (as described in step N2). To facilitate detection of LEDs, the room lights were turned off, and the arena walls and floor were covered with a matte black fabric sheet. The first of these measures ensured the background model for each camera was an even black image, thereby ensuring that the LEDs were the most different pixels viewed by the cameras and that the LEDs were tracked rather than the experimenter moving the wand. The sheet reduced reflections from the arena floor and walls interfering with LED point estimates. The LED wand’s lights were turned on while in the arena and moved about the arena volume. While doing so, the wand was raised and lowered and twisted back and forth within the arena. The combined speed of this LED motion (based on Braid’s Kalman estimates of velocity) was 0.25 ±0.11 m/s (mean ± standard deviation). Once the wand had been moved throughout the arena and back, the LEDs were turned off. Meanwhile, 3D point estimates were collected by Braid. This BRAIDZ file was collected at 20 fps (see General note 2) to reduce the processing demands and reduce the quantity of data collected while the wand was stationary, as it was turned on and off. Video images were also collected. Mean reprojection error of the Braid calibration used was 1.95 pixels. Using Rerun (as in step M2), it was confirmed that the LEDs were tracked throughout the sequence of motion (i.e., reflections of the bright LEDs and the experimenter moving the wand were not tracked). At time points where Braid detected two points within the arena, the 3D Kalman estimates of both points were extracted from the BRAIDZ file, and the distance between them was calculated. Using this approach, we collected 696 estimates of a known distance (0.2924 m) throughout the tracking volume. The distance estimates between the LEDs by Braid were accurate to the sub-millimeter level and varied little, with the mean estimate of the distance being 0.2927 ± 0.001 m (mean ± standard deviation) and a repeatability coefficient [92] of 0.00280 m (Figure 10). We thus find Braid to be highly accurate in position estimation, accurately and consistently estimating the LEDs to be within millimeters of their true position, allowing accurate estimates of distance between them. This is especially the case as much of this variation could be explained by how LEDs are 1.5 mm wide, and where the brightest spot on the LED appears to a given camera may be influenced by viewing angle. Thus, we might expect estimates of each LED position to vary by approximately 0.75 mm even when Braid is accurately detecting the position of the LEDs. It is also worth considering that the small error in distance estimation seen in this validation will represent error in estimation of two LED positions. Braid does not perform position estimation differently when tracking one or multiple objects; we thus may expect position estimate error of individual targets to be lower still.
This protocol represents the basic setup for Braid. The current setup has proven suitable for tracking honey bees. The current Braid system should also be capable of tracking many insect targets (larger and smaller, see General note 6). However, Braid is highly adaptable. Braid has been successfully applied to track other insects (mosquitoes [84,86], fruit flies [89], bumblebees [87]) and other relatively small targets in very complex environments, including outside environments [85,88]. The Braid system can also be adapted to track objects underwater with cameras mounted above (see https://strawlab.github.io/strand-braid/braid_3d_tracking.html). Although our setup uses Precision Time Protocol to synchronize cameras, frame acquisition can also be triggered using digital pulses to the camera trigger ports. This can be done using an Arduino-based trigger box device (code and instructions available at https://github.com/strawlab/triggerbox). In such cases, the PC communicates with the Arduino to build a live model of the clocks on both systems and allows very precise (sub-millisecond) determination of the timing of trigger pulses received by the cameras, allowing precise timing information to be taken from the acquired image frames. This also allows use of USB-connected cameras. Strand-Braid can run on any camera that has either the Basler pylon API (as set up here) or Vimba API (https://www.alliedvision.com/en/products/vimba-sdk/). Strand Camera object detection itself can be altered to fit the requirements of a given application by adjusting the values in the Braid config toml. This includes those that determine the thresholds for object detection and tracking target creation and changing the polarity of object detection to detect darker or brighter objects than the background model or, as used here, to detect absolute differences from the background (see General notes 6 and https://strawlab.org/strand-braid-api-docs/latest/braid_config_data/struct.BraidConfig.html [68] for more information on Braid configuration settings). While real-time tracking is a strength of Braid, suitably synchronized video recordings can be processed in the same way offline (command “braid-process-video”). This can also allow re-processing of recorded video with different object detection settings (see Braid’s full documentation on “braid-process-video”). Further documentation on these additional features is available at https://strawlab.github.io/strand-braid/braid-and-strand-camera.html and https://strawlab.github.io/strand-braid/.

Figure 10. Results of the validation tests. (A) The two-LED wand used. (B) The frequency distribution of the difference between the true distance between the LEDs and Braid’s estimates within the flight arena (calculated as Braid’s estimate – measured value). Here, positive values indicate that Braid’s estimate of the distance between LEDs is larger than the true value; negative values indicate that Braid’s estimate is shorter. The dashed blue line indicates a difference between measurements and estimates of 0. (C) A 3D representation of Braid’s distance estimates throughout the arena during validation. Axes are represented in meters and describe the flight arena’s 3D axes. Plotted are the mean positions of the two LEDs according to Braid. The color of the points indicates the difference between the true distance between the LEDs and Braid’s estimates (as discussed in panel B). The color scale is indicated in the legend to the left of the plot: Braid estimates lower than the true value are more blue; higher estimates are more orange; darker and more black points indicate more accurate estimates of the distance between LEDs. Data used are re-tracked data but maintain the tracking parameters used in config.toml (as discussed in step O2).
General notes and troubleshooting
General notes
1. When to recalibrate
As noted in section G, calibration is often a more iterative process than linear protocols imply. Several changes to the system may necessitate recalibration (i.e., repeating a calibration step after the changes have been made).
A new intrinsic calibration for a camera (section H) is required if you change any aspect of the camera lens, such as focus, zoom, filter, or the lens itself. Altering lens aperture may affect image distortion; this depends on the lens, but if so, such a change requires a recalibration. Note that changing the position of the camera alone does not require a new intrinsic calibration if none of the previous camera settings are altered.
A new extrinsic calibration (section I) is required if you have had to perform a new intrinsic calibration of any camera in the system, or if you have repositioned the cameras in any way (rotation, angle, translation - xyz, position).
If you move an AprilTag to a new position and none of the above are changed in the process, you do not need to perform a new calibration, as the AprilTag’s movement alone does not affect the validity of the current calibration. However, you should ensure the tag’s position is updated in the <3dCoords> for when you next calibrate. It is also best practice to repeat extrinsic calibrations when AprilTags are moved to ensure the current arrangement yields a suitable calibration.
Note: It is good practice to frequently recalibrate the system if it is used persistently over long periods of time, particularly as camera positions may change imperceptibly over time due to heat expansion/contraction of metal supports, the weight of the cameras on the camera mount joints, or accidental movements. Typically, we perform a new extrinsic calibration (as positions of camera are more likely to be altered) every few days if the system is in use.
2. Changing camera frame rate in Braid
In PTP synchronization mode, the camera’s frame rate is controlled by the “periodic_signal_period_usec” parameter within the Braid configuration toml (on line 23 of the config.toml file provided). This is the interval at which cameras are triggered. So, if set at 25,000 µs, this will result in cameras synchronizing at 40 fps. Increasing or decreasing this number will result in corresponding changes in the frame rate that cameras synchronize to. This can be edited in the same manner as described in step N2.
Warning: It is important to note that if the period is set lower than the camera exposure time (controlled by the Basler .pfs file), the PTP network may still be able to send trigger signals at this rate, but as cameras will not be able to collect frames with every PTP signal (as the exposure time means it will take longer than the signal period to collect a frame), this may result in the resultant frame rate differing from expectation and cameras desynchronizing.
3. Is Rerun a dependency of Braid?
Braid will function without Rerun; although helpful, it is not required. If one does not wish to use Rerun, omit steps corresponding to Rerun specifically (B5, I6, L3, M2, M3) and remove the input “--rerun-save <rerun_save.rrd>” from step I4.
4. Get help with Braid and Strand Camera commands
All Braid and Strand Camera commands can provide guidance on inputs. Normally, if inputs are incorrect, a short help message will appear in the output of the command terminal. If a full help message is required (including listing of all input options), run the command with “--help” as an input, e.g., braid-run --help.
5. How to uninstall Braid
Should you need to uninstall Braid, this can be done by running the following command in the Linux terminal:
sudo apt remove strand-braidWhen doing so, you may have to reconfigure the Linux package manager (dpkg) manually. If so, an error message will prompt you to manually run:
sudo dpkg --configure -abefore repeating the apt remove command. Note that uninstalling Strand-Braid does not remove files collected by Braid, such as those saved in BRAID-DATA.
6. How might the Braid setup and settings be adjusted for a different target?
Although tuned to track bees, in practice, the current setup will track different targets, including larger and smaller targets than bees. If at least one pixel is sufficiently different to trigger object detection on enough cameras to initiate and maintain tracking (typically three cameras, though Kalman filtering means these need not be simultaneous detections), the setup can be used for different targets. However, the system setup and configuration can be altered from that described in the above protocol and in the attached files to be more suited to tracking other objects.
In terms of hardware and setup, when tracking smaller targets or targets that contrast less well from the background, one may wish to position cameras closer to targets or use lenses with longer focal length and higher magnification. These increase the chance of a small object being picked up by object detection but come at the cost of reducing the camera’s field of view. This can be compensated by adding more cameras to the system; however, this will affect system demands (Supplementary materials 1 contains equations for calculation of approximate system requirements). Altering camera settings, such as exposure time or gain, to make the target appear more distinct from the background may facilitate detection of different targets. Increasing exposure time or gain may also help detect smaller objects, increasing the pixel value difference caused by a target. These settings can be modified by generating new .pfs files as described in the note following step F1d. Increased lighting may also help increase the contrast between targets and background, facilitating detection.
Altering the values within the Braid configuration file (config.toml) used for tracking may also facilitate the detection of small targets or less contrasting targets. Braid has many settings that can be altered (detailed in full at https://strawlab.org/strand-braid-api-docs/latest/braid_config_data/ [68]), and the tracking performance results from the combined effects of these settings. However, when altering the setup to track smaller or less contrasting objects, one may wish to start by refining the following: lowering the settings of diff_threshold (how different a point has to be to trigger detection; lines 35, 55, 74, 94, and 114 in config.toml) and n_sigma (how much an object has to stand out from the background noise; lines 39, 59, 78, 98, and 118 in config.toml) and increasing hypothesis_test_max_acceptable_error (which determines how much reprojection error is acceptable before object detections trigger tracking; line 17 in config.toml). It is important to consider that altering these settings may come at the cost of increased detection and tracking noise.
7. Where can one go for support with Braid?
Braid support, including troubleshooting and advice and suggestions on adjusting Braid for a particular task, can be found at the Braid website, https://strawlab.org/braid (particularly see the links under “support”), the GitHub repository, https://github.com/strawlab/strand-braid, and Braid’s online forum, https://groups.google.com/g/multicams.
Troubleshooting
Problem 1: pylon Viewer (and pylon IP Configurator) will not launch after installation, and the associated steps have been properly performed.
Possible cause: There is a problem with how the pylon API lists its Linux package dependencies. This means some software packages that the pylon API requires to run are not always installed (usually, the “libxcb-xinput0” dependency of “libqxcb.so” is missing; but detailed below are instructions on identifying missing dependencies).
It is worth noting that the packages whose omission prevents pylon Viewer from launching are needed for pylon Viewer itself, not strand-braid. Thus, if the installation is otherwise conducted as described, the components of the pylon API needed to run strand-braid should be installed and function normally. However, difficulties may arise from not being able to access pylon Viewer and the IP Configurator.
To confirm that this dependency issue is the cause, try running the command:
/opt/pylon/bin/pylonviewerThis command launches pylon Viewer via the command terminal. If this results in the following output, this dependency error is probably the case:
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.Aborted (core dumped)Solution: Identify the packages that are missing and install them. The following steps will allow you to do this:
1. Attempt to launch pylon Viewer with the Qt debug information:
a. Turn on the Qt debug output using the following command:
export QT_DEBUG_PLUGINS=1b. Run pylon Viewer in the command terminal using the following:
/opt/pylon/bin/pylonviewerc. The output of this will look like Figure 11, where various plugins are listed, as well as whether success has been achieved in getting the “keys” from these plugins (a successful plugin, “eglf”, is shown in Figure 11A). Usually, the plugin that has failed to load is “xcb” (the failed plugin, “xcb”, is shown in Figure 11B). The output here will identify a path to a “.so” (shared object) file that failed and caused the aborted launch of pylon Viewer. This can be identified in the output in Figure 11B. Usually, it is the .so object at this path:
/opt/pylon/lib/Qt/plugins/platforms/libqxcb.so
Figure 11. Subset of the Qt debug output when pylon Viewer is launched. Many plugins will be listed, but each should have outputs similar to either panel. (A) Output of a successful plugin, “eglf”. (B) Output of a failed plugin, “xcb”. It is the “xcb” plugin whose dependencies usually need to be installed manually. Note the path to the “.so” file related to this plugin.
2. Identify the dependencies of this “.so” file by running
ldd <so_filepath>where <so_filepath> is the path to the failed “.so” file identified above. If the failed “.so” file were libqxcb.so,
ldd /opt/pylon/lib/Qt/plugins/platforms/libqxcb.soThe output of this command will list several packages followed by “=>” indicators and file paths to their “.so” files. These are the dependencies of libqxcb.so. Identify the missing packages; these will not have a file path and will be listed as “not found” following the “=>”.
3. Install those packages using the following command:
sudo apt-get install <package_name>where <package_name> is the name of the missing packages.
Note: Package names for apt-get do not always exactly match the package name once installed. Use apt-cache search <search term> (where <search term> might be the package name, or part of it) to identify the package name for apt-get.
Usually, the following is required:
sudo apt-get install libxcb-xinput0Once this step is complete, the output of the command given in problem 1, step 2 should not list any dependencies as “not found”; if this is the case, pylon Viewer should now launch. You may be required to restart the PC first. If problems persist, consult Basler customer support at https://www.baslerweb.com/en/learning-support/.
Problem 2: The following error appears onscreen: “Error: frame processing too slow, Processing of image frames is taking too long. Reduce the computational cost of image processing.”
Possible cause: The current task that Braid is carrying out is computationally demanding such that it is not successfully performing the task on every frame received. This normally happens during checkerboard calibration (section H) or AprilTag detection (section I).
Solution:
1) During checkerboard calibration, this error can be safely dismissed. Doing so will simply result in checkerboards being detected at a much lower rate than that of the camera’s set frame rate. Just ensure the checkerboard counter at Strand Camera → Checkerboard Calibration → Number of checkerboards collected ticks up once the checkerboard is in the correct position (as noted in step H3).
2) Collection of checkerboard and AprilTag detections can be conducted in individual instances of Strand Camera launched directly (as in section E) as well as via instances accessed via Braid (step F4). Performing these steps via individual instances of Strand Camera launched directly one at a time can be less demanding.
3) Reduce the frame rates of cameras for the current task (see General note 2). For AprilTag detection and checkerboard calibration, it is fine to run Braid at 10 fps.
Problem 3: Cameras do not synchronize, and Braid's activity log gives the warning that “launch time precedes device timestamp. Is time running backwards?” continuously.
Possible cause: ptpd is improperly configured or has not started. This warning will likely occur in two situations. First, when ptpd is not available, Braid attempts to synchronize cameras with the less accurate Network Time Protocol (NTP), which will fail to meet the set tolerance for synchronization. Second, when the PC clock is not set as the “Master” clock for the PTP network, this can lead to one of the camera’s clocks being ahead of the PC’s clock and being used as the “Master” (i.e., the clock used by Braid).
Solution: Ensure ptpd is functioning properly. Repeat step B4.
Problem 4: GigE cameras were previously found by Strand-Braid. These cameras have not been disconnected, but now Strand-Braid and pylon Viewer state “Cameras not found”.
Possible cause 1: The Gigabit network connection has been deactivated. This can happen when the switch, but not the PC, loses power, or when newer network connections are made, such as Wi-Fi or a regular Ethernet connection to the PC. This can cause the PC to disable “older” connections in favor of a new one.
Solution 1: Ensure the SFP+ and Ethernet cable connections are in order and that the switch is powered. Ensure the PC is connected to the switch and external internet as in section A, and Wi-Fi is not connected. Ensure the Gigabit network connection is activated by repeating step A6.
Possible cause 2: A network error has occurred, and the cameras have not connected. Open the pylon IP Configurator application. Under the column Status, the cameras will read “unreachable” if this is the case.
Solution 2: Refresh the Gigabit and Basler IP settings:
a. Go to pylon Viewer, select Tools → pylon GigE Configurator, and select the Configure button in the window that appears. You will be asked for your password; enter it and allow the pylon GigE Configurator to finish (this should only take a second).
b. Open the pylon IP Configurator. If cameras do not display “OK” as in Figure 1, and still display “unreachable”, refresh each camera’s IP settings.
i. Check the IP configuration and IP address of each camera.
ii. If the IP configuration is incorrect for your network, change the settings using the selections on the bottom left of the window and click Save.
Hint: Consult your network manager for clarification of the network’s IP protocols.
iii. If IP configuration is correct but the IP address is incorrect, refresh the IP configuration of the camera by selecting a protocol configuration in the bottom left of the window, then click back to the correct IP configuration mode, and then Save (that is, save the configuration without having made a change). Upon saving, the camera should retry the connection and be detected.
Problem 5: Launching Strand Camera or Braid results in “BackendError(Opening camera)”, the output of which states, in addition to other things, that “The device is controlled by another application”.
Possible cause: The camera is currently open in another application; most likely, another Strand-Braid instance started previously is still running, or pylon Viewer is running with a camera accessed. The pylon API allows only one program to operate (that is, “open”) a camera at a time. This is why it is good practice to close such applications that access the cameras once finished with them.
Solution: Identify and close the application already using the camera and start Strand-Braid again. The most likely candidates are pylon Viewer or another Strand-Braid instance that has not been properly stopped.
Supplementary information
The following supporting information can be downloaded here:
Supplementary materials 1: PC specifications
1. Table S1. Setup parameters and where they are set
2. Table S2. Values measured on the PC used in this protocol (AMD Ryzen 7 5800X, 16 threads; one thread = one fully used logical core)
3. Table S3. Approximate minimum specifications for this protocol (using five cameras at 1920 × 1200 pixels and 40 fps, one object), including 50% headroom; measured values in brackets
Supplementary materials 2: Additional equipment diagrams
1. Figure S1. Camera and mount assembly
2. Figure S2. Examples of the AprilTag plates, prepared as described in the protocol using the CAD files provided in [63] (protocol_downloads/custom_equipment_cad_files/AprilTag_plates/)
3. Figure S3. The light arrays used in the protocol
4. Figure S4. Simple circuit diagram and sketch of light array positions across the support and camera mounting frame
5. Figure S5. Type A artificial flower
6. Figure S6. Type B artificial flower
7. Figure S7. Window access when access to the flight arena is blocked
8. Figure S8. Arena access tube
Supplementary materials 3: Additional bee tracking figures
1. Figure S9. 3D tracking results of the 12 bees that successfully located the flower, re-tracked using the original tracking parameters given in config.toml
2. Figure S10. 3D tracking results of the 12 successful bees after being re-tracked by Braid using the alternative tracking parameters provided in retrack_paras.toml
Acknowledgments
This work was funded by the Volkswagen Foundation Momentum Program (98 692 to A.D.S.).
We acknowledge support from the Open Access Publication Fund of the University of Freiburg.
We thank M. Siegel and the mechanical workshop of the Institute of Biology I. We also thank N. Brehm and T. Albonetti for providing beekeeping services.
The components of the Braid system itself described here (cameras, PC, switch, etc.) were used as the “static camera” system in Vo-Doan et al. [55]. Braid itself has also been used in [84–90]. The algorithms used in Braid are similar or identical to those of its predecessor software, Flydra [56], which has been used in [1,48,57,77–83].
Author contributions
Protocol Development, M.J.M.H., A.D.S.; Strand-Braid Software—Programming, Software Development and Design, A.D.S.; Strand-Braid Software—Testing, M.J.M.H., A.D.S.; Protocol Optimization or Validation, M.J.M.H., A.D.S.; Writing—Original Draft, M.J.M.H.; Writing—Review & Editing, M.J.M.H., A.D.S.; Data Curation, M.J.M.H., A.D.S.; Data Visualization, M.J.M.H., A.D.S.; Resources, A.D.S., Funding acquisition, A.D.S.; Project supervision and administration, A.D.S.
Competing interests
The authors declare no conflicts of interest.
Ethical considerations
No ethical permissions were required for the experiments involving bees, but the experiments were conducted according to ASAB/ABS guidelines.
References
Article Information
Publication history
Received: Aug 29, 2026
Accepted: Nov 8, 2026
Available online: Nov 26, 2026
Published: Dec 20, 2026
Copyright
© 2026 The Author(s); This is an open access article under the CC BY license (https://creativecommons.org/licenses/by/4.0/).
How to cite
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.
Do you have any questions about this protocol?
Post your question to gather feedback from the community. We will also invite the authors of this article to respond.
Share
Bluesky
X
Copy link
