@@ -182,8 +182,8 @@ def disparity_range(rpc1, rpc2, x, y, w, h, H1, H2, matches, cfg, A=None):
182
182
disp: 2-uple containing the horizontal disparity range
183
183
"""
184
184
# compute exogenous disparity range if needed
185
- if cfg [ 'disp_range_method' ] in [ 'exogenous' , 'wider_sift_exogenous ' ]:
186
- exogenous_disp = rpc_utils .exogenous_disp_range_estimation (rpc1 , rpc2 ,
185
+ if 'exogenous' in cfg [ 'disp_range_method ' ]:
186
+ exogenous_disp = rpc_utils .exogenous_or_sift_disp_range_estimation (rpc1 , rpc2 ,
187
187
x , y , w , h ,
188
188
H1 , H2 , cfg , A ,
189
189
cfg ['disp_range_exogenous_high_margin' ],
@@ -192,7 +192,7 @@ def disparity_range(rpc1, rpc2, x, y, w, h, H1, H2, matches, cfg, A=None):
192
192
print ("exogenous disparity range:" , exogenous_disp )
193
193
194
194
# compute SIFT disparity range if needed
195
- if cfg [ 'disp_range_method' ] in [ 'sift' , 'wider_sift_exogenous ' ]:
195
+ if 'sift' in cfg [ 'disp_range_method ' ]:
196
196
if matches is not None and len (matches ) >= 2 :
197
197
sift_disp = disparity_range_from_matches (matches , H1 , H2 , w , h , cfg ['disp_range_extra_margin' ])
198
198
else :
@@ -220,6 +220,9 @@ def disparity_range(rpc1, rpc2, x, y, w, h, H1, H2, matches, cfg, A=None):
220
220
else :
221
221
disp = sift_disp or exogenous_disp
222
222
223
+ elif cfg ['disp_range_method' ] == 'sift_else_exogenous' :
224
+ disp = sift_disp if sift_disp is not None else exogenous_disp
225
+
223
226
elif cfg ['disp_range_method' ] == 'fixed_altitude_range' :
224
227
disp = alt_disp
225
228
0 commit comments