Hi Bonsai users and developers,
I currently use Bonsai to do image-based tracking of single fruit flies in an arena with several food spots (yeast and sucrose). I use IR background lighting and a IR cut-on filter (R72). I record from four arenas simultaneously, see image attached (test_2017-10-03-191752-0000.jpg).
In order to track the fly, I use background subtraction and an adaptive threshold to be able to find connected components ("find contours" node) and to select the largest to be the fly centroid (tracker.JPG). I would also like to track the food spots, and I started out using an adaptive threshold with Gaussian window and then finding contours. This works robustly for the yeast spots which are opaque. However, the sucrose spots are more transparent, and although visible, very noisy in the image.
Now, here are my concrete questions:
1) Is there a way to average multiple frames in order to get rid of some of the noise that is occluding the detection of sucrose spots?
2) How can I differentiate foreground from background objects (fly = foreground, spots = background)? I'd like to subtract the fly from the spot detection image.
3) Movements or forces from outside of the setup may lead to differences detected by the background subtraction. Is there a way to manually reset/restart the background subtraction node (without using the adaptive term)? Or even better, could I maybe instead of the largest binary region, choose a region which "matches" the shape of a fly (based on lengths of axes, etc.)?
4) Finally, if anyone has comments/suggestions about the provided workflow, please let me know.
Thank you in advance.
Dennis