Update reproj_from_trc_calib.py

This commit is contained in:
David PAGNON 2024-11-09 01:30:27 +01:00 committed by GitHub
parent cd92b89583
commit afd4af2704
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -446,8 +446,8 @@ def reproj_from_trc_calib_func(**args):
# Replace by nan when reprojection out of image # Replace by nan when reprojection out of image
for cam in range(len(P_all_frame)): for cam in range(len(P_all_frame)):
x_valid = data_proj[cam].iloc[:,::2] < calib_params_size[cam][0] 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] < calib_params_size[cam][1] 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] = 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[:, ::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) data_proj[cam].iloc[:, 1::2] = data_proj[cam].iloc[:, 1::2].where(y_valid, np.nan)