Skip to content

Commit

Permalink
refactor: all comments form the discussion were addressed here
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioReyesSan committed Dec 13, 2024
1 parent 185f319 commit d8ab908
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:")
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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:")
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit d8ab908

Please sign in to comment.