LarvaTrack takes a video satisfying the following constraints. A time-lapse video was taken by a motionless camera at two frames per second (fps) and encoded via wall-clock time for playback at 30 fps. The total length of the video was 4 s, or 120 frames, representing 60-s wall-clock time. The camera was positioned motionless for the duration of the video. A 15-cm petri dish filled the narrow dimension of the frame. A coin (in this case, a penny measuring 19.05 mm), was present in the frame for scale. The background observable through the petri dish was a solid blue color distinct from the color of the larva.
We constructed a deterministic multiple-point object tracker in the following way. We detected larva locations (“detected location”) in each video frame with the OpenCV blob detector. We updated those larva locations (“flowed location”) in each frame with data from the following frame using the OpenCV optical-flow algorithm. Finally, for each successive pair of frames, we assigned some flowed locations from the earlier frame to some detected locations in the later frame. For this, we applied a variation of the Gale-Shapley stable matching algorithm (www.jstor.org/stable/2312726). The resulting digitized larval paths were used to compute average velocity and distance traveled over four 15-s intervals. For additional resources and code, see the Supplementary Materials (text S1 and fig. S4) and the online repository (https://github.com/ plredmond/larva-tracker).
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.