fixed calibration error return

This commit is contained in:
2025-12-12 13:13:58 +01:00
parent 5b388a1556
commit 86cd62218e
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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")