From 4199d3276c02d1b778cdf3967f947dad9868aa8d Mon Sep 17 00:00:00 2001 From: CursedRock17 Date: Tue, 30 Apr 2024 10:18:43 -0400 Subject: [PATCH] Adding a method to set scale Signed-off-by: CursedRock17 --- camera_calibration/src/camera_calibration/calibrator.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/camera_calibration/src/camera_calibration/calibrator.py b/camera_calibration/src/camera_calibration/calibrator.py index f2abc6344..e130fae54 100644 --- a/camera_calibration/src/camera_calibration/calibrator.py +++ b/camera_calibration/src/camera_calibration/calibrator.py @@ -406,6 +406,9 @@ def get_parameters(self, corners, ids, board, size): def set_cammodel(self, modeltype): self.camera_model = modeltype + def set_vga_scale(self, scale): + self.vga_scale = scale + def is_slow_moving(self, corners, ids, last_frame_corners, last_frame_ids): """ Returns true if the motion of the checkerboard is sufficiently low between @@ -537,7 +540,7 @@ def downsample_and_detect(self, img): height = img.shape[0] width = img.shape[1] if self.vga_scale == 0: - scale = math.sqrt((width*height) / (640.*480.)) + scale = math.sqrt((width * height) / (640. * 480.)) else: scale = self.vga_scale