The visualisation in top-view yields images of the capsules in the horizontal plane of view averaged over the depth of field. The centroid of the projected area of the capsules was determined from the contours extracted from these images. We used Python 2.7 and OpenCV (https://opencv.org/), a cross-platform, open-source computer vision library, for the image analysis. We applied background subtraction with either an adaptive threshold or a simple uniform threshold determined via the Otsu method [1]}. In the resulting black and white image, all contours were identified with a Canny filter [2]}.
