Skip to content

Commit

Permalink
Merge pull request #406 from mprib/404-changing-exposure-deletes-tran…
Browse files Browse the repository at this point in the history
…slation-and-rotation

404 changing exposure deletes translation and rotation
  • Loading branch information
mprib committed Jun 27, 2023
2 parents fd2fa9a + 2751256 commit 7502a37
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions pyxy3d/configurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,15 +279,19 @@ def add_preconfigured_cam(params):
camera.rotation_count = params["rotation_count"]
camera.exposure = params["exposure"]

# if calibration done, then populate those as well
if "error" in params.keys():
if "error" in params.keys(): # then intrinsic params available
# if calibration done, then populate those as well
logger.info(f"Adding in preconfigured intrinsic params at port {port}")
logger.info(f"Camera RMSE error for port {port}: {params['error']}")
camera.error = params["error"]
camera.matrix = np.array(params["matrix"]).astype(float)
camera.distortions = np.array(params["distortions"]).astype(float)
camera.grid_count = params["grid_count"]
# except:
# logger.info("Unable to connect... camera may be in use.")

if "rotation" in params.keys(): # then extrinsic params available
logger.info(f"Adding in preconfigured extrinsic params at port {port}")
camera.rotation = cv2.Rodrigues(np.array(params["rotation"]))[0]
camera.translation = np.array(params["translation"])

with ThreadPoolExecutor() as executor:
for key, params in self.dict.items():
Expand All @@ -308,18 +312,6 @@ def save_point_estimates(self, point_estimates:PointEstimates):

self.update_toml()


# def get_live_stream_pool(self, tracker:Tracker = None):
# streams = {}
# cameras = self.get_cameras()

# for port, cam in cameras.items():
# logger.info(f"Adding stream associated with camera {port}")
# stream = LiveStream(cam, tracker=tracker)
# stream.change_resolution(cam.size)
# streams[port] = stream
# return streams



if __name__ == "__main__":
Expand Down

0 comments on commit 7502a37

Please sign in to comment.