coordinates = [] regions = np.zeros((FRAMEN, frames[0].shape[0], frames[0].shape[1]), dtype=np.uint8) point_est_track_data = [] for fi, frame in enumerate(frames): abs_frame_index = frame_pos[fi] coordinates.append(skimage.feature.peak_local_max(frame, min_distance=30, threshold_abs=220)) frame_regions = filters.label_regions(frame, mark_min=120, mark_max=220) regions[fi] = frame_regions point_est_track_data.append(dettrack.point_est_track2(frame, env, eo_params)) pickle.dump({'frame_pos' : frame_pos, 'coordinates' : coordinates, 'regions' : regions, 'eo_params' : eo_params, 'point_est_track' : point_est_track_data, 'truth' : truth, 'missing' : missing, 'truth_interp' : truth_interp, 'derived_truth' : derived_truth, 'epoch' : epoch, 'frame_start' : frame_start}, open(outfile, 'w'))
def img_to_points(img): return dettrack.point_est_track2(img, env, eoparams)
point_est_track_data = [] for fi, frame in enumerate(frames): abs_frame_index = frame_pos[fi] coordinates.append( skimage.feature.peak_local_max(frame, min_distance=30, threshold_abs=220)) frame_regions = filters.label_regions(frame, mark_min=120, mark_max=220) regions[fi] = frame_regions point_est_track_data.append( dettrack.point_est_track2(frame, env, eo_params)) pickle.dump( { 'frame_pos': frame_pos, 'coordinates': coordinates, 'regions': regions, 'eo_params': eo_params, 'point_est_track': point_est_track_data, 'truth': truth, 'missing': missing, 'truth_interp': truth_interp, 'derived_truth': derived_truth, 'epoch': epoch, 'frame_start': frame_start }, open(outfile, 'w'))