fixed when camera not moving

This commit is contained in:
David PAGNON 2024-07-31 15:53:31 +02:00 committed by GitHub
parent fa81ecd0ba
commit 676c6825fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -312,7 +312,7 @@ def reproj_from_trc_calib_func(**args):
pass pass
# header preparation # header preparation
num_frames = min(P_all.shape[1], len(data_trc)) num_frames = [len(data_trc) if P_all.shape[1]==1 else min(P_all.shape[1], len(data_trc))][0]
columns_iterables = [['DavidPagnon'], ['person0'], bodyparts, ['x','y']] columns_iterables = [['DavidPagnon'], ['person0'], bodyparts, ['x','y']]
columns_h5 = pd.MultiIndex.from_product(columns_iterables, names=['scorer', 'individuals', 'bodyparts', 'coords']) columns_h5 = pd.MultiIndex.from_product(columns_iterables, names=['scorer', 'individuals', 'bodyparts', 'coords'])
rows_iterables = [[os.path.join(os.path.splitext(input_trc_file)[0],f'img_{i:03d}.png') for i in range(num_frames)]] rows_iterables = [[os.path.join(os.path.splitext(input_trc_file)[0],f'img_{i:03d}.png') for i in range(num_frames)]]
@ -324,7 +324,7 @@ def reproj_from_trc_calib_func(**args):
Q = data_trc_zup.iloc[:,2:] Q = data_trc_zup.iloc[:,2:]
for frame in range(num_frames): for frame in range(num_frames):
coords = [[] for cam in range(len(P_all))] coords = [[] for cam in range(len(P_all))]
P_all_frame = [P_all[cam][frame] for cam in range(len(P_all))] P_all_frame = [P_all[cam][0] if P_all.shape[1]==1 else P_all[cam][frame] for cam in range(len(P_all))]
for keypoint in range(num_bodyparts): for keypoint in range(num_bodyparts):
q = np.append(Q.iloc[frame,3*keypoint:3*keypoint+3], 1) q = np.append(Q.iloc[frame,3*keypoint:3*keypoint+3], 1)
if undistort_points: if undistort_points:
@ -408,4 +408,4 @@ if __name__ == '__main__':
parser.add_argument('-O', '--output_file_root', required=False, help='output file root path, without extension') parser.add_argument('-O', '--output_file_root', required=False, help='output file root path, without extension')
args = vars(parser.parse_args()) args = vars(parser.parse_args())
reproj_from_trc_calib_func(**args) reproj_from_trc_calib_func(**args)