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 plots and CLI #42

Merged
merged 32 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
e782985
Jitter correction plotting
bpurinton Aug 22, 2024
d28a400
create a useful geodataframe
bpurinton Aug 26, 2024
c261e0e
use read_angles to get roll, pitch, yaw
bpurinton Aug 26, 2024
eafb045
improvements
bpurinton Aug 26, 2024
5715faa
wip
bpurinton Aug 26, 2024
9b5bf39
wip
bpurinton Aug 26, 2024
f7151b1
ba test
bpurinton Aug 27, 2024
eddb217
more plotting experiments
bpurinton Aug 27, 2024
b45339d
some plot improvements
bpurinton Sep 12, 2024
04b2fbe
wip - messy
bpurinton Sep 14, 2024
6feab6c
wip
bpurinton Sep 19, 2024
463b0ef
reasonable summary plots
bpurinton Sep 19, 2024
3c3fc1b
minor plot tweaks
bpurinton Sep 20, 2024
46e15ae
wip
bpurinton Sep 20, 2024
62fb4f7
plot improvements
bpurinton Sep 20, 2024
d2cf845
some renaming and cleaning
bpurinton Oct 8, 2024
151f1c5
simplify plotting
bpurinton Oct 8, 2024
4781c48
minor improvement to colorscaling in mapview
bpurinton Oct 8, 2024
3595be6
move methods out of notebook
bpurinton Oct 15, 2024
842ec7b
minor fixes
bpurinton Oct 15, 2024
3b4acfc
change some default behavior
bpurinton Oct 15, 2024
7663fa2
default title
bpurinton Oct 15, 2024
6ddd725
ability to save fig
bpurinton Oct 15, 2024
13175fa
wip on cli
bpurinton Oct 17, 2024
291a7a0
wip on cli
bpurinton Oct 17, 2024
7ecab3d
wip on cli
bpurinton Oct 17, 2024
924c4bf
wip on cli
bpurinton Oct 17, 2024
3910eee
cleanup
bpurinton Oct 17, 2024
be4f1f2
added docs and tests
bpurinton Oct 17, 2024
381f3fa
update version after building and pushing to pypi
bpurinton Oct 17, 2024
73bb4be
update readme
bpurinton Oct 17, 2024
a5bbffa
another readme update
bpurinton Oct 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,4 @@ dmypy.json
# Other
*.profraw
*.DS_Store
scratch/
89 changes: 85 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,32 @@ During the `stereo` or `parallel_stereo` steps at the heart of the Ames Stereo P

Not all of those files are used in the plotting, but all are useful for re-processing and detailed analyses.

## Install via pip
## Installation

To get started with `asp_plot`, [find the `environment.yml` file here](https://github.com/uw-cryo/asp_plot/blob/main/environment.yml), download it locally, and create a conda environment:

```
$ conda env create -f environment.yml
```
pip install asp-plot

Then activate the environment:

```
$ conda activate asp_plot
```

And finally, install the `asp_plot` package and CLI tools with pip:

```
(asp_plot) $ pip install asp-plot
```

## Notebook example usage

Examples of the modular usage of the package can be found in the `notebooks/` directory.
Examples of the modular usage of the package can be found in the [`notebooks/` directory here](https://github.com/uw-cryo/asp_plot/tree/main/notebooks).


## CLI usage
## CLI usage: `asp_plot`

A full report and individual plots can be output via the command-line:

Expand Down Expand Up @@ -73,6 +87,73 @@ Options:
name of ASP processing
```

## CLI usage: `camera_optimization`

The `camera_optimization` command-line tool is a wrapper for outputting a summary plot after running tools like `bundle_adjust` and `jitter_solve`.

At its simplest is can be run like:

```
$ camera_optimization --original_cameras path/to/original_camera_1,path/to/original_camera_2 \
--optimized_cameras path/to/optimized_camera_1,path/to/optimized_camera_2
```

But, for more meaningful positions we at least recommend specifying a `map_crs` UTM EPSG code, and a directory to save the output figure to:

```
$ camera_optimization --original_cameras path/to/original_camera_1,path/to/original_camera_2 \
--optimized_cameras path/to/optimized_camera_1,path/to/optimized_camera_2 \
--map_crs 32728
--save_dir path/to/save_directory/
```

And there are many more options that can also be modified, by examining `camera_optimization --help`:

```
$ camera_optimization --help
Usage: camera_optimization [OPTIONS]

Options:
--original_cameras TEXT Original camera files, supplied as comma
separated list 'path/to/original_camera_1,path/to/original_camera_2'.
No default. Must be supplied.
--optimized_cameras TEXT Optimized camera files, supplied as comma
separated list 'path/to/optimized_camera_1,path/to/optimized_camera_2'.
No default. Must be supplied.
--map_crs TEXT UTM EPSG code for map projection. If not
supplied, the map will be plotted in
original camera coordinates of EPSG:4978
(ECEF).
--title TEXT Optional short title to append to figure
output. Default: None
--trim BOOLEAN Trim the beginning and end of the
geodataframes. Default: False
--near_zero_tolerance FLOAT If trim is True, the tolerance for near zero
values of the camera position differences to
trim from the beginning and end. Default:
1e-3
--trim_percentage INTEGER If trim is ture, the extra percentage of the
camera positions to trim from the beginning
and end. Default: 5
--shared_scales BOOLEAN If True, the position and angle difference
scales are shared between for each camera.
Default: False
--log_scale_positions BOOLEAN If True, the position difference scales are
log scaled. Default: False
--log_scale_angles BOOLEAN If True, the angle difference scales are log
scaled. Default: False
--upper_magnitude_percentile INTEGER
Percentile to use for the upper limit of the
mapview colorbars. Default: 95
--figsize TEXT Figure size as width,height. Default: 20,15
--save_dir TEXT Directory to save the figure. Default: None,
which does not save the figure.
--fig_fn TEXT Figure filename. Default:
camera_optimization_summary_plot.png.
--add_basemap BOOLEAN If True, add a contextily basemap to the
figure, which requires internet connection.
Default: False
```

## Development

Expand Down
Loading
Loading