Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Commit 88ecbdb

Browse files
Merge pull request #52 from 20treeAI/feat/sift_over_exogenous
feat: add sift_else_exogenous
2 parents a004ce1 + 3571a91 commit 88ecbdb

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

s2p/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116

117117
cfg['rpc_alt_range_scale_factor'] = 1
118118

119-
# method to compute the disparity range: "sift", "exogenous", "wider_sift_exogenous", "fixed_pixel_range", "fixed_altitude_range"
119+
# method to compute the disparity range: "sift", "exogenous", "wider_sift_exogenous", "fixed_pixel_range", "fixed_altitude_range", "sift_else_exogenous"
120120
cfg['disp_range_method'] = "wider_sift_exogenous"
121121
cfg['disp_range_exogenous_low_margin'] = -10
122122
cfg['disp_range_exogenous_high_margin'] = +100

s2p/rectification.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ def disparity_range(rpc1, rpc2, x, y, w, h, H1, H2, matches, cfg, A=None):
182182
disp: 2-uple containing the horizontal disparity range
183183
"""
184184
# 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,
187187
x, y, w, h,
188188
H1, H2, cfg, A,
189189
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):
192192
print("exogenous disparity range:", exogenous_disp)
193193

194194
# 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']:
196196
if matches is not None and len(matches) >= 2:
197197
sift_disp = disparity_range_from_matches(matches, H1, H2, w, h, cfg['disp_range_extra_margin'])
198198
else:
@@ -220,6 +220,9 @@ def disparity_range(rpc1, rpc2, x, y, w, h, H1, H2, matches, cfg, A=None):
220220
else:
221221
disp = sift_disp or exogenous_disp
222222

223+
elif cfg['disp_range_method'] == 'sift_else_exogenous':
224+
disp = sift_disp if sift_disp is not None else exogenous_disp
225+
223226
elif cfg['disp_range_method'] == 'fixed_altitude_range':
224227
disp = alt_disp
225228

s2p/rpc_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ def alt_to_disp(rpc1, rpc2, x, y, alt, H1, H2, A=None):
423423
return disp
424424

425425

426-
def exogenous_disp_range_estimation(rpc1, rpc2, x, y, w, h, H1, H2, cfg, A=None,
426+
def exogenous_or_sift_disp_range_estimation(rpc1, rpc2, x, y, w, h, H1, H2, cfg, A=None,
427427
margin_top=0, margin_bottom=0):
428428
"""
429429
Args:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def finalize_options(self):
6363
}
6464

6565
setup(name="s2p",
66-
version="1.6.7",
66+
version="1.6.8",
6767
description="Satellite Stereo Pipeline.",
6868
long_description=readme(),
6969
long_description_content_type='text/markdown',

0 commit comments

Comments
 (0)