# Post-processing¶

## Impossible velocity jumps correction¶

correct_impossible_velocity_jumps.compute_neighbour_fragments_and_velocities(video, list_of_fragments, fragment)[source]

Computes the fragments with the same identities to the past and to the future of a given fragment and gives the velocities at the extremes of the current fragment

Parameters: video :
correct_impossible_velocity_jumps.compute_velocities_consecutive_fragments(neighbour_fragment_past, fragment, neighbour_fragment_future)[source]

Compute velocities in the extremes of a fragment with respecto to its neighbour_fragment_past and neighbour_fragment_future

Parameters: neighbour_fragment_past : Fragment object with the same identity as the current fragment in the past fragment : Object collecting all the information for a consecutive set of overlapping blobs that are considered to be the same animal neighbour_fragment_future : Fragment object with the same identity as the current fragment in the future velocities : list List with the velocity needed to link the fragment with its fragment in the past and in the future

Fragment
correct_impossible_velocity_jumps.correct_impossible_velocity_jumps(video, list_of_fragments)[source]

Corrects the parts of the video where the velocity of any individual is higher than a particular velocty threshold given by video.velocity_threshold. This check is done from the video.first_frame_first_global_fragment to the past and to the future

Parameters: video :
correct_impossible_velocity_jumps.correct_impossible_velocity_jumps_loop(video, list_of_fragments, scope=None)[source]

Checks whether the velocity needed to join two consecutive fragments with the same identity is consistent with the typical velocity of the animals in the video (video.velocity_threshold). If the velocity is not consistent the identity of one of the fragments is reassigned. The check is performed from the video.first_frame_first_global_fragment to the past or to the future according to the scope

Parameters: video :
correct_impossible_velocity_jumps.get_fragment_with_same_identity(video, list_of_fragments, fragment, direction)[source]

Get the neighbour_fragment with the same identity in a given direction

Parameters: video :

Fragment
correct_impossible_velocity_jumps.reassign(fragment, fragments, impossible_velocity_threshold)[source]

Reassigns the identity of a given fragment considering the identity of the fragments coexisting with it and the impossible_velocity_threshold

Parameters: fragment : Object collecting all the information for a consecutive set of overlapping blobs that are considered to be the same animal fragments : list List with all the Fragment objects of the video impossible_velocity_threshold : float If the velocity needed to link two fragments is higher than this threshold the identiy of one of the fragments is considerd to be wrong as it would be physically impossible for an animal to move so much. See video.velocity_threshold for each definition

fragment.Fragment
get_available_and_non_available_identities()
get_candidate_identities_by_minimum_speed()
get_candidate_identities_above_random_P2()