diff --git a/ar_tag_pose/calibration.py b/ar_tag_pose/calibration.py index 10efe73..0a9858d 100644 --- a/ar_tag_pose/calibration.py +++ b/ar_tag_pose/calibration.py @@ -67,9 +67,9 @@ class Calibration: if no == ni and no > 0: ret, mtx, dist, r_vecs, t_vecs = cv.calibrateCamera(self.obj_points_list, self.img_points_list, image.shape, self.mtx, self.dist, rvecs=None, tvecs=None, flags=cv.CALIB_RATIONAL_MODEL, criteria=criteria) + error = ret if ret < thresh: success = True - error = ret self.mtx = mtx self.dist = dist diff --git a/ar_tag_pose/detector_board_main.py b/ar_tag_pose/detector_board_main.py index a6e2bfd..c37ffd7 100644 --- a/ar_tag_pose/detector_board_main.py +++ b/ar_tag_pose/detector_board_main.py @@ -207,7 +207,7 @@ class Detector(abc.ABC): print(f"{det}: Points matching success") elif k_ul == ord('c'): gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY) - ok, calib_err = self.calibration.process(gray, thresh=3*len(self.detector)) + ok, calib_err = self.calibration.process(gray, thresh=4*len(self.detector)) if ok: print(f"{self.camera_name}: Calibration success: Reprojection error={calib_err:.2f}") self.calibration.save(f"{RESULTS_FOLDER}/{self.camera_name}_cal.npz")