diff --git a/calibrate.py b/calibrate.py index b64e179c6..e71ea6318 100755 --- a/calibrate.py +++ b/calibrate.py @@ -866,13 +866,13 @@ def calibrate(self): for camera in result_config['cameras'].keys(): cam_info = result_config['cameras'][camera] # log_list.append(self.ccm_selected[cam_info['name']]) - reprojection_error_threshold = 1.0 + reprojection_error_threshold = 3.0 if cam_info['size'][1] > 720: #print(cam_info['size'][1]) reprojection_error_threshold = reprojection_error_threshold * cam_info['size'][1] / 720 if cam_info['name'] == 'rgb': - reprojection_error_threshold = 3 + reprojection_error_threshold = 6 print('Reprojection error threshold -> {}'.format(reprojection_error_threshold)) if cam_info['reprojection_error'] > reprojection_error_threshold: @@ -903,7 +903,7 @@ def calibrate(self): right_cam = result_config['cameras'][cam_info['extrinsics']['to_cam']]['name'] left_cam = cam_info['name'] - epipolar_threshold = 0.6 + epipolar_threshold = 1.2 if cam_info['extrinsics']['epipolar_error'] > epipolar_threshold: color = red diff --git a/depthai_helpers/calibration_utils.py b/depthai_helpers/calibration_utils.py index 74984685d..d467b280a 100644 --- a/depthai_helpers/calibration_utils.py +++ b/depthai_helpers/calibration_utils.py @@ -483,10 +483,11 @@ def calibrate_camera_charuco(self, allCorners, allIds, imsize, hfov): print(cameraMatrixInit) distCoeffsInit = np.zeros((5, 1)) - flags = (cv2.CALIB_USE_INTRINSIC_GUESS + + flags_rational = (cv2.CALIB_USE_INTRINSIC_GUESS + cv2.CALIB_RATIONAL_MODEL) + flags_pinhole = (cv2.CALIB_USE_INTRINSIC_GUESS + cv2.CALIB_ZERO_TANGENT_DIST + cv2.CALIB_FIX_K1 + cv2.CALIB_FIX_K2 + cv2.CALIB_FIX_K3) + flags = flags_pinhole - # flags = (cv2.CALIB_RATIONAL_MODEL) (ret, camera_matrix, distortion_coefficients, rotation_vectors, translation_vectors, stdDeviationsIntrinsics, stdDeviationsExtrinsics,