connect - Associate detections from two separate videos

gpu_tracking.connect(to_link1, to_link2, search_range, merge=True)

Does linking on a frame-by-frame basis between two dataframes from different detection runs. This has multiple uses, such colocalizing associating detections in two separate channels, or evaluating a tracking algorithm by “connect”ing the predicted positions to ground truth detections or detections from another algorithm.

Returns:

A merged dataframe containing all the detections from the two input dataframes with an additional column “connect particle”, that associates detections from the two input dataframes. Detections that are present in, for example, dataframe 1 but not dataframe 2 will show as having NaN for all the “_y” suffixed columns, whereas the inverse shows as NaNs in the “_x” suffixed columns

Return type:

pandas.DataFrame

Parameters:
  • to_link1 – First input dataframe

  • to_link2 – Second input dataframe

  • search_range – The search range for linking. See link

  • merge – Whether to return a merged dataframe. Defaults to True. If False, instead returns the input dataframes with “connect particle” as an additional column in both.