File tree 2 files changed +24
-0
lines changed
2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 16
16
17
17
## [ Unreleased]
18
18
### Added
19
+ * ` examples/ ` directory for example scripts
19
20
### Changed
20
21
### Removed
21
22
Original file line number Diff line number Diff line change
1
+ import matplotlib as mpl
2
+ from pathlib import Path
3
+ from mpl_stereo import StereoSquare2D
4
+
5
+ curr_dir = Path (__file__ ).parent
6
+
7
+ ## User inputs
8
+ data_dir = curr_dir / '..' / 'src' / 'mpl_stereo' / 'data'
9
+ image_left = data_dir / 'church_left.jpg'
10
+ image_right = data_dir / 'church_right.jpg'
11
+ output = curr_dir / 'output.gif'
12
+
13
+ ## Plot the stereo square
14
+ data_left = mpl .image .imread (image_left )
15
+ data_right = mpl .image .imread (image_right )
16
+ stereosquare = StereoSquare2D ()
17
+ stereosquare .imshow_stereo (data_left , data_right , crop = True )
18
+ stereosquare .fig .set_size_inches (8 , 6 )
19
+ stereosquare .fig .set_dpi (320 )
20
+
21
+ ## Save to file
22
+ stereosquare .wiggle (output )
23
+ print (f'Wrote { output } ' )
You can’t perform that action at this time.
0 commit comments