-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
334e9af
commit 59c13b5
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
|
||
## [Unreleased] | ||
### Added | ||
* `examples/` directory for example scripts | ||
### Changed | ||
### Removed | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import matplotlib as mpl | ||
from pathlib import Path | ||
from mpl_stereo import StereoSquare2D | ||
|
||
curr_dir = Path(__file__).parent | ||
|
||
## User inputs | ||
# data_dir = curr_dir | ||
data_dir = curr_dir / '..' / 'src' / 'mpl_stereo' / 'data' | ||
image_left = data_dir / 'church_left.jpg' | ||
image_right = data_dir / 'church_right.jpg' | ||
output = curr_dir / 'output.gif' | ||
|
||
## Plot the stereo square | ||
data_left = mpl.image.imread(image_left) | ||
data_right = mpl.image.imread(image_right) | ||
stereosquare = StereoSquare2D() | ||
stereosquare.imshow_stereo(data_left, data_right, crop=True) | ||
stereosquare.fig.set_size_inches(8, 6) | ||
stereosquare.fig.set_dpi(320) | ||
|
||
## Save to file | ||
stereosquare.wiggle(output) | ||
print(f'Wrote {output}') |