fixed calibration error return
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user