From 1a179f852b7799554fb18570ed59af130d9da375 Mon Sep 17 00:00:00 2001 From: hannalee2 Date: Thu, 19 Sep 2024 12:40:32 -0700 Subject: [PATCH] Remove unused codes --- parallax/probe_calibration.py | 8 +++----- parallax/stage_widget.py | 16 ---------------- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/parallax/probe_calibration.py b/parallax/probe_calibration.py index c2f0e66..fd3be61 100644 --- a/parallax/probe_calibration.py +++ b/parallax/probe_calibration.py @@ -601,8 +601,7 @@ def update(self, stage, debug_info=None): self._update_local_global_point(debug_info) # Do no update if it is duplicates filtered_df = self._filter_df_by_sn(self.stage.sn) - self.transM_LR = self._get_transM(filtered_df, noise_threshold=100) # TODO original - #self.transM_LR = self._get_transM(filtered_df, remove_noise=False) # Test + self.transM_LR = self._get_transM(filtered_df, noise_threshold=100) if self.transM_LR is None: return @@ -620,9 +619,8 @@ def complete_calibration(self, filtered_df): # save the filtered points to a new file print("ProbeCalibration: complete_calibration") self.file_name = f"points_{self.stage.sn}.csv" - self.transM_LR = self._get_transM(filtered_df, save_to_csv=True, file_name=self.file_name, noise_threshold=20) # TODO original - #self.transM_LR = self._get_transM(filtered_df, save_to_csv=True, file_name=self.file_name, remove_noise=False) # Test - + self.transM_LR = self._get_transM(filtered_df, save_to_csv=True, file_name=self.file_name, noise_threshold=20) + if self.transM_LR is None: return diff --git a/parallax/stage_widget.py b/parallax/stage_widget.py index 9cf5f43..977ac43 100644 --- a/parallax/stage_widget.py +++ b/parallax/stage_widget.py @@ -504,7 +504,6 @@ def calibrate_stereo(self, cam_names, intrinsics, img_coords): # Update the model with the calibration results - #self.model.add_stereo_instance(self.calibrationStereo) TODO sorted_key = tuple(sorted((self.camA_best, self.camB_best))) self.model.add_stereo_calib_instance(sorted_key, self.calibrationStereo) self.model.add_camera_extrinsic( @@ -525,9 +524,6 @@ def calibrate_all_cameras(self, cam_names, intrinsics, img_coords): # Stereo Camera Calibration calibrationStereo = None - # Dictionary to store instances with sorted camera names as keys - #self.calibrationStereoInstances = {} - # Perform calibration between pairs of cameras print(cam_names) @@ -549,15 +545,6 @@ def calibrate_all_cameras(self, cam_names, intrinsics, img_coords): # Store the instance with a sorted tuple key sorted_key = tuple(sorted((camA, camB))) - """ # TODO - self.calibrationStereoInstances[sorted_key] = { - "instance": calibrationStereo, - "error": err, - "R_AB": R_AB, - "T_AB": T_AB, - "E_AB": E_AB, - "F_AB": F_AB, - }""" self.model.add_stereo_calib_instance(sorted_key, calibrationStereo) #calibrationStereo.print_calibrate_stereo_results(camA, camB) @@ -570,7 +557,6 @@ def calibrate_all_cameras(self, cam_names, intrinsics, img_coords): # Example of how to retrieve the instance with either (camA, camB) or (camB, camA) def get_calibration_instance(self, camA, camB): sorted_key = tuple(sorted((camA, camB))) - #return self.calibrationStereoInstances.get(sorted_key) TODO return self.model.get_stereo_calib_instance(sorted_key) def calibrate_cameras(self): @@ -712,8 +698,6 @@ def probe_detect_on_screens(self, camA, timestampA, snA, stage_info, tip_coordsA logger.debug(f"Camera calibration has not done {camA}, {camB}") continue - # calibrationStereoInstance = calibrationStereoInstance["instance"] TODO - #calibrationStereoInstance = calibrationStereoInstance["instance"] global_coords = calibrationStereoInstance.get_global_coords( camA, tip_coordsA, camB, tip_coordsB )