pose2sim
pose2sim copied to clipboard
Extrinsics is not getting calculated
When I try to perform calibration while I have the .toml file in the calibration folder I should only calculate extrinsics but instead I get the intrinsics frames.
I had to take a look inside the calibration.py and I noticed this block of code :
# calculate extrinsics
if calculate_extrinsics:
logging.info(f'\nCalculating extrinsic parameters...')
# check that the number of cameras is consistent
nb_cams_extrinsics = len(next(os.walk(os.path.join(calib_dir, 'extrinsics')))[1])
if nb_cams_intrinsics != nb_cams_extrinsics:
raise Exception(f'Error: The number of cameras is not consistent:\
Found {nb_cams_intrinsics} cameras based on the number of intrinsic folders or on calibration file data,\
and {nb_cams_extrinsics} cameras based on the number of extrinsic folders.')
ret, C, S, D, K, R, T = calibrate_intrinsics(calib_dir, intrinsics_config_dict)
# calculate extrinsics
if calculate_extrinsics:
logging.info(f'\nCalculating extrinsic parameters...')
ret, C, S, D, K, R, T = calibrate_extrinsics(calib_dir, extrinsics_config_dict, C, S, K, D)
and I don't know why the intrinsics are being calculated once more, Correct me if i'm wrong but I think it should be like this
# calculate extrinsics
if calculate_extrinsics:
logging.info(f'\nCalculating extrinsic parameters...')
# check that the number of cameras is consistent
nb_cams_extrinsics = len(next(os.walk(os.path.join(calib_dir, 'extrinsics')))[1])
if nb_cams_intrinsics != nb_cams_extrinsics:
raise Exception(f'Error: The number of cameras is not consistent:\
Found {nb_cams_intrinsics} cameras based on the number of intrinsic folders or on calibration file data,\
and {nb_cams_extrinsics} cameras based on the number of extrinsic folders.')
logging.info(f'\nCalculating extrinsic parameters...')
ret, C, S, D, K, R, T = calibrate_extrinsics(calib_dir, extrinsics_config_dict, C, S, K, D)
Hi, before I check that, are you sure that you did not set overwrite_intrinsics = true
in your Config.toml?
It should be set to false in order not to recalculate intrinsic parameters.
Yup overwrite_intrinsics is set to false
Yes you're right, I must have overwritten something by mistake... I'll fix this and push the change as well as a bunch of others tonight or during the week-end!
I just tested the latest version of the code and its still causing problems. This time it loads the extrinsics frame but after labeling the corners of the first camera by hand I get this error :
Traceback (most recent call last):
File "/home/ubuntu/pfe_mocap/main.py", line 52, in
Update : I replaced imgp == [] with len(imgp) == 0 and it works now
Hi, thanks! Sorry I had a few merge issues but I'll make the fixes tonight.