From afd4af2704520b6c08109766a2e150347d9e563d Mon Sep 17 00:00:00 2001 From: David PAGNON Date: Sat, 9 Nov 2024 01:30:27 +0100 Subject: [PATCH] Update reproj_from_trc_calib.py --- Pose2Sim/Utilities/reproj_from_trc_calib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Pose2Sim/Utilities/reproj_from_trc_calib.py b/Pose2Sim/Utilities/reproj_from_trc_calib.py index c4d5b11..45281d1 100644 --- a/Pose2Sim/Utilities/reproj_from_trc_calib.py +++ b/Pose2Sim/Utilities/reproj_from_trc_calib.py @@ -446,8 +446,8 @@ def reproj_from_trc_calib_func(**args): # Replace by nan when reprojection out of image for cam in range(len(P_all_frame)): - x_valid = data_proj[cam].iloc[:,::2] < calib_params_size[cam][0] - y_valid = data_proj[cam].iloc[:,1::2] < calib_params_size[cam][1] + x_valid = (data_proj[cam].iloc[:, ::2] >= 0) & (data_proj[cam].iloc[:, ::2] < calib_params_size[cam][0]) + y_valid = (data_proj[cam].iloc[:, 1::2] >= 0) & (data_proj[cam].iloc[:, 1::2] < calib_params_size[cam][1]) data_proj[cam].iloc[:, ::2] = data_proj[cam].iloc[:, ::2].where(x_valid, np.nan) data_proj[cam].iloc[:, ::2] = np.where(y_valid==False, np.nan, data_proj[cam].iloc[:, ::2]) data_proj[cam].iloc[:, 1::2] = data_proj[cam].iloc[:, 1::2].where(y_valid, np.nan)