diff --git a/calibrators/intrinsic_camera_calibrator/intrinsic_camera_calibrator/intrinsic_camera_calibrator/camera_calibrator.py b/calibrators/intrinsic_camera_calibrator/intrinsic_camera_calibrator/intrinsic_camera_calibrator/camera_calibrator.py index 05f1c4c8..35a4adcd 100644 --- a/calibrators/intrinsic_camera_calibrator/intrinsic_camera_calibrator/intrinsic_camera_calibrator/camera_calibrator.py +++ b/calibrators/intrinsic_camera_calibrator/intrinsic_camera_calibrator/intrinsic_camera_calibrator/camera_calibrator.py @@ -396,7 +396,7 @@ def make_detection_group(self): self.raw_detection_label = QLabel("Detected:") self.raw_linear_error_rows_rms_label = QLabel("Linear error rows (rms):") self.raw_linear_error_cols_rms_label = QLabel("Linear error cols (rms):") - self.aspect_ratio_label = QLabel("Aspect Ratio:") + self.aspect_ratio_label = QLabel("Aspect ratio:") self.rough_tilt_label = QLabel("Rough tilt:") self.rough_angles_label = QLabel("Rough angles:") self.rough_position_label = QLabel("Rough position:") @@ -718,7 +718,7 @@ def start( ) if self.operation_mode == OperationMode.EVALUATION: self.setWindowTitle( - f"Camera intrinsics Evaluation Mode ({self.data_source.get_camera_name()})" + f"Camera intrinsics evaluation mode ({self.data_source.get_camera_name()})" ) logging.info("Init") @@ -880,14 +880,16 @@ def save_parameters(self, filename): calibrator_type = self.calibrator_type_combobox.currentData() calib_params = self.calibrator_dict[calibrator_type].get_parameters_values() with open(filename, "w") as file: - yaml.dump({"board_parameters": board_params}, file, default_flow_style=False) - yaml.dump({"board_type": self.board_type.value["name"]}, file, default_flow_style=False) - yaml.dump( - {"calibrator_type": calibrator_type.value["name"]}, file, default_flow_style=False - ) - yaml.dump({"calibration_parameters": calib_params}, file, default_flow_style=False) - yaml.dump({"data_collector": data_coll_params}, file, default_flow_style=False) - yaml.dump({"detector_params": detector_params}, file, default_flow_style=False) + all_params = { + "board_parameters": board_params, + "board_type" : self.board_type.value["name"], + "calibrator_type": calibrator_type.value["name"], + "calibration_parameters": calib_params, + "data_collector": data_coll_params, + "detector_params": detector_params + } + + yaml.dump(all_params, file, default_flow_style=False) def on_save_clicked(self): output_folder = QFileDialog.getExistingDirectory( @@ -964,7 +966,7 @@ def process_detection_results(self, img: np.array, detection: BoardDetection, im self.raw_detection_label.setText("Detected: False") self.raw_linear_error_rows_rms_label.setText("Linear error rows rms:") self.raw_linear_error_cols_rms_label.setText("Linear error cols rms:") - self.aspect_ratio_label.setText("Aspect Ratio:") + self.aspect_ratio_label.setText("Aspect ratio:") self.rough_tilt_label.setText("Rough tilt:") self.rough_angles_label.setText("Rough angles:") self.rough_position_label.setText("Rough position:") @@ -1075,7 +1077,7 @@ def process_detection_results(self, img: np.array, detection: BoardDetection, im f"Linear error cols rms: {err_rms_cols:.2f} px" # noqa E231 ) self.aspect_ratio_label.setText( - f"Aspect Ratio: {detection.get_aspect_ratio_pattern(camera_model):.2f} px" # noqa E231 + f"Aspect ratio: {detection.get_aspect_ratio_pattern(camera_model):.2f} px" # noqa E231 ) self.rough_tilt_label.setText( f"Rough tilt: {detection.get_tilt(camera_model):.2f} degrees" # noqa E231 @@ -1197,7 +1199,7 @@ def process_detection_results(self, img: np.array, detection: BoardDetection, im ) if self.operation_mode == OperationMode.EVALUATION: self.setWindowTitle( - f"Camera intrinsics Evaluation Mode ({self.data_source.get_camera_name()}). Data delay={detection_delay: .2f} Detection time={detection_time: .2f} fps={self.estimated_fps: .2f} Data time={img_stamp: .2f}" + f"Camera intrinsics evaluation mode ({self.data_source.get_camera_name()}). Data delay={detection_delay: .2f} Detection time={detection_time: .2f} fps={self.estimated_fps: .2f} Data time={img_stamp: .2f}" ) self.image_view.update() diff --git a/calibrators/intrinsic_camera_calibrator/intrinsic_camera_calibrator/intrinsic_camera_calibrator/views/image_view.py b/calibrators/intrinsic_camera_calibrator/intrinsic_camera_calibrator/intrinsic_camera_calibrator/views/image_view.py index d1bdcdb1..869a2fb1 100644 --- a/calibrators/intrinsic_camera_calibrator/intrinsic_camera_calibrator/intrinsic_camera_calibrator/views/image_view.py +++ b/calibrators/intrinsic_camera_calibrator/intrinsic_camera_calibrator/intrinsic_camera_calibrator/views/image_view.py @@ -270,7 +270,7 @@ def draw_indicators(self, painter: QPainter, display_size): ) painter.drawText(position_text_speed, "Speed") - # ToDo: define percentage to change skew and pct size to change to green + # TODO(Sergio): define percentage to change skew and pct size to change to green threshold_to_be_green = 0.3 if self.skew_percentage < threshold_to_be_green: pen_skew = QPen(color_red) @@ -297,7 +297,7 @@ def draw_indicators(self, painter: QPainter, display_size): # Draw the skew progress bar painter.drawRect(skew_indicator) - # ToDo: define percentage to change skew and pct size to change to green + # TODO(Sergio): define percentage to change skew and pct size to change to green threshold_to_be_green = 0.2 if self.board_size_percentage < threshold_to_be_green: pen_size_board = QPen(color_red)