SainsburyWellcomeCentre / crabs-exploration

A toolkit for detecting and tracking crabs in the field.
BSD 3-Clause "New" or "Revised" License
7 stars 0 forks source link

Escape onset latency figure #161

Open sannatitus opened 3 months ago

sannatitus commented 3 months ago

On 12/4/24 Troy requested a figure describing latency in escape onset. We are suspicious that only a few crabs are escaping from the stimulus, while other crabs trigger escape because of their conspecifics. Chatting with Sofia & Nik, we think the best way to approach this is to compare velocity (displacement of a bounding box's centroid between frame t and t+1) against time to identify which crab(s) began escape first (acceleration will likely be too noisy).

"Caveats:

To achieve this:

  1. @nikk-nikaznan & @sfmig to provide preliminary or mock tracking data
  2. @sannatitus to compose pilot script to:
    • [ ] locate bounding box centroid
    • [ ] determine centroid displacement of bounding boxes with identical tracking IDs across frames - movement package may be helpful
    • [ ] for each tracking ID, compute velocity at each t+1 frame (Sofia says copute velcity vector with python functionality, 'then the norm of that vector for the speed' - maybe @sfmig can clarify later what she means by norm of that vector, i.e., presuming no acceleration?)
    • [ ] graph velocity over time to compare all tracking IDs
    • [ ] identify whether some individuals initiated escape prior to others (if a response gap is not naturally observed from Vmax delays among crabs, we may need to define speed threshold considered as escape onset and compute onset delay in ms for all individuals from the first identified escapee). potentially insiring source 1 & 2.
sfmig commented 1 month ago

Working on the following PRs in movement: