File tree 2 files changed +25
-0
lines changed
2 files changed +25
-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
9
+ data_dir = curr_dir / '..' / 'src' / 'mpl_stereo' / 'data'
10
+ image_left = data_dir / 'church_left.jpg'
11
+ image_right = data_dir / 'church_right.jpg'
12
+ output = curr_dir / 'output.gif'
13
+
14
+ ## Plot the stereo square
15
+ data_left = mpl .image .imread (image_left )
16
+ data_right = mpl .image .imread (image_right )
17
+ stereosquare = StereoSquare2D ()
18
+ stereosquare .imshow_stereo (data_left , data_right , crop = True )
19
+ stereosquare .fig .set_size_inches (8 , 6 )
20
+ stereosquare .fig .set_dpi (320 )
21
+
22
+ ## Save to file
23
+ stereosquare .wiggle (output )
24
+ print (f'Wrote { output } ' )
You can’t perform that action at this time.
0 commit comments