Skip to content

Commit

Permalink
Remove unused codes
Browse files Browse the repository at this point in the history
  • Loading branch information
hannalee2 committed Sep 19, 2024
1 parent 05e3e6a commit 1a179f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 21 deletions.
8 changes: 3 additions & 5 deletions parallax/probe_calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
16 changes: 0 additions & 16 deletions parallax/stage_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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)

Expand All @@ -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)
Expand All @@ -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):
Expand Down Expand Up @@ -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
)
Expand Down

0 comments on commit 1a179f8

Please sign in to comment.