data_dirs = { 't_data': [('./data/Translation/Y1/', 'trans_1'), ('./data/Translation/Y2/', 'trans_2'), ('./data/Translation/Y3/', 'trans_3'), ('./data/Translation/Y4/', 'trans_4')], 'p_data': [('./data/Pitch/d1_-40/', 'pitch_1'), ('./data/Pitch/d2_-37/', 'pitch_2'), ('./data/Pitch/d3_-34/', 'pitch_3'), ('./data/Pitch/d4_-31/', 'pitch_4')], 'y_data': [('./data/Yaw/d1_44/', 'yaw_1'), ('./data/Yaw/d2_41/', 'yaw_2'), ('./data/Yaw/d3_38/', 'yaw_3'), ('./data/Yaw/d4_35/', 'yaw_4')], 'v_data': [('./data/RV_Data2/', 'vid')] } if frame_1 == 0 and (data_file != 'V' and data_file != 'v'): data_set_1 = dat.Dataset(data_dirs[which_data][frame_1]) frame_text = "Translation Image" if frame_2 != 0: data_set_2 = dat.Dataset(data_dirs[which_data][frame_2]) for i in range(len(data_set_1.data)): #while True: frame_1 = data_set_1.next_entry() frame_2 = data_set_2.next_entry() # if data_file == 'P' or data_file == 'p' frame_1.amplitude[frame_1.amplitude == 65533] = 0 frame_2.amplitude[frame_2.amplitude == 65533] = 0 frame_1.amplitude = gaussian_filter(frame_1.amplitude, sigma=sigma_val) frame_1.x = gaussian_filter(frame_1.x, sigma=sigma_val) frame_1.y = gaussian_filter(frame_1.y, sigma=sigma_val)
'trans': [('./data/Translation/Y1/', 'trans_1'), ('./data/Translation/Y2/', 'trans_2'), ('./data/Translation/Y3/', 'trans_3'), ('./data/Translation/Y4/', 'trans_4')], 'pitch': [('./data/Pitch/d1_-40/', 'pitch_1'), ('./data/Pitch/d2_-37/', 'pitch_2'), ('./data/Pitch/d3_-34/', 'pitch_3'), ('./data/Pitch/d4_-31/', 'pitch_4')], 'yaw': [('./data/Yaw/d1_44/', 'yaw_1'), ('./data/Yaw/d2_41/', 'yaw_2'), ('./data/Yaw/d3_38/', 'yaw_3'), ('./data/Yaw/d4_35/', 'yaw_4')], 'video': [('./data/RV_Data2/', 'vid')] } if T >= 0 or P >= 0 or Y >= 0: if T >= 0: data_set = data.Dataset(data_dirs['trans'][T]) frame_text = "Translation Image" elif P >= 0: data_set = data.Dataset(data_dirs['pitch'][P]) frame_text = "Pitch Image" elif Y >= 0: data_set = data.Dataset(data_dirs['yaw'][Y]) frame_text = "Yaw Image" # ####image display img = np.zeros_like(data_set.data[0].amplitude) img = np.float32(img) if avg == 1: frame_text += ": averaged" i = 0 for frame in data_set.data:
# print("Previous threshold value: ", ransac_thresh) # ransac_thresh = float(input("Enter threshold value: ")) all_pitch = [] all_yaw = [] all_roll = [] all_x = [] all_y = [] all_z = [] data_dirs = {'v_data': [('./data/RV_Data2/', 'vid')]} if data_file == 'V' or data_file == 'v': frame_text = "Video Run" data_set_1 = data.Dataset(data_dirs[which_data][loc_1]) for frame_1 in data_set_1.data: frame_1.x = -1 * frame_1.x temp_y1 = frame_1.y frame_1.y = frame_1.z frame_1.z = temp_y1 frame_1.amplitude[frame_1.amplitude > 250] = 0 # adjust maximum frame_1.amplitude[frame_1.amplitude == 0] = np.max(frame_1.amplitude) frame_1.amplitude = gaussian_filter(frame_1.amplitude, sigma=sigma_val) # start gaussian filter frame_1.x = gaussian_filter(frame_1.x, sigma=sigma_val) frame_1.y = gaussian_filter(frame_1.y, sigma=sigma_val) frame_1.z = gaussian_filter(frame_1.z, sigma=sigma_val) # print("Dataset Length: ", len(data_set_1.data))