Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

camera_optimization suggestion #50

Closed
dshean opened this issue Oct 22, 2024 · 2 comments
Closed

camera_optimization suggestion #50

dshean opened this issue Oct 22, 2024 · 2 comments

Comments

@dshean
Copy link
Member

dshean commented Oct 22, 2024

The CLI utility and function names should be clear that this is a plotting tool, not to be confused with a utility that does the actual camera optimization. Maybe camera_optimization_plot or something.
But I think this is only a csm_linescan_plot at this point, and only supports linescan input? At some point, we were hoping to support similar plotting tool for sequence of frame cameras, like the current orbit_plot.py tool. So maybe just csm_plot, or something.
While we want to plot changes before/after bundle_adjust or jitter_solve, we should also be able to plot a single camera or two cameras, without providing a second "corrected" set.
It would be good to swap in some "clean" test datasets, as the one in the notebook has outliers and is not necessarily representative - this is a minor issue, as I know it is just for testing and development, but these sample figures will inevitably end up used elsewhere, so we should use something that looks good and makes sense, easy to explain, etc.

@bpurinton
Copy link
Contributor

bpurinton commented Oct 26, 2024

  • rename camera_optimization to csm_plot. ✔️ 8662ad9
  • add flag for non-linescan camera (not implemented yet, but at least put the flag in). Actually, this is already implemented in the code, since it was copied from orbit_plot.py, which checks for the camera type and reads the file accordingly, such that the output positions and rotations are uniform for plotting, see below. There will probably be bugs to shake out when we actually attempt it, but on a quick read of the code I expect this to already work:

def read_positions_rotations_from_file(cam_file):
# Read the first line from cam_file
lineScan = isLinescan(cam_file)
positions = []
rotations = []
if lineScan:
# Read linescan data
(positions, rotations) = read_linescan_csm_cam(cam_file)
else:
# read Pinhole (Frame) files in ASP .tsai or CSM .json format
asp_dict = read_frame_cam_dict(cam_file)
# get camera rotation
position = asp_dict["cam_cen_ecef"]
rot_mat = asp_dict["rotation_matrix"]
positions.append(position)
rotations.append(rot_mat)
return (positions, rotations)

bpurinton added a commit that referenced this issue Oct 26, 2024
Related to #50

- Renames all camera_optimization code to csm_camera, including naming the CLI csm_camera_plot.
- Bumps version from 0.5.1 to 0.5.2
bpurinton added a commit that referenced this issue Oct 26, 2024
Related to #50.

- If a original/optimized camera pair is not provided to csm_camera_plot, it will just plot the single original/optimized camera that was provided.
@dshean
Copy link
Member Author

dshean commented Oct 26, 2024

Awesome. Thanks @bpurinton!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants