@@ -72,6 +72,16 @@ def func(args):
7272 ax .imshow (frame_b , cmap = plt .get_cmap ('Blues' ), alpha = .5 )
7373 plt .show ()
7474
75+ if settings .static_masking :
76+ frame_a [settings .static_mask ] = 0
77+ frame_b [settings .static_mask ] = 0
78+
79+ if settings .show_all_plots :
80+ fig , ax = plt .subplots (1 ,2 )
81+ ax [0 ].imshow (frame_a )
82+ ax [1 ].imshow (frame_b )
83+
84+
7585 if settings .dynamic_masking_method in ("edge" , "intensity" ):
7686 frame_a , mask_a = preprocess .dynamic_masking (
7787 frame_a ,
@@ -85,6 +95,16 @@ def func(args):
8595 filter_size = settings .dynamic_masking_filter_size ,
8696 threshold = settings .dynamic_masking_threshold ,
8797 )
98+ if settings .show_all_plots :
99+ fig , ax = plt .subplots (2 ,2 )
100+ ax [0 ,0 ].imshow (frame_a )
101+ ax [0 ,1 ].imshow (mask_a )
102+ ax [1 ,0 ].imshow (frame_b )
103+ ax [1 ,1 ].imshow (mask_b )
104+ # plt.gca().invert_yaxis()
105+ # plt.gca().set_aspect(1.)
106+ # plt.title('after first pass, invert')
107+ # plt.show()
88108
89109 # "first pass"
90110 x , y , u , v , s2n = first_pass (
@@ -741,8 +761,7 @@ def multipass_img_deform(
741761
742762 if settings .show_all_plots :
743763 plt .figure ()
744- nans = np .nonzero (mask )
745-
764+ nans = np .nonzero (mask )[0 ]
746765 plt .quiver (x [~ nans ], y [~ nans ], u [~ nans ], - v [~ nans ], color = 'b' )
747766 plt .quiver (x [nans ], y [nans ], u [nans ], - v [nans ], color = 'r' )
748767 plt .gca ().invert_yaxis ()
@@ -922,6 +941,9 @@ def __init__(self):
922941 self .show_all_plots = False
923942
924943 self .invert = False # for the test_invert
944+
945+ self .static_masking = False
946+ self .static_mask = None
925947
926948 self ._freeze ()
927949
0 commit comments