Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed camera model to pinhole (no lens distortion) for non-wide cameras #1094

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions calibrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions depthai_helpers/calibration_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down