Skip to content

Commit

Permalink
calibration: better warnings around board configuration #713 (#724)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanTIE authored Feb 1, 2024
1 parent 9b2468d commit cdb7eb4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion camera_calibration/src/camera_calibration/calibrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,14 +323,17 @@ def __init__(self, boards, flags=0, fisheye_flags = 0, pattern=Patterns.Chessboa
if pattern == Patterns.Chessboard:
# Make sure n_cols > n_rows to agree with OpenCV CB detector output
self._boards = [ChessboardInfo("chessboard", max(i.n_cols, i.n_rows), min(i.n_cols, i.n_rows), i.dim) for i in boards]
if pattern == Patterns.ChArUco:
elif pattern == Patterns.ChArUco:
self._boards = boards
elif pattern == Patterns.ACircles:
# 7x4 and 4x7 are actually different patterns. Assume square-ish pattern, so n_rows > n_cols.
self._boards = [ChessboardInfo("acircles", min(i.n_cols, i.n_rows), max(i.n_cols, i.n_rows), i.dim) for i in boards]
elif pattern == Patterns.Circles:
# We end up having to check both ways anyway
self._boards = boards
else:
raise CalibratorException('pattern must be one of: Chessboard, Circles, ACircles, or ChArUco')


# Set to true after we perform calibration
self.calibrated = False
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def handle_monocular(self, msg):
max_chessboard_speed = self._max_chessboard_speed)
else:
self.c = MonoCalibrator(self._boards, self._calib_flags, self._fisheye_calib_flags, self._pattern,
checkerboard_flags=self.checkerboard_flags,
checkerboard_flags=self._checkerboard_flags,
max_chessboard_speed = self._max_chessboard_speed)

# This should just call the MonoCalibrator
Expand Down

0 comments on commit cdb7eb4

Please sign in to comment.