pyfast_adt.main.tracking

Submodules

Attributes

path1

insitu_tracker

Classes

KalmanFilter

Tomography_tracker

this is the core of the patchworkCC algorithm, main method run the tracking asking the user to selct a ROI to

Tomography_tracker

this is the core of the patchworkCC algorithm, main method run the tracking asking the user to selct a ROI to

InSituTracker

Package Contents

class pyfast_adt.main.tracking.KalmanFilter(dt, u_x, u_y, std_acc, x_std_meas, y_std_meas)

Bases: object

dt
u
x
A
B
H
Q
R
P
predict()
update(z)
class pyfast_adt.main.tracking.Tomography_tracker(images=None, visualization=False, existing_roi=None, dt=0.1, exp_type='continuous')

this is the core of the patchworkCC algorithm, main method run the tracking asking the user to selct a ROI to track, and return the tracked positions as a list of tuples (predicted_pos (pure KF), template_match (CC), filtered_pos (CC corrected by KF))) just to clarify:

–self.CC_positions is brutally pure CC –self.template_matching_result is CC with on top the patchwork to remove ambiguities –predicted_pos is predicted by pureKF using self.template_matching_result to learn(newton law) (-1 iteration) –filtered_pos is template_matching res. corrected by the KF (CC+newton) == more math

the self.support1 contain the tracked positions of all the methods.

this method is based on a liner KF at constant velocity where the acceleration act as control input if not overwritten in the init step. to overwrite with another KF model after construct the class should be possible to just assign self.KF to another KF model. if intersted check at the bottom the function self.select_other_KF_model(KF_model = your_model)

KF
KF_lost_position = []
KF_corrected_position = []
lost_counter = 0
support1 = []
series = None
n = None
backup_roi = None
series_support = []
support_manual = []
exp_type = 'continuous'
list_templates = []
counter_img = None
visualization = False
existing_roi = None
custom_model = [False, 'linear_KF_2D', 0]
main()
user_defined_ROI(img)
plot_single_track(visualization=False)
plot_tracking()
plot_tracking_reevaluation()
save_tracking(datapoints)
draw_circle(event, x, y, flags, param)
plot_result(color=(255, 0, 0))
manual_tracking(images=None, visualization=False)
display_tracking(images, tracking_dict, method, beam_size_diff=None)
select_other_KF_model(KF_model=None, KF_from_list=None)

function to overwrite the KF model used. the KF should be a class with at least 2 functions predict and update to work properly. a custom KF model can be passed in the argument KF_model (a class to construct). otherwise you can use the argument KF_from_list to select an already implemented KF model. the function construct the class for you. as it’s builded the experiment up to now the KF model should be using as measurement for the update step only the x,y position obtained from an object detection method.

pyfast_adt.main.tracking.path1 = 'L:\\Marco\\hardware_microscopes\\TecnaiF30\\sergi_track\\Tracking\\Tomography\\Sequential\\18\\clean'
class pyfast_adt.main.tracking.Tomography_tracker(images=None, visualization=False, existing_roi=None, dt=0.1, exp_type='continuous')

this is the core of the patchworkCC algorithm, main method run the tracking asking the user to selct a ROI to track, and return the tracked positions as a list of tuples (predicted_pos (pure KF), template_match (CC), filtered_pos (CC corrected by KF))) just to clarify:

–self.CC_positions is brutally pure CC –self.template_matching_result is CC with on top the patchwork to remove ambiguities –predicted_pos is predicted by pureKF using self.template_matching_result to learn(newton law) (-1 iteration) –filtered_pos is template_matching res. corrected by the KF (CC+newton) == more math

the self.support1 contain the tracked positions of all the methods.

this method is based on a liner KF at constant velocity where the acceleration act as control input if not overwritten in the init step. to overwrite with another KF model after construct the class should be possible to just assign self.KF to another KF model. if intersted check at the bottom the function self.select_other_KF_model(KF_model = your_model)

KF
KF_lost_position = []
KF_corrected_position = []
lost_counter = 0
support1 = []
series = None
n = None
backup_roi = None
series_support = []
support_manual = []
exp_type = 'continuous'
list_templates = []
counter_img = None
visualization = False
existing_roi = None
custom_model = [False, 'linear_KF_2D', 0]
main()
user_defined_ROI(img)
plot_single_track(visualization=False)
plot_tracking()
plot_tracking_reevaluation()
save_tracking(datapoints)
draw_circle(event, x, y, flags, param)
plot_result(color=(255, 0, 0))
manual_tracking(images=None, visualization=False)
display_tracking(images, tracking_dict, method, beam_size_diff=None)
select_other_KF_model(KF_model=None, KF_from_list=None)

function to overwrite the KF model used. the KF should be a class with at least 2 functions predict and update to work properly. a custom KF model can be passed in the argument KF_model (a class to construct). otherwise you can use the argument KF_from_list to select an already implemented KF model. the function construct the class for you. as it’s builded the experiment up to now the KF model should be using as measurement for the update step only the x,y position obtained from an object detection method.

class pyfast_adt.main.tracking.InSituTracker(shift=None, tilt_step=5, sim_mode=False, tomo_tracker=None)
a = []
dt = 0.1
tilt_step = 5
updated_positions = []
updated_positions_2 = []
second_iteration = False
tomo_tracker = None
main()
shift_image(image_array, shift)
insitu_obj_detection_sim()
in_situ_run(image, frame_number)
plot_insitu_result()
pyfast_adt.main.tracking.insitu_tracker